Routerra.ai

Video generation API

Create a video

With a Routerra API key, change the base URL to https://routerra.ai. Keep the model ID, request body and polling path. Replace the sample media URLs with publicly accessible files.

POST /v1/video/generations

Set ROUTERRA_API_KEY to your platform key and select an input format below.

Supported model IDs — doubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-2-0-mini, doubao-seedance-2-5

Optional fields include duration (seconds, default 5), resolution (default 720p), ratio (default 16:9), seed, camera_fixed, generate_audio, web_search and audios (audio reference URLs). Check the model table below for resolution and duration limits.

Text to video

Describe the scene in the prompt.

curl --fail-with-body "https://routerra.ai/v1/video/generations" \
  -H "Authorization: Bearer ${ROUTERRA_API_KEY}" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "doubao-seedance-2-0",
  "prompt": "A paper boat floats across a lake.",
  "generate_audio": true,
  "duration": 5,
  "resolution": "720p",
  "ratio": "16:9"
}'

First frame or first and last frames

Send one URL for the first frame or two in first/last order. The API also accepts image_urls for images.

curl --fail-with-body "https://routerra.ai/v1/video/generations" \
  -H "Authorization: Bearer ${ROUTERRA_API_KEY}" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "doubao-seedance-2-0",
  "prompt": "Move from sunrise to sunset.",
  "images": [
    "https://example.com/first.jpg",
    "https://example.com/last.jpg"
  ],
  "duration": 5,
  "resolution": "720p",
  "ratio": "16:9"
}'

Subject reference images

Mark subject references with role or type set to reference_image.

curl --fail-with-body "https://routerra.ai/v1/video/generations" \
  -H "Authorization: Bearer ${ROUTERRA_API_KEY}" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "doubao-seedance-2-0",
  "prompt": "Use the boat and lake as visual references.",
  "images": [
    {
      "url": "https://example.com/boat.jpg",
      "role": "reference_image"
    },
    {
      "url": "https://example.com/lake.jpg",
      "type": "reference_image"
    }
  ],
  "duration": 5,
  "resolution": "720p",
  "ratio": "16:9"
}'

Image and motion references

When you supply videos, images guide appearance and the clip guides motion.

curl --fail-with-body "https://routerra.ai/v1/video/generations" \
  -H "Authorization: Bearer ${ROUTERRA_API_KEY}" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "doubao-seedance-2-0",
  "prompt": "Animate the boat with the camera motion in the clip.",
  "images": [
    {
      "url": "https://example.com/boat.jpg",
      "type": "reference_image"
    }
  ],
  "videos": [
    "https://example.com/motion.mp4"
  ],
  "duration": 5,
  "resolution": "720p",
  "ratio": "16:9"
}'

Task status and results

GET /v1/video/generations/{task_id}

{"id":"task_example","task_id":"task_example","status":"pending","message":"Task submitted successfully"}

Set TASK_ID to the returned task_id and poll until a terminal status. Read data[0].url on success or error.message on failure.

curl --fail-with-body "https://routerra.ai/v1/video/generations/${TASK_ID}" \
  -H "Authorization: Bearer ${ROUTERRA_API_KEY}"

pending → processing → completed / failed

{"id":"task_example","task_id":"task_example","status":"completed","data":[{"url":"https://example.com/generated.mp4"}]}

Models

Send your Routerra API key as Authorization: Bearer YOUR_API_KEY with create, status and download requests. Call GET /v1/models to see which model IDs your key can access.

Model ID Output resolution Maximum duration
bytedance/seedance-2.5 480p, 720p, 1080p 30 seconds
bytedance/seedance-2.0 480p, 720p, 1080p, 4k 15 seconds
bytedance/seedance-2.0-fast 480p, 720p 15 seconds
bytedance/seedance-2.0-mini 480p, 720p 15 seconds

Ark native API

Send a JSON body with model and content. A text item contains your prompt. Set duration in seconds, or use -1 for automatic duration. resolution and ratio control output size and aspect ratio. Poll the task to track progress. The gateway rejects callback_url.

curl --fail-with-body 'https://routerra.ai/api/v3/contents/generations/tasks' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "bytedance/seedance-2.5",
    "content": [{"type": "text", "text": "Slow camera pan across a coastal village at sunrise."}],
    "duration": 5,
    "resolution": "720p",
    "ratio": "16:9"
  }'

Save the id from the create response as TASK_ID. Poll while status is queued or running. On succeeded, use content.video_url to download the video. For failed, expired or cancelled, stop polling and inspect error if present.

curl --fail-with-body 'https://routerra.ai/api/v3/contents/generations/tasks/TASK_ID' \
  -H 'Authorization: Bearer YOUR_API_KEY'

OpenAI-compatible API

Send model, prompt and the optional seconds field. duration is an alias for seconds. Put Ark-specific options such as resolution, ratio and references in metadata. The two JSON examples use the same video settings.

curl --fail-with-body 'https://routerra.ai/v1/videos' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "bytedance/seedance-2.5",
    "prompt": "Slow camera pan across a coastal village at sunrise.",
    "seconds": "5",
    "metadata": {"resolution": "720p", "ratio": "16:9"}
  }'

The create response includes a video object with an id. Save this as TASK_ID. Poll while status is queued or in_progress. Download the result once it is completed. If it is failed, inspect error if present.

curl --fail-with-body 'https://routerra.ai/v1/videos/TASK_ID' \
  -H 'Authorization: Bearer YOUR_API_KEY'

curl --fail-with-body 'https://routerra.ai/v1/videos/TASK_ID/content' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  --output video.mp4

OpenAI Responses API

For a Responses client, send the same model with input for the text prompt. Set background to true to return immediately, then poll GET /v1/responses/RESPONSE_ID using the returned id. When the response is completed, its output_text content contains a video HTML element with the URL in src.

curl --fail-with-body 'https://routerra.ai/v1/responses' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "bytedance/seedance-2.5",
    "input": "Slow camera pan across a coastal village at sunrise.",
    "background": true,
    "seconds": 5,
    "metadata": {"resolution": "720p", "ratio": "16:9"}
  }'

curl --fail-with-body 'https://routerra.ai/v1/responses/RESPONSE_ID' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Use a reference asset

Follow the asset management guide to create a reference and use the asset ID returned by GetAsset once Result.Status is Active. Replace ASSET_ID in the example with the entire asset ID. The asset must belong to your Routerra account and be available on the selected channel.

Add the following item to content in the Ark request or metadata.content in the OpenAI-compatible request. Keep the text prompt in its original field. Use video_url with reference_video or audio_url with reference_audio for supported video or audio references. The url field can also contain a publicly reachable media URL.

{
  "type": "image_url",
  "image_url": {"url": "asset://ASSET_ID"},
  "role": "reference_image"
}

Check the model ID and your key's access if submission fails. If submission returns HTTP 400 because a referenced asset is unavailable, verify the asset’s ownership and channel. For HTTP 429, back off before polling again.