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
- Submit a job —
POST /v1/videos, returns a jobid. - Poll the job —
GET /v1/videos/{id}untilstatusis complete. - Download the result —
GET /v1/videos/{id}/contentstreams 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
| Field | Type | Description |
|---|---|---|
model | string | doubao-seedance-2-0-260128. |
prompt | string | Text description of the clip. |
seconds | string | Clip duration: "5" or "10". Default: "5". |
metadata.resolution | string | "720p" or "1080p". Default: "720p". |
metadata.ratio | string | Aspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4, or 21:9. |
metadata.seed | integer | Seed for reproducible output. |
metadata.watermark | boolean | Add a watermark. Default: false. |
metadata.camera_fixed | boolean | Lock the camera (no movement). |
metadata.generate_audio | boolean | Generate an audio track. Default: true. |
metadata.content | array | Reference 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.mp4Pricing 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- resolution —
720pis the1.0×baseline;1080pis2.25×(it renders 2.25× the pixels). - audio —
generate_audio: trueis1.20×;falseis1.0×. - seconds —
5or10; an omitted value is priced as5.
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
| Symptom | Cause | Fix |
|---|---|---|
404 not found on poll | Wrong job id, or a job submitted by a different key | Poll with the submitting key; check the id from submit. |
Job stays queued/in_progress | Long render | Keep polling; renders take minutes. |
400 not a video model | Model ID is not the video model | Use doubao-seedance-2-0-260128. |
400 reference assets rejected | Mixed image + video refs, or a non-http(s) video URL | Use image frames or one reference video; videos must be http(s). |
402 Payment Required | Zero balance at submit | Top up in the console → Billing. |