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

# /api/v3/contents/generations/tasks

> Submit a prompt and reference media to generate a video asynchronously. A successful call only returns the task ID; poll the query endpoint for the result.

Authenticate with `Authorization: Bearer <API_KEY>`. Tasks run asynchronously: a successful call only returns the task ID. Call [Get video generation task](https://docs-vip.apigo.ai/en/api-reference/endpoints/seedance/get-task.md) for the result.

## Models

| Model ID | Description |
| - | - |
| `dreamina-seedance-2-0-260128` | Seedance 2.0 |

Available durations, resolutions, aspect ratios and pricing depend on what is enabled for your account.

## content items

| Type | Format |
| - | - |
| Text | `{"type":"text","text":"prompt"}` |
| Image | `{"type":"image_url","role":"reference_image","image_url":{"url":"asset://<asset ID>"}}` |
| Audio | `{"type":"audio_url","role":"reference_audio","audio_url":{"url":"asset://<asset ID>"}}` |
| Video | `{"type":"video_url","role":"reference_video","video_url":{"url":"asset://<asset ID>"}}` |

* `url` can be an asset in the asset library with `Status=Active` (`asset://<asset ID>`), or a publicly reachable HTTP(S) URL. See [Asset library](https://docs-vip.apigo.ai/en/api-reference/endpoints/seedance/asset-overview.md) for importing assets.
* In the prompt, refer to reference media as "image 1", "audio 1", "video 1" by their order within each type in `content`.
* Audio cannot be the only reference media; combine it with an image or video.
* `audio_url` is an input reference, while `generate_audio` controls whether the output video has sound. They are independent. Set `generate_audio` to `true` when using a reference audio or the original sound of a reference video.

## Asset reference errors

When a referenced asset cannot be used, HTTP 400 is returned with `error.code` set to `InvalidParameter`:

| message | Action |
| - | - |
| `Asset '<ID>' does not exist.` | Check that the asset ID is correct and has not been deleted |
| `Asset '<ID>' is still processing. Use it after its status becomes Active.` | Wait until [GetAsset](https://docs-vip.apigo.ai/en/api-reference/endpoints/seedance/get-asset.md) returns `Active`, then resubmit |
| `Asset '<ID>' failed processing and cannot be used.` | Processing failed. Fix the source file and import it again |
| `The referenced assets cannot be used together in one request.` | The referenced assets cannot be combined in one request. Create a new asset group, re-import all assets needed for this request into it, and reference them once all are `Active` |

## Error codes

| HTTP status | error.type | error.code | Description |
| - | - | - | - |
| 400 | `BadRequest` | `InvalidParameter` | Invalid JSON, missing fields, wrong types, or unusable asset references |
| 400 | `BadRequest` | `InvalidParameter.UnsupportedImageFormat`, `InputImageSensitiveContentDetected`, etc. | Media format, parameter or content moderation check failed. `param` may be empty; also read `message` |
| 401 | `Unauthorized` | `AuthenticationError` | Missing or invalid API key |
| 403 | `Forbidden` | `AccountOverdueError` | Insufficient balance |
| 403 | `Forbidden` | `AccessDenied` | Blocked by IP allowlist or model permission |
| 404 | `NotFound` | `InvalidEndpointOrModel.NotFound` | Model does not exist or is unavailable |
| 429 | `TooManyRequests` | `AccountRateLimitExceeded` | Too many requests |
| 429 | `TooManyRequests` | `QuotaExceeded` | API key quota reached |
| 500 | `InternalServerError` | `InternalServiceError` | Internal or upstream error |

> [!NOTE]
>
> If a create request times out or the connection drops, the task may already have been created. Retrying blindly can create duplicate tasks.


## OpenAPI

````yaml en/api-reference/openapi.json POST /api/v3/contents/generations/tasks
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-vip.apigo.ai
security:
  - bearerAuth: []
paths:
  /api/v3/contents/generations/tasks:
    post:
      summary: Create a Seedance video generation task
      description: >-
        Submit a prompt and reference media to generate a video asynchronously.
        A successful call only returns the task ID; poll the query endpoint for
        the result.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SeedanceCreateTaskRequest'
            example:
              model: dreamina-seedance-2-0-260128
              content:
                - type: text
                  text: >-
                    Make the apple in image 1 move slightly while keeping the
                    subject and composition.
                - type: image_url
                  role: reference_image
                  image_url:
                    url: asset://asset-20261020080000-abcde
              duration: 5
              resolution: 720p
              ratio: '16:9'
              generate_audio: false
              watermark: false
      responses:
        '200':
          description: Task created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceCreateTaskResponse'
              example:
                id: task_20261020080000abcdef
        '400':
          description: Invalid parameters or asset reference
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceErrorResponse'
              example:
                error:
                  code: InvalidParameter
                  message: >-
                    Asset 'asset-20261020080000-abcde' is still processing. Use
                    it after its status becomes Active.
                  param: ''
                  type: BadRequest
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceErrorResponse'
              example:
                error:
                  code: AuthenticationError
                  message: The API key is missing or invalid.
                  param: ''
                  type: Unauthorized
        '403':
          description: Insufficient balance, or blocked by IP allowlist or model permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceErrorResponse'
              example:
                error:
                  code: AccountOverdueError
                  message: Your account balance is insufficient.
                  param: ''
                  type: Forbidden
        '404':
          description: Model does not exist or is unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceErrorResponse'
              example:
                error:
                  code: InvalidEndpointOrModel.NotFound
                  message: >-
                    The model or endpoint does not exist or you do not have
                    access to it.
                  param: ''
                  type: NotFound
        '429':
          description: Too many requests or API key quota reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceErrorResponse'
              example:
                error:
                  code: AccountRateLimitExceeded
                  message: Too many requests, please retry later.
                  param: ''
                  type: TooManyRequests
components:
  schemas:
    SeedanceCreateTaskRequest:
      type: object
      required:
        - model
        - content
      properties:
        model:
          type: string
          description: Model ID.
          example: dreamina-seedance-2-0-260128
        content:
          type: array
          description: >-
            Array of prompt text and reference media. In the prompt, refer to
            media as "image 1", "audio 1", "video 1" by their order within each
            type.
          items:
            $ref: '#/components/schemas/SeedanceContentItem'
        duration:
          type: integer
          description: Video length in seconds.
          example: 5
        resolution:
          type: string
          description: Output resolution, for example `720p`.
          example: 720p
        ratio:
          type: string
          description: Aspect ratio, for example `16:9` or `1:1`.
          example: '16:9'
        generate_audio:
          type: boolean
          description: >-
            Whether to generate sound. Set to `true` when using a reference
            audio or the original sound of a reference video.
        watermark:
          type: boolean
          description: Whether to add a watermark.
        priority:
          type: integer
          description: Task priority. Echoed back in the query result when provided.
        safety_identifier:
          type: string
          description: >-
            End-user identifier. Use an irreversible hash. Echoed back in the
            query result when provided.
    SeedanceCreateTaskResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: Task ID.
    SeedanceErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          description: Error object.
          properties:
            code:
              type: string
              description: Error code, for example `InvalidParameter`.
            message:
              type: string
              description: Error message.
            param:
              type: string
              description: Name of the offending parameter. May be empty.
            type:
              type: string
              description: Error type, for example `BadRequest`.
    SeedanceContentItem:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - text
            - image_url
            - audio_url
            - video_url
          description: Content type.
        text:
          type: string
          description: Prompt text. Required when `type=text`.
        role:
          type: string
          enum:
            - reference_image
            - reference_audio
            - reference_video
          description: >-
            Reference media role matching `type`: `reference_image` /
            `reference_audio` / `reference_video`.
        image_url:
          type: object
          description: Reference image. Required when `type=image_url`.
          required:
            - url
          properties:
            url:
              type: string
              description: >-
                `asset://<asset ID>` (the asset must be `Active`), or a publicly
                reachable HTTP(S) URL.
        audio_url:
          type: object
          description: >-
            Reference audio. Required when `type=audio_url`. Audio cannot be the
            only reference media; combine it with an image or video.
          required:
            - url
          properties:
            url:
              type: string
              description: >-
                `asset://<asset ID>` (the asset must be `Active`), or a publicly
                reachable HTTP(S) URL.
        video_url:
          type: object
          description: Reference video. Required when `type=video_url`.
          required:
            - url
          properties:
            url:
              type: string
              description: >-
                `asset://<asset ID>` (the asset must be `Active`), or a publicly
                reachable HTTP(S) URL.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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