> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nodesms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Video Generation Task

> Submit a video generation task, supporting text-to-video and image-to-video. Returns a task ID that can be used to query task status via the GET endpoint.

## Headers

**Authorization** `string` *required*

Bearer token authentication. Format: `Authorization: Bearer sk-xxxxxx`

## Body

Format: `application/json`

**model** `string`

Model/style ID.

**prompt** `string`

Text description prompt.

**image** `string`

Image input (URL or Base64).

**duration** `number`

Video duration (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`

Extended parameters (such as negative\_prompt, style, quality\_level, etc.).

**Properties**

**\[key: string]** `any`

Arbitrary key-value pairs, where keys are strings and values are of any type.

## Response

### 200 Video generation task created successfully

Format: `application/json`

**task\_id** `string`

Task ID.

**status** `string`

Task status.

### 400 Request parameter error

Format: `application/json`

**error** `object`

Error information.

**Properties**

**message** `string`

Error message.

**type** `string`

Error type.

**param** `string | null`

Related parameter.

**code** `string | null`

Error code.

```bash cURL theme={"dark"}
curl -X POST "https://t.ato2.nodesms.com/v1/video/generations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora",
    "prompt": "A cute cat playing in the garden",
    "duration": 5,
    "width": 1280,
    "height": 720
  }'
```

```python Python theme={"dark"}
import requests

response = requests.post(
    "https://t.ato2.nodesms.com/v1/video/generations",
    headers={"Authorization": "Bearer sk-xxxxx"},
    json={
        "model": "sora",
        "prompt": "A cute cat playing in the garden",
        "duration": 5,
        "width": 1280,
        "height": 720,
    },
)
print(response.json())
```

```json 200 theme={"dark"}
{
  "task_id": "string",
  "status": "string"
}
```

```json 400 theme={"dark"}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": null,
    "code": null
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.