Create a video generation task

post/v1/video/generations

Submit a video generation task. Text-to-video and image-to-video are both supported.

Returns a task ID that you can poll through the GET endpoint.

Authentication

Send your OLETOKEN API key as a Bearer token. Keys are created on the API Keys page of the console.

Authorization: Bearer $OLETOKEN_API_KEY

Request body

Content-Type:application/json

FieldTypeRequiredDescription
modelstringModel or style ID
promptstringText prompt
imagestringImage input (URL or Base64)
durationnumberVideo duration in seconds
widthintegerVideo width
heightintegerVideo height
fpsintegerVideo frame rate
seedintegerRandom seed
nintegerNumber of videos to generate
response_formatstringResponse format
userstringUser identifier
metadataobjectExtra parameters (such as negative_prompt, style, quality_level)

Responses

200Video generation task created

FieldTypeRequiredDescription
task_idstringTask ID
statusstringTask status

400Invalid request parameters

FieldTypeRequiredDescription
errorobject
messagestringError message
typestringError type
paramstring | nullThe parameter involved
codestring | nullError code

Example request

curl -X POST 'https://api.oletoken.ai/v1/video/generations' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "kling-v1",
    "prompt": "宇航员在月球上漫步",
    "duration": 5,
    "width": 1280,
    "height": 720
  }'