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

# Create video task

Create an asynchronous video generation task. The API returns a task ID immediately, and you can fetch results through [Query video task](/en/api/videos/query-task).

```
POST /v1/videos/generations
Authorization: Bearer <API_KEY>
Content-Type: application/json
```

## Request parameters

| Parameter                 | Type      | Required | Description                                                                                                                                    |
| ------------------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`                   | string    | Yes      | Use `dreamina-seedance-2-0`, `dreamina-seedance-2-0-mini`, or `dreamina-seedance-2-0-fast`. The actual available names come from `/v1/models`. |
| `content`                 | object\[] | Yes      | Input array. Supports `text`, `image_url`, `video_url`, and `audio_url`.                                                                       |
| `generate_audio`          | boolean   | No       | Whether to generate synced audio.                                                                                                              |
| `resolution`              | string    | No       | `480p`, `720p`, or `1080p`. Some fast models may not support `1080p`.                                                                          |
| `ratio`                   | string    | No       | Aspect ratio such as `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `21:9`, or `adaptive`.                                                               |
| `duration`                | integer   | No       | Duration in seconds. Common range is `[4, 15]`, and some models may accept `-1`.                                                               |
| `watermark`               | boolean   | No       | Whether to add a watermark.                                                                                                                    |
| `seed`                    | integer   | No       | Random seed.                                                                                                                                   |
| `safety_identifier`       | string    | No       | Unique end-user identifier used for safety review.                                                                                             |
| `execution_expires_after` | integer   | No       | Task timeout in seconds.                                                                                                                       |
| `service_tier`            | string    | No       | Service tier.                                                                                                                                  |
| `callback_url`            | string    | No       | Callback URL for task updates.                                                                                                                 |
| `return_last_frame`       | boolean   | No       | Whether to return the last frame image.                                                                                                        |

<Warning>
  Unsupported fields currently return 400: `frames`, `service_tier=flex`, and `dreamina-seedance-2-0-fast + resolution=1080p`.

  Do not send `price_class_code` or other internal fields.
</Warning>

## Input types

### Text

```json theme={null}
{
  "type": "text",
  "text": "Generate a 5-second city nightscape video with a slow push-in."
}
```

### Image

```json theme={null}
{
  "type": "image_url",
  "image_url": { "url": "https://example.com/product.png" },
  "role": "first_frame"
}
```

### Video

```json theme={null}
{
  "type": "video_url",
  "video_url": { "url": "https://example.com/reference.mp4" },
  "role": "reference_video"
}
```

### Audio

```json theme={null}
{
  "type": "audio_url",
  "audio_url": { "url": "https://example.com/bgm.mp3" },
  "role": "reference_audio"
}
```

## Examples

### Text to video

```bash theme={null}
curl -X POST "https://{your-domain}/v1/videos/generations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dreamina-seedance-2-0",
    "content": [
      {
        "type": "text",
        "text": "Generate a 5-second city nightscape video with neon reflections on wet streets."
      }
    ],
    "duration": 5,
    "resolution": "720p",
    "ratio": "16:9",
    "generate_audio": true,
    "watermark": false
  }'
```

### Image to video

```bash theme={null}
curl -X POST "https://{your-domain}/v1/videos/generations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dreamina-seedance-2-0-mini",
    "content": [
      {
        "type": "text",
        "text": "Slowly rotate the product on a clean desk with a subtle camera push."
      },
      {
        "type": "image_url",
        "image_url": { "url": "https://example.com/product.png" },
        "role": "first_frame"
      }
    ],
    "duration": 5,
    "resolution": "720p",
    "ratio": "1:1",
    "watermark": false
  }'
```

### Using assets

First call [Create asset](/en/api/videos/create-asset), then pass the returned `uri` into the video task.

```bash theme={null}
curl -X POST "https://{your-domain}/v1/videos/generations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dreamina-seedance-2-0-fast",
    "content": [
      {
        "type": "text",
        "text": "Use the reference image of a person standing on a city street and move the camera forward slowly."
      },
      {
        "type": "image_url",
        "image_url": { "url": "asset://asset_6f9a4c2b8d1e3a90" },
        "role": "reference_image"
      }
    ],
    "duration": 5,
    "resolution": "720p",
    "ratio": "16:9",
    "watermark": false
  }'
```

## Success response

HTTP status: `202 Accepted`

```json theme={null}
{
  "id": "vidtask_3cb6299b32d24f93a82e8a74b3e06161",
  "object": "video.generation.task",
  "created": 1779782400,
  "model": "dreamina-seedance-2-0",
  "status": "queued",
  "expires_at": 1779955200
}
```

## Error codes

| HTTP status | `error.type`              | Scenario                                                      |
| ----------- | ------------------------- | ------------------------------------------------------------- |
| 400         | `invalid_request_error`   | Missing `model` or `content`, or a parameter is out of range  |
| 400         | `endpoint_not_configured` | Video support is not enabled for the model                    |
| 400         | `model_endpoint_mismatch` | The model cannot be called through this endpoint              |
| 402         | `insufficient_balance`    | Not enough balance to create the task                         |
| 403         | `model_not_allowed`       | The API key allowlist does not include the model              |
| 404         | `task_not_found`          | The task does not exist or does not belong to the current key |
| 429         | `quota_exceeded`          | API key quota is exhausted                                    |
