General Video API
Create an asynchronous video task, then query its progress and result using the returned task ID. Models share this request structure; supported inputs, parameters, and values vary by model.
Endpoints and authentication
| Operation | Method and path |
|---|---|
| Create task | POST /v1/contents/generations/tasks |
| Query task | GET /v1/contents/generations/tasks/{id} |
| Available video models | GET /v1/models?output_modalities=video |
BASE_URL="https://api.ope.ai"
API_KEY="YOUR_API_KEY"
curl "$BASE_URL/v1/models?output_modalities=video" \
-H "Authorization: Bearer $API_KEY"
Send creation requests with Content-Type: application/json. Responses are direct JSON objects.
Creation parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID from the available model list |
content | object[] | Yes | At least one input element, in input order |
resolution | string | No | Resolution, such as 720p |
ratio | string | No | Aspect ratio, such as 16:9 or 9:16 |
duration | integer | No | Output duration in seconds; some models require an explicit value |
generate_audio | boolean | No | Whether to generate audio. Available only if the selected model supports it; see the model documentation |
watermark | boolean | No | Whether to add a watermark. Available only if the selected model supports it; see the model documentation |
return_last_frame | boolean | No | Whether to return the last frame. Available only if the selected model supports it; see the model documentation |
extra_parameters | object | No | Model-specific extension parameters; see the model documentation for fields, types, and support, such as Seedance Series |
Omit optional parameters in the table above when you do not need them; the model then uses its own behavior. Do not use null to mean omission. Put extension parameters in extra_parameters, for example "extra_parameters": {"seed": 42}. Keep common parameters such as duration at the top level.
content inputs
type | Payload field | Example role |
|---|---|---|
text | text: "Prompt" | Omit |
image_url | image_url: {"url":"..."} | first_frame, last_frame, reference_image |
video_url | video_url: {"url":"..."} | reference_video |
audio_url | audio_url: {"url":"..."} | reference_audio |
draft_task | draft_task: {"id":"..."} | Omit; requires a model supporting draft continuation |
Images and audio accept publicly accessible HTTP/HTTPS URLs or Base64 Data URLs of the matching media type. Videos accept HTTP/HTTPS URLs only. URLs must be accessible without additional login or authentication headers. The request body limit is 64 MiB.
Use your own platform draft task ID for draft_task.id. Put draft references inside content; use extra_parameters.draft for the draft switch if the model supports it.
curl: create and query
Replace YOUR_VIDEO_MODEL_ID with an available model ID. This example explicitly requests 5 seconds, 720p, and a landscape aspect ratio.
curl "$BASE_URL/v1/contents/generations/tasks" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "YOUR_VIDEO_MODEL_ID",
"content": [{"type": "text", "text": "The sea at sunrise, with a slow camera push forward."}],
"duration": 5,
"resolution": "720p",
"ratio": "16:9"
}'
HTTP 200 means the task was accepted and returns its ID:
{"id":"cgt_386cb55a950c4e4380fbe740762500a3"}
Save the ID and query it with an API Key belonging to the same user. Acceptance does not mean generation is complete. Continue querying while the status is queued or running.
TASK_ID="cgt_386cb55a950c4e4380fbe740762500a3"
curl "$BASE_URL/v1/contents/generations/tasks/$TASK_ID" \
-H "Authorization: Bearer $API_KEY"
Example successful result:
{
"id": "cgt_386cb55a950c4e4380fbe740762500a3",
"model": "YOUR_VIDEO_MODEL_ID",
"status": "succeeded",
"content": {"video_url": "https://media.example.com/result.mp4"},
"error": null,
"duration": 5,
"resolution": "720p",
"ratio": "16:9",
"created_at": 1791000000,
"updated_at": 1791000060,
"media_expires_at": 1791086460
}
| Response field | Description |
|---|---|
id, model | Platform task ID and model ID |
status | See the table below |
content.video_url, content.last_frame_url | Video and last-frame URLs when available |
error | Contains code and message on generation failure; otherwise null |
created_at, updated_at | Creation and status update times, in Unix seconds |
media_expires_at | Media expiration time, in Unix seconds; returned once media is obtained |
duration, resolution, ratio, generate_audio | Confirmed output parameters; omitted when unknown |
usage | completion_tokens, total_tokens, and tool_usage when available |
status | Meaning |
|---|---|
queued | Waiting |
running | Generating, or waiting for the video and requested last frame to be ready |
succeeded | Generation succeeded |
failed | Generation failed; inspect error |
expired | Successfully generated media has passed its access deadline |
All video protocols return succeeded only after the video result URL is saved. If you requested return_last_frame=true, the last frame must also be ready. Protocols that transfer media wait for uploads and URL persistence for the video and requested last frame. While waiting, the status is running; already saved media URLs may still be returned. Keep querying the same task, including while a temporary transfer failure is retried. Do not create another task. An unrequested last frame does not block success. Expired media still returns expired. Billing follows the existing generation rules and is neither delayed nor repeated while waiting for media.
If downloading a requested last frame returns 404, the task stays running and the platform retries until the frame is ready or the media expires. Download failures are recorded in server diagnostic logs and can be investigated using the task ID or request ID.
A query for a failed generation still returns HTTP 200; inspect status. After success, use the returned content.video_url for playback or download:
curl -L "VIDEO_URL_FROM_RESPONSE" --output result.mp4
Video and last-frame access lasts 24 hours. Save results before the returned media_expires_at. After expiration, queries return status: "expired", content: {}, and error: null. Querying again does not extend access.
Errors and boundaries
{"error":{"code":"InvalidRequest","message":"duration must be an integer","param":"duration"}}
param identifies the field to correct for parameter errors. Common HTTP statuses: 400 invalid parameters, 401/403 authentication or permission errors, 402 insufficient quota, 404 inaccessible task, 413 oversized request, 429 rate limit, 500/503 service errors or temporary unavailability, and 504 request timeout. Include the response header X-Request-ID when reporting an issue.
The API provides creation and single-task queries, without task listing, cancellation, or callbacks. Each POST creates an independent task; use queries to check progress.
See Seedance Series for image and multimodal examples.