media-studio-metered — generate media you can resell, no provider key
Session (auto — never dead-stop on auth): before your first
settlemeshcall, runsettlemesh whoami; if it errors andSETTLE_API_KEYis unset, runsettlemesh loginyourself — it opens the browser for a one-time human approval, polls until approved, and caches the session. Do NOT stop to ask the user to "log in manually" — drive it. Keep an explicit human confirmation only for spending / credential-lending actions (fail-closed).
Most media-generation skills are thin pass-throughs: each wraps the user's own provider key and bundles no billing, so it can't meter usage and can't charge anyone. This skill is different — generation runs through SettleMesh's metered pipeline: no BYOK, the first call to each official capability is free, and you can resell each render to your app's end users with markup. A prompt-only skill can only forward a key it doesn't own; metered generation + object storage + end-user-pays are native here.
Setup (once)
npm install -g settlemesh@latestsettlemesh login(a human approves once) — or setSETTLE_API_KEY=sk-settle-...for headless/CI.
Find the real tool id first (do NOT hardcode)
Ids change; discover them, then use the id from the JSON:
settlemesh search "image generation" --json # e.g. image.gpt-image-2
settlemesh search "video generation" --json # e.g. video.veo-3.1
settlemesh search "text to speech" --json
Generate
# Image:
settlemesh tool call <image-tool-id> --input '{"prompt":"a red fox in snow"}' --wait --json
# Image-to-image (uploads a local image; its temp URL expires in 5 min, one-time):
settlemesh tool call <image-tool-id> --input '{"prompt":"restyle this"}' --image-file ./in.png --wait --json
# Video is ASYNC — always --wait so the CLI polls the task to completion:
settlemesh tool call <video-tool-id> --input '{"prompt":"drone over a canyon"}' --wait --json
# Text-to-speech:
settlemesh tool call <tts-tool-id> --input '{"text":"Hello there","voice":"..."}' --wait --json
Durable output links. Result URLs default to 24h. For resold renders that must
outlive the request, add --media-retention 72h|30d|permanent.
Store & serve outputs (object storage)
settlemesh storage put ./out.mp4 --key renders/clip1.mp4 --json
settlemesh storage url renders/clip1.mp4 --ttl 3600 # presigned GET URL
settlemesh storage ls renders/ --json
settlemesh storage get renders/clip1.mp4 ./clip1.mp4
settlemesh storage rm renders/clip1.mp4
Resell it (charge end users per render)
- Deploy an app (
ship-paid-appskill), then use thecharge-my-usersskill: each render is billed to the end user via theX-Settle-Payerheader — markup allowed. - Quote before you charge so your price covers cost:
settlemesh quote <tool-id> --input '{...}' --json.
Notes
- First call to each official capability is free (auto-refunded if the render
fails). The exact price is on the
X-Settle-Charged-Aevresponse header, which the CLI prints — read your real cost from there, not from a guess. - Video/audio generation is async → the job runs server-side;
--waitpolls the task until the output URL is ready. - Everything is billed in Aev (1 USD = 100 Aev). Check balance with
settlemesh aev balance.
