API

Base URL https://api.studiorouter.com. For agents and LLMs: llms.txt, full agent guide, OpenAPI spec, MCP server at https://api.studiorouter.com/mcp.

1. Get a key

Your API key is in the dashboard; every account has one. Send it on every request as Authorization: Bearer sr_live_….

2. Start a generation

curl https://api.studiorouter.com/v1/videos \
  -H "Authorization: Bearer $STUDIOROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "wan-3.0",
    "prompt": "A red kite over a quiet beach at sunset",
    "duration": 5,
    "resolution": "480p"
  }'

The answer is a job with status: "queued" and an estimated_cost_usd. Credits for the estimate are held while it runs. Sending the same Idempotency-Key again returns the same job instead of starting another.

3. Wait for the result

curl "https://api.studiorouter.com/v1/jobs/job_…?wait=50" \
  -H "Authorization: Bearer $STUDIOROUTER_API_KEY"

wait holds the request open for up to 50 seconds until the job finishes. Repeat until status is succeeded, failed or blocked. On success output[0].url is the file, hosted by us, and cost_usd is what was charged: the provider's own price. Failed and blocked jobs are not charged.

Video parameters

modelRequired. Model id from the table below.
promptRequired. What to generate.
imageFirst-frame image URL. Switches the request to image-to-video.
last_imageLast-frame image URL, together with image.
reference_images, reference_videos, reference_audiosLists of reference media URLs.
videoSource video URL. Edits it; set "mode": "extend" to continue it instead.
durationSeconds. Default 5. Not used when editing, which keeps the source length.
resolution480p, 720p, 1080p… The default depends on the model.
aspect_ratio16:9 by default for text; with an input image the output follows the image.
audiofalse turns generated audio off where the model allows it.
seedInteger, where the model supports it.
prompt_expansionoff (default), on or quality: let the model rewrite the prompt, on models that offer it.
negative_promptWhat should not appear. Only providers that take one are used when it is set.
providerA provider id, or an ordered list, to pin where the job runs.
fallbackfalse (default): run only on the cheapest provider; if it fails, the job fails and nothing is charged. true: if it fails, try the next cheapest (up to 3).
webhook_urlWe POST the finished job to this URL.

The input mode follows from what you send: nothing extra is text-to-video, image is first-frame, image + last_image is first-and-last frame, any reference_* list is reference mode, and video is an edit.

Images

POST /v1/images takes model, prompt, optional images (input URLs, which makes it an edit), resolution (1k, 2k, 4k), aspect_ratio, quality (GPT Image models), output_format and seed where supported.

Local files

Inputs are public URLs. To use a file from disk, upload it first and use the returned URL:

curl https://api.studiorouter.com/v1/files -H "Authorization: Bearer $STUDIOROUTER_API_KEY" \
  -H "Content-Type: image/png" --data-binary @first-frame.png

Price a request first

POST /v1/estimate takes the same body as a generation and returns the estimated cost for each provider that can serve it, cheapest first. Nothing is created.

Agents (MCP)

Step-by-step setup for Claude Code, Codex and Claude Desktop is on Connect an agent.

claude mcp add --transport http studiorouter https://api.studiorouter.com/mcp \
  --header "Authorization: Bearer sr_live_…"

Tools: list_models, get_model, estimate_cost, generate, get_job, get_balance. generate and get_job accept wait_seconds (up to 50) so an agent can wait for the result without polling in a loop.

Errors

Errors are JSON with a message that says what went wrong. Failed and blocked jobs are not charged.

Model ids

Prices and providers for each model are on its page under Models, and in GET /v1/models.

ModelidInputs
Seedance 2.5seedance-2.5Text to video, Image to video, First + last frame, References, Edit a video, Extend a video
Wan 3.0wan-3.0Text to video, Image to video, First + last frame, References, Edit a video, Extend a video
Wan 3.0 Primewan-3.0-primeText to video, Image to video, First + last frame, References, Edit a video, Extend a video
HeyGen Video 1heygen-video-1Text to video, Image to video, References
FLUX 3 Videoflux-3Text to video, Image to video, First + last frame, Edit a video, Extend a video
Gemini Omni 1.2 Flashgemini-omni-1.2-flashText to video, Image to video, First + last frame, References, Edit a video, Extend a video
Kling v4.0kling-v4.0Text to video, Image to video, First + last frame, References, Edit a video, Extend a video
Grok Imagine Video 1.5grok-imagine-video-1.5Text to video, Image to video, References
H3 Maxh3-maxText to video, Image to video, First + last frame, References
GPT Image 2.6 Flaregpt-image-2.6-flareText to image, Edit images
GPT Image 2.6 Sunburstgpt-image-2.6-sunburstText to image, Edit images
Nano Banana 2.1nano-banana-2.1Text to image, Edit images
Nano Banana 2nano-banana-2Text to image, Edit images
Nano Banana Pronano-banana-proText to image, Edit images
Seedream 5.5seedream-5.5Text to image, Edit images
H3 Imageh3-imageText to image, Edit images