Video generation API
Video generation is an asynchronous task: submitting returns a task ID right away, you then poll the task status and download the video when it is done. Only video generation models (models priced "per second" in the model catalog) can call these endpoints; calling them with a chat model returns 400.
This page covers the endpoints, lifecycle and errors shared by every video model. For the parameters, durations, resolutions and pricing of a specific model, open its model page below.
Parameters by model ID
Set model to the model ID shown in the console model catalog (without a namespace, e.g. seedance-2.0). You can only call models enabled for your API key; otherwise you get 403 model_not_allowed.
| Model ID | Series | Main capabilities | Parameters |
|---|---|---|---|
seedance-2.0 |
Seedance | Text / image / first-last frame / reference images, videos, audio | Seedance video models |
seedance-2.0-fast |
Seedance | Same, 480p / 720p | Seedance video models |
seedance-2.0-mini |
Seedance | Same, 480p / 720p | Seedance video models |
seedance-2.5 |
Seedance | Same, up to 30 s, video edit / extend | Seedance video models |
viduq3 |
Vidu | Reference-image-to-video | Vidu video models |
viduq3-turbo |
Vidu | Reference-image-to-video | Vidu video models |
viduq3-mix |
Vidu | Reference-image-to-video | Vidu video models |
viduq3-drama |
Vidu | Reference-image-to-video, optional reference video / audio | Vidu video models |
viduq4-preview |
Vidu | Reference-image-to-video, up to 4K | Vidu video models |
wan3.0-video |
Wan | Text / image / first-last frame / reference images, videos, audio | Wan video model |
kling-v3 |
Kling | Text / image to video, quality tiers, optional voices | Kling video models |
kling-v3-omni |
Kling | Text / image to video, quality tiers, optional reference video | Kling video models |
The console model catalog is the source of truth for availability: a model that is not in the catalog, or cannot be selected when creating a key, cannot be called yet.
Lifecycle and billing
- Submit: we hold balance for the requested duration and options (pre-authorization). If your balance is too low you get
402 insufficient_balanceand no task is created. - Generating: status goes
queued→in_progress. The held amount is shown in the console under Usage → Request logs → Video tasks. - Completed: we settle once for the actual billable seconds and release any extra hold; the charge then appears in the request log under its
request_id. - Failed / cancelled / timed out: no charge; the whole hold is released.
We keep advancing unfinished tasks in the background, so settlement does not depend on you polling. Billing units and prices are on each model page.
Protocol 1: OpenAI Videos (/v1/videos)
Submit a task
curl https://api.admesh.ai/v1/videos \
-H "Authorization: Bearer $ADMESH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0",
"prompt": "A corgi running on the beach at sunset, cinematic",
"seconds": "8",
"resolution": "720p"
}'
Returns a video object; id is the task ID (video_…):
{ "id": "video_8f2a…", "object": "video", "model": "seedance-2.0", "status": "queued", "progress": 0, "seconds": "8", "created_at": 1762650000 }
Get status
curl https://api.admesh.ai/v1/videos/$VIDEO_ID \
-H "Authorization: Bearer $ADMESH_API_KEY"
status is queued / in_progress / completed / failed. When completed, seconds is the billed duration; on failure error.code gives the reason.
Download the video
curl -L https://api.admesh.ai/v1/videos/$VIDEO_ID/content \
-H "Authorization: Bearer $ADMESH_API_KEY" \
-o video.mp4
Only completed tasks can be downloaded.
List and delete
GET /v1/videos: list your recent video tasks.DELETE /v1/videos/{id}: delete a video task.
Protocol 2: Task API (/v1/video/generations)
Submit a task
curl https://api.admesh.ai/v1/video/generations \
-H "Authorization: Bearer $ADMESH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0",
"prompt": "A corgi running on the beach at sunset, cinematic",
"duration": 5
}'
Returns { "task_id": "video_…", "id": "video_…", "status": "queued", … }.
Get status
curl https://api.admesh.ai/v1/video/generations/$TASK_ID \
-H "Authorization: Bearer $ADMESH_API_KEY"
Returns { "code": "success", "data": { "task_id": "…", "status": "IN_PROGRESS", "progress": "40%", … } }. data.status is QUEUED / IN_PROGRESS / SUCCESS / FAILURE; on SUCCESS, data.result_url is the download URL (the same /v1/videos/{id}/content, which also requires your API key).
All 12 models above support both protocols with the same request fields.
Fields shared by all models
| Field | Description |
|---|---|
model |
Required, the model ID |
prompt |
Text description. Whether it is required depends on the model; see the model page |
seconds / duration |
Output duration in whole seconds (seconds may also be a string such as "8"). If you send both they must match; if omitted the model default is used. Allowed values are on the model page |
streamis not supported;nmust be 1 (one video per request).- Fields not listed on the model page are ignored and never sent upstream. Pricing-related fields a model does not support (for example
modeon Vidu) return400, so you never believe you bought a tier while the model generates its default. - Whether reference images, videos and audio accept base64, and how many you can send, differs by model; see the model page.
Common errors
| HTTP | code | Description |
|---|---|---|
| 400 | invalid_request |
Not a video model / duration or resolution not allowed for the model / required media missing / unsupported option combination / downloading before completion |
| 401 | invalid_api_key |
The API key is invalid or revoked |
| 402 | insufficient_balance |
Not enough balance to hold this request |
| 403 | model_not_allowed |
The model is not enabled for this API key |
| 404 | not_found |
The task does not exist or belongs to another account |
| 429 | rate_limit_exceeded |
Rate limited, retry later |
| 502 / 503 / 504 | upstream_error / model_provider_unavailable / upstream_timeout |
Temporarily unavailable; no charge if the submission did not succeed |
Parameter errors name the field in message, for example images must NOT have fewer than 1 items or resolution must be one of 720p, 1080p for this model. When a task fails, OpenAI Videos gives the reason in error.code and the Task API in data.fail_reason. Failed tasks are not charged.