OpenAI Video API Integration Guide & Examples

MethodPathUse
POST/v1/video/generationsCreate a video task
GET/v1/videos/{task_id}Poll task status and result
GET/v1/videos/{task_id}/contentFetch the produced asset
DELETE/v1/videos/{task_id}Cancel an unfinished task (depends on whether the upstream supports it; returns provider_unsupported otherwise)

The request uses OpenAI Video-compatible fields. Models such as wan2.7-t2v / wan2.7-i2v / kling-v3 can also be called on their vendor's native protocol (see Wan 2.7 and Kling 3.0); wan3.0-video / wan3.0-video-prime are offered on the Bailian native protocol only (see Wan 3.0); which entrypoints a model is offered on follows the protocols listed for it in the Model Catalog, and calling one it is not offered on returns 400 model_protocol_not_offered. Tasks created on the native protocols can use the polling and asset endpoints below as well.

Create a task

bash
curl https://api.modelgo.ai/v1/video/generations \
  -H "Authorization: Bearer $MODELGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<model>","prompt":"a neon city cat","duration":4}'

A successful create returns a task_id; polling and asset fetches are keyed by it.

  • audio / audios are sent as reference audio (reference_audio); doubao-seedance-2.5 accepts audio-only references.
  • For doubao-seedance-2.5, omitting duration lets the model choose a length within 4–30 seconds (the official default); billing follows actual usage, with 30 seconds pre-authorized at creation and the rest released. See Seedance.

The platform does not check parameter support per model: a field that does not belong to the model may be silently ignored by the upstream while creation still returns 200. Treat that model's parameter reference as authoritative.

Poll task status

bash
curl https://api.modelgo.ai/v1/videos/task_123 \
  -H "Authorization: Bearer $MODELGO_API_KEY"
json
{
  "id": "task_123",
  "object": "video",
  "status": "completed",
  "progress": 100,
  "metadata": { "url": "https://.../video.mp4", "duration": 4, "resolution": "..." }
}

status is one of queued / in_progress / completed / failed; on completed, the asset URL appears in metadata.url.

Fetch the asset

The endpoint returns the video/mp4 bytes and supports Range requests. No credential is required: the URL in metadata.url is a capability link, so anyone holding it can download the asset. Treat it as a secret: do not share it publicly, log it, or store it long-term.

bash
curl https://api.modelgo.ai/v1/videos/task_123/content -o video.mp4
  • 409 while the task is still running; 404 when the asset has expired, is missing, or content download is not enabled.
  • When a task produces several assets, pick one with the index query parameter: omitted or 0 is the first asset, 1..N the others. A missing index returns 404.

Other entrypoints: the Seedance Video Inbound Protocol and the MiniMax Video Inbound Protocol.