Create video
Creates an OpenAI-compatible video generation task.
POST /v1/videos/generations
Video generation is asynchronous. After creation, poll /v1/tasks/{task_id} with the returned task ID or receive completion through webhook_url.
Back to Videos endpoint listRequest parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Video model ID. |
prompt | string | Yes | Video generation prompt. |
provider | string | No | Specify provider preferences. |
routing | object | No | Routing preference, such as provider or strategy tags. |
input | object | No | Task input extension fields merged into the video task input. |
content | object[] | No | Multimodal content parts. |
image_url | string | No | Reference image URL for image-to-video. |
video_url | string | No | Reference video URL for continuation or transformation. |
audio_url | string | No | Reference audio URL. |
duration | number | No | Video duration; ranges depend on model support. |
duration_seconds | number | No | Video duration alias. |
resolution | string | No | Resolution tier. |
ratio | string | No | Aspect ratio alias. |
aspect_ratio | string | No | Aspect ratio. |
seed | integer | No | Random seed. |
watermark | boolean | No | Whether to add a watermark. |
generate_audio | boolean | No | Whether to generate audio as well. |
online_search | boolean | No | Whether to enable web search when the model supports it. |
return_last_frame | boolean | No | Whether to return the last frame. |
execution_expires_after | integer | No | Execution expiration time; units depend on model support. |
safety_identifier | string | No | Safety tracking identifier. |
skip_asset_register | boolean | No | Whether to skip artifact persistence. |
sr | object | No | Super Resolution post-processing configuration. |
webhook_url | string | No | Callback URL after task completion or failure. |
metadata | object | No | Application metadata. |
priority | integer | No | Task priority from 0 to 10. |
idempotency_key | string | No | Idempotency key in the request body; the Idempotency-Key header may also be used. |
Idempotency-Key | header | No | Idempotency key to avoid duplicate task creation during client retries. |
Request examples
curl "https://api.globalrouter.com/v1/videos/generations" \
-H "Authorization: Bearer $GR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: video-demo-001" \
-d '{
"model": "seedance-video",
"prompt": "一段安静的城市天台日落镜头",
"provider": "doubao",
"routing": { "provider": "doubao" },
"input": { "negative_prompt": "低清晰度、闪烁" },
"content": [
{ "type": "text", "text": "保持镜头稳定" }
],
"image_url": "https://example.com/reference.png",
"video_url": "https://example.com/source.mp4",
"audio_url": "https://example.com/music.mp3",
"duration": 5,
"duration_seconds": 5,
"resolution": "1080p",
"ratio": "16:9",
"aspect_ratio": "16:9",
"seed": 42,
"watermark": false,
"generate_audio": true,
"online_search": false,
"return_last_frame": true,
"execution_expires_after": 3600,
"safety_identifier": "tenant-user-123",
"skip_asset_register": false,
"sr": { "provider": "auto", "mode": "auto", "resolution": "1080p" },
"webhook_url": "https://example.com/webhooks/gr-video",
"metadata": { "project": "launch" },
"priority": 5,
"idempotency_key": "video-demo-001"
}'Response fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Task ID. |
object | string | Yes | Always task. |
status | string | Yes | Status such as queued, running, succeeded, or failed. |
progress | number | Yes | Task progress, from 0 to 1. |
progress_detail | object | No | Detailed progress information. |
type | string | Yes | Task type, such as video_generation. |
capability | string | No | Task capability tag. |
model | string | Yes | Model ID used by the task. |
input | object | Yes | Task input snapshot. |
output | array | No | Artifact list after task success. |
result.original_artifacts | array | No | Original generated artifact saved when SR is enabled. |
result.sr_artifacts | array | No | Enhanced artifact after SR. |
result.default_artifacts | string | No | Whether current output uses original or sr. |
result | object | No | Provider result summary. |
error | object | No | Error information on failure. |
usage | object | No | Usage and billing details. |
attempt | object | Yes | Retry count summary, including current and max. |
links | object | No | Query, cancellation, or event subscription URL. |
metadata.sr | object | No | Subtask summary when SR is enabled. |
links.self | string | No | Task query URL. |
provider | string | No | Provider that executed the task. |
cost_usd | number | No | Task cost. |
billing_model_key | string | No | Billing model key. |
discount_id | string | No | Discount ID. |
discount_factor | number | Yes | Discount factor. |
list_cost | number | Yes | List-price cost before discounts. |
discount_amount | number | Yes | Discount amount. |
actual_cost | number | Yes | Actual charge. |
webhook_url | string | No | Task callback URL. |
metadata | object | No | Application metadata. |
priority | integer | Yes | Task priority. |
started_at | string | No | Task start time. |
finished_at | string | No | Task end time. |
completed_at | string | No | Task completion time. |
canceled_at | string | No | Task cancellation time. |
created_at | string | Yes | Task creation time. |
updated_at | string | Yes | Task update time. |
Response example
{
"id": "task_video_01HV...",
"object": "task",
"type": "video_generation",
"status": "queued",
"progress": 0,
"progress_detail": {},
"model": "seedance-video",
"input": {
"prompt": "一段安静的城市天台日落镜头",
"duration_seconds": 5,
"ratio": "16:9"
},
"output": null,
"result": null,
"error": null,
"usage": null,
"attempt": { "current": 1, "max": 3 },
"links": {
"self": "/v1/tasks/task_video_01HV...",
"events": "/v1/tasks/task_video_01HV.../events"
},
"provider": "doubao",
"metadata": { "project": "launch" },
"priority": 5,
"created_at": "2026-06-26T10:00:00Z",
"updated_at": "2026-06-26T10:00:00Z"
}Errors
| HTTP | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid Authorization Bearer token. |
| 403 | FORBIDDEN | The current API key is not allowed to call this scope or model. |
| 429 | RATE_LIMITED | Requests are too frequent or the asynchronous task queue is full; reduce concurrency or retry later. |