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

# Create Video Task

> Creates an asynchronous video generation task using Seedance 2.0 or Seedance 2.0 Fast.



## OpenAPI

````yaml POST /v1/video/seedance-2
openapi: 3.1.0
info:
  title: Loova API
  description: Loova API lets developers generate AI images and videos programmatically.
  version: 1.0.0
servers:
  - url: https://api.loova.ai/api
security:
  - bearerAuth: []
paths:
  /v1/video/seedance-2:
    post:
      summary: Create Video Task
      description: >-
        Creates an asynchronous video generation task using Seedance 2.0 or
        Seedance 2.0 Fast.
      operationId: createSeedance2VideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSeedanceTaskRequest'
            example:
              model: seedance_2_0
              prompt: A futuristic city at sunset
              function_mode: omni_reference
              ratio: '16:9'
              duration: 5
              image_urls: []
              audio_urls: []
              video_urls: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSeedanceTaskResponse'
              example:
                code: 200
                trace_id: 45c30d76f06549b199a3775544523689
                message: null
                data:
                  task_id: record_id
                  status: running
                  created_at: '2024-01-01T12:00:00Z'
                  credits_cost: 12
        '400':
          description: Request failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 400
                trace_id: 45c30d76f06549b199a3775544515689
                message: Detailed error message
                data: null
        '409':
          description: Business-level rejection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                insufficientCredits:
                  summary: Insufficient API credits
                  value:
                    code: 300111
                    trace_id: 45c30d76f06549b199a3775544515689
                    message: Insufficient API credits
                    data: null
                concurrencyLimit:
                  summary: Concurrent task limit reached
                  value:
                    code: 300111
                    trace_id: 45c30d76f06549b199a3775544515689
                    message: Parallel task limit reached.
                    data: null
      security:
        - bearerAuth: []
components:
  schemas:
    CreateSeedanceTaskRequest:
      type: object
      required:
        - prompt
      properties:
        model:
          type: string
          default: seedance_2_0
          enum:
            - seedance_2_0
            - seedance_2_0_fast
        prompt:
          type: string
        function_mode:
          type: string
          default: omni_reference
          enum:
            - first_last_frames
            - omni_reference
        ratio:
          type: string
          default: '16:9'
          enum:
            - '21:9'
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
        duration:
          type: integer
          default: 5
          minimum: 4
          maximum: 15
        image_urls:
          type: array
          items:
            type: string
            format: uri
          default: []
          maxItems: 9
        audio_urls:
          type: array
          items:
            type: string
            format: uri
          default: []
          maxItems: 3
        video_urls:
          type: array
          items:
            type: string
            format: uri
          default: []
          maxItems: 3
      description: >-
        Validation rules:

        - `prompt` is required

        - `model`, `ratio`, and `function_mode` must use supported values

        - `duration` must be between 4 and 15 seconds

        - When `function_mode = first_last_frames`, a maximum of 2 images is
        allowed

        - When `function_mode = omni_reference`, audio-only input is not
        allowed; at least one image or video must be included if audio is
        provided
    CreateSeedanceTaskResponse:
      type: object
      properties:
        code:
          type: integer
        trace_id:
          type: string
        message:
          type:
            - string
            - 'null'
        data:
          type: object
          properties:
            task_id:
              type: string
            status:
              type: string
            created_at:
              type: string
              format: date-time
            credits_cost:
              type: number
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
        trace_id:
          type: string
        message:
          type:
            - string
            - 'null'
        data:
          type:
            - object
            - 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````