GRGlobalRouter Docs
Console

Videos / POST

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 list

Request parameters

FieldTypeRequiredDescription
modelstringYesVideo model ID.
promptstringYesVideo generation prompt.
providerstringNoSpecify provider preferences.
routingobjectNoRouting preference, such as provider or strategy tags.
inputobjectNoTask input extension fields merged into the video task input.
contentobject[]NoMultimodal content parts.
image_urlstringNoReference image URL for image-to-video.
video_urlstringNoReference video URL for continuation or transformation.
audio_urlstringNoReference audio URL.
durationnumberNoVideo duration; ranges depend on model support.
duration_secondsnumberNoVideo duration alias.
resolutionstringNoResolution tier.
ratiostringNoAspect ratio alias.
aspect_ratiostringNoAspect ratio.
seedintegerNoRandom seed.
watermarkbooleanNoWhether to add a watermark.
generate_audiobooleanNoWhether to generate audio as well.
online_searchbooleanNoWhether to enable web search when the model supports it.
return_last_framebooleanNoWhether to return the last frame.
execution_expires_afterintegerNoExecution expiration time; units depend on model support.
safety_identifierstringNoSafety tracking identifier.
skip_asset_registerbooleanNoWhether to skip artifact persistence.
srobjectNoSuper Resolution post-processing configuration.
webhook_urlstringNoCallback URL after task completion or failure.
metadataobjectNoApplication metadata.
priorityintegerNoTask priority from 0 to 10.
idempotency_keystringNoIdempotency key in the request body; the Idempotency-Key header may also be used.
Idempotency-KeyheaderNoIdempotency 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

FieldTypeRequiredDescription
idstringYesTask ID.
objectstringYesAlways task.
statusstringYesStatus such as queued, running, succeeded, or failed.
progressnumberYesTask progress, from 0 to 1.
progress_detailobjectNoDetailed progress information.
typestringYesTask type, such as video_generation.
capabilitystringNoTask capability tag.
modelstringYesModel ID used by the task.
inputobjectYesTask input snapshot.
outputarrayNoArtifact list after task success.
result.original_artifactsarrayNoOriginal generated artifact saved when SR is enabled.
result.sr_artifactsarrayNoEnhanced artifact after SR.
result.default_artifactsstringNoWhether current output uses original or sr.
resultobjectNoProvider result summary.
errorobjectNoError information on failure.
usageobjectNoUsage and billing details.
attemptobjectYesRetry count summary, including current and max.
linksobjectNoQuery, cancellation, or event subscription URL.
metadata.srobjectNoSubtask summary when SR is enabled.
links.selfstringNoTask query URL.
providerstringNoProvider that executed the task.
cost_usdnumberNoTask cost.
billing_model_keystringNoBilling model key.
discount_idstringNoDiscount ID.
discount_factornumberYesDiscount factor.
list_costnumberYesList-price cost before discounts.
discount_amountnumberYesDiscount amount.
actual_costnumberYesActual charge.
webhook_urlstringNoTask callback URL.
metadataobjectNoApplication metadata.
priorityintegerYesTask priority.
started_atstringNoTask start time.
finished_atstringNoTask end time.
completed_atstringNoTask completion time.
canceled_atstringNoTask cancellation time.
created_atstringYesTask creation time.
updated_atstringYesTask update time.

Response example

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

HTTPCodeDescription
401UNAUTHORIZEDMissing or invalid Authorization Bearer token.
403FORBIDDENThe current API key is not allowed to call this scope or model.
429RATE_LIMITEDRequests are too frequent or the asynchronous task queue is full; reduce concurrency or retry later.