Skip to content

Video generation

greenrouter exposes video generation (doubao-seedance-2-0-260128) through an asynchronous, job-based API: you submit a prompt, poll the job, then download the rendered file. All routes are live and authenticate with an sk-ru-… key, exactly like chat.

Flow

  1. Submit a jobPOST /v1/videos, returns a job id.
  2. Poll the jobGET /v1/videos/{id} until status is complete.
  3. Download the resultGET /v1/videos/{id}/content streams the MP4.

1. Submit

Окно терминала
curl https://api.ru-llm.relay2.xyz/v1/videos \
-H "Authorization: Bearer sk-ru-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-260128",
"prompt": "A timelapse of clouds over a mountain range at sunrise",
"seconds": "5",
"metadata": {
"resolution": "720p",
"ratio": "16:9",
"generate_audio": true
}
}'

The submit response is OpenAI Sora-compatible — a job descriptor with the id you poll on:

{ "id": "video_abc123", "status": "queued" }

Settings

FieldTypeDescription
modelstringdoubao-seedance-2-0-260128.
promptstringText description of the clip.
secondsstringClip duration: "5" or "10". Default: "5".
metadata.resolutionstring"720p" or "1080p". Default: "720p".
metadata.ratiostringAspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4, or 21:9.
metadata.seedintegerSeed for reproducible output.
metadata.watermarkbooleanAdd a watermark. Default: false.
metadata.camera_fixedbooleanLock the camera (no movement).
metadata.generate_audiobooleanGenerate an audio track. Default: true.
metadata.contentarrayReference image(s) or a reference video — see below.

Reference image / video

Pass reference assets under metadata.content. Use image frames (first_frame / last_frame) or a single reference video — the two kinds cannot be combined in one request. A reference image may be an http(s) URL or a base64 data:image/… URI; a reference video must be an http(s) URL.

{
"model": "doubao-seedance-2-0-260128",
"prompt": "Pan across the scene as the sun rises",
"seconds": "5",
"metadata": {
"resolution": "1080p",
"content": [
{ "type": "image_url", "image_url": { "url": "https://example.com/start.png" }, "role": "first_frame" }
]
}
}

2. Poll

Окно терминала
curl https://api.ru-llm.relay2.xyz/v1/videos/video_abc123 \
-H "Authorization: Bearer sk-ru-YOUR_KEY"
{ "id": "video_abc123", "status": "completed" }

The status envelope is relayed verbatim from the renderer; poll every few seconds until it reports completion (or a failure). A job can only be polled by the account that submitted it — another key gets a 404.

3. Download

The completed render streams directly from the content route — there is no separate signed URL to manage:

Окно терминала
curl -L https://api.ru-llm.relay2.xyz/v1/videos/video_abc123/content \
-H "Authorization: Bearer sk-ru-YOUR_KEY" \
-o out.mp4

Pricing quote (optional)

Need the price before you commit? POST /v1/videos/cost returns the exact charge for a given settings body without submitting a job or touching your balance:

Окно терминала
curl https://api.ru-llm.relay2.xyz/v1/videos/cost \
-H "Authorization: Bearer sk-ru-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "doubao-seedance-2-0-260128", "seconds": "10", "metadata": { "resolution": "1080p" } }'
{ "cost_nano_usd": 2160000000, "model": "doubao-seedance-2-0-260128" }

Billing

Seedance is billed per second of video, scaled by the generation settings:

charge = per_second_rate × seconds × resolution_multiplier × audio_multiplier
  • resolution720p is the 1.0× baseline; 1080p is 2.25× (it renders 2.25× the pixels).
  • audiogenerate_audio: true is 1.20×; false is 1.0×.
  • seconds5 or 10; an omitted value is priced as 5.

The charge is debited once, when the job is accepted at submit — not on completion. That is where the fail-closed funds hold sits, so a zero-balance account is rejected with 402 before any render starts. A submission rejected at submit (e.g. a bad request) is not billed; the poll and download routes are always free. See the Models & Pricing page and the console Pricing page for the current per-second rate.

Troubleshooting

SymptomCauseFix
404 not found on pollWrong job id, or a job submitted by a different keyPoll with the submitting key; check the id from submit.
Job stays queued/in_progressLong renderKeep polling; renders take minutes.
400 not a video modelModel ID is not the video modelUse doubao-seedance-2-0-260128.
400 reference assets rejectedMixed image + video refs, or a non-http(s) video URLUse image frames or one reference video; videos must be http(s).
402 Payment RequiredZero balance at submitTop up in the console → Billing.