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

# Create Task (Volc Compatible)

> Create a Seedance 2.0 task with a Volc-style REST body or Action request.

## Overview

These endpoints are for teams that already use the Volc-style Seedance task shape. They preserve the task-oriented request and response structure while using AI Sonar authentication, billing, model availability, and task polling.

See also [Seedance 2.0 Video Models](/guides/seedance-2-video) and [Video Generation](/guides/video-generation).

## Authentication And Endpoints

* Use `Authorization: Bearer <API_KEY>`.
* Volc AK/SK signing is not accepted in this version. Requests with only AK/SK signing return a Volc-style authentication error.
* `Version` may be omitted. If provided, it must be `2024-01-01`.

| Mode          | Request                                                                 |
| ------------- | ----------------------------------------------------------------------- |
| REST create   | `POST /api/v3/contents/generations/tasks`                               |
| Action create | `POST /api/v3?Action=CreateContentsGenerationsTasks&Version=2024-01-01` |

## Content Rules

* `type: "text"` is the prompt text.
* `type: "image_url"` without `role`, or with `role: "first_frame"`, is treated as the first frame.
* `role: "last_frame"` must be paired with a first frame.
* `role: "reference_image"`, `reference_video`, and `reference_audio` are used as references.
* `image_url.url` accepts a public image URL or a material URI such as `asset://asset-YYYYMMDDHHMMSS-xxxxx`. The `role` determines whether that material is a first frame, last frame, or reference image.
* As a compatibility shorthand, one top-level `material_asset_id` is treated as the first frame. Multiple top-level `material_asset_ids` are rejected because their roles are ambiguous; put them in `content[]` with explicit roles instead.
* Do not mix first/last frame inputs with reference media in one request.

## Parameter Notes

* `ratio` accepts `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, `21:9`, or `adaptive`.
* `duration` is the video length in seconds, including model-supported automatic duration values.
* `resolution` accepts `480p`, `720p`, `1080p`, or `4k` when supported by the selected Seedance model.
* `generate_audio` defaults to `true`; set it to `false` for a silent video.
* `watermark`, `return_last_frame`, `seed`, `priority`, `execution_expires_after`, and `safety_identifier` are accepted when valid for the selected model.
* `callback_url` is not supported yet. Poll task status instead.

## Image Preparation

When `content[]` contains image URLs, AI Sonar prepares them as reusable materials when required by the selected Seedance model. If preparation is not complete within 60 seconds, the create request returns a retryable material-preparing error instead of submitting an incomplete video task.

For existing materials, use the public `asset-YYYYMMDDHHMMSS-xxxxx` ID rather than an original asset ID returned by another system. AI Sonar verifies material ownership before generation.

## Create Response

```json theme={null}
{
  "id": "cgt-0123456789abcdef0123456789abcdef"
}
```

The create response contains only the compatibility task ID. Store it and poll the task endpoint.

## Example

### REST Create

```bash theme={null}
curl https://api.aisonar.dev/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2-0-260128",
    "content": [
      {"type": "text", "text": "A cinematic forest at sunset"},
      {"type": "image_url", "role": "reference_image", "image_url": {"url": "https://example.com/ref.png"}}
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p",
    "generate_audio": true
  }'
```

For a single existing material used as the first frame, you may keep `content[]` text-only and add:

```json theme={null}
{
  "material_asset_id": "asset-20260720123456-qn7wr"
}
```

For multiple materials, put each one in `content[]` and declare its role:

```json theme={null}
[
  {
    "type": "image_url",
    "role": "first_frame",
    "image_url": {"url": "asset://asset-20260720123458-start"}
  },
  {
    "type": "image_url",
    "role": "last_frame",
    "image_url": {"url": "asset://asset-20260720123459-end01"}
  }
]
```

### Action Create

```bash theme={null}
curl "https://api.aisonar.dev/api/v3?Action=CreateContentsGenerationsTasks&Version=2024-01-01" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2-0-260128",
    "content": [{"type": "text", "text": "A clean product reveal video"}],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
  }'
```

## Next Step

Use the returned `cgt-...` ID with [Get Task (Volc Compatible)](/api-reference/video/get-volc-compatible-seedance-task) until the task reaches a terminal status.
