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_KEYRequest body
Content-Type:application/json
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | — | Model or style ID |
| prompt | string | — | Text prompt |
| image | string | — | Image input (URL or Base64) |
| duration | number | — | Video duration in seconds |
| width | integer | — | Video width |
| height | integer | — | Video height |
| fps | integer | — | Video frame rate |
| seed | integer | — | Random seed |
| n | integer | — | Number of videos to generate |
| response_format | string | — | Response format |
| user | string | — | User identifier |
| metadata | object | — | Extra parameters (such as negative_prompt, style, quality_level) |
Responses
200Video generation task created
| Field | Type | Required | Description |
|---|---|---|---|
| task_id | string | — | Task ID |
| status | string | — | Task status |
400Invalid request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| error | object | — | — |
| message | string | — | Error message |
| type | string | — | Error type |
| param | string | null | — | The parameter involved |
| code | string | 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
}'
