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
modelstring—Model or style ID
promptstring—Text prompt
imagestring—Image input (URL or Base64)
durationnumber—Video duration in seconds
widthinteger—Video width
heightinteger—Video height
fpsinteger—Video frame rate
seedinteger—Random seed
ninteger—Number of videos to generate
response_formatstring—Response format
userstring—User identifier
metadataobject—Extra parameters (such as negative_prompt, style, quality_level)

Responses

200Video generation task created

FieldTypeRequiredDescription
task_idstring—Task ID
statusstring—Task status

400Invalid request parameters

FieldTypeRequiredDescription
errorobject——
messagestring—Error message
typestring—Error type
paramstring | null—The parameter involved
codestring | null—Error 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
  }'