Open AI Image API

API reference

Create a video task

Starts a Seedance video task and returns its ID. Use GET /v1/tasks/{task_id} to check the status. Reuse request_id when retrying to avoid creating a second task.

POST/v1/videos/generations

Authorization

AuthorizationBearer <token>

Create a Open AI Image API key in Settings. Send it only from a trusted server.

In: header

Request Body

modelstring

A public video model ID.

"seedance_2_5" | "seedance_2_0" | "seedance_2_0_fast" | "seedance_2_0_mini"
promptstring

Describe the video you want to create.

1 <= length <= 10000
parameters?object

Video generation parameters. Omitted parameters use the model defaults.

Properties
duration?integer

The video length in seconds. Supported values depend on the model.

1 <= value <= 30
resolution?string

The output resolution. Available options depend on the model.

"480p" | "720p" | "1080p"
aspect_ratio?string

The output aspect ratio. Only supported models accept adaptive.

"16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive"
generate_audio?boolean

Set to true to generate synchronized audio when the model supports it.

reference_urls?array<string>

Upload files to this account’s asset library first, then use their /api/studio/media/ paths. Types and counts depend on the model. Download private outputs using the same Authorization header.

Array Item
string

A private media path owned by this account.

max_creditsinteger

Maximum credits authorized for this request. A higher quote is rejected before charging.

1–10000
request_id?string

A UUID for this request. Reuse it when retrying to avoid creating a second task or charge.

format: uuid

Response Body

202
task_idstring

The task identifier.

statusstring

The current task status.

"pending" | "processing" | "success" | "failed" | "canceled"
credits_usednumber

The task’s credit cost. Credits are returned if generation fails.

outputsarray<object>

Output media for a successful task.

Array Item
urlstring

The output media URL.

thumbnail?string

The thumbnail URL, when available.

error?string

The error message when generation fails.

400
errorobject

Choose an available video model

Properties
messagestring

The error message.

codenumber

The HTTP status code.

401
errorobject

A valid API key is required

Properties
messagestring

The error message.

codenumber

The HTTP status code.

403
errorobject

Product API is disabled

Properties
messagestring

The error message.

codenumber

The HTTP status code.

413
errorobject

Request is too large

Properties
messagestring

The error message.

codenumber

The HTTP status code.

429
errorobject

Too many requests

Properties
messagestring

The error message.

codenumber

The HTTP status code.

500
errorobject

Unable to complete the request

Properties
messagestring

The error message.

codenumber

The HTTP status code.

503
errorobject

This model is not configured yet. Please try another model.

Properties
messagestring

The error message.

codenumber

The HTTP status code.

curl -X POST "https://openaiimage.com/v1/videos/generations" \
  -H "Authorization: Bearer sk_sd_example" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "seedance_2_0_fast",
  "prompt": "A paper boat crossing a rain-soaked neon street, cinematic camera movement",
  "parameters": {
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "generate_audio": true
  },
  "request_id": "72c1ca71-5e68-4a76-9c3b-bbc036261e30",
  "max_credits": 65
}'
{
  "task_id": "d3a7b249c28a1e05f9210d16af47c86809a58cad92a36fc91138da677be03245",
  "status": "processing",
  "credits_used": 5,
  "outputs": []
}