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

# Generate Video

> Interface description: Submit a video generation task, and you can pass in reference pictures, videos, and audios. The task is executed asynchronously and taskId is returned for polling results.

Before calling this interface, please request the ["Video Generation Model"](/en/api-reference/get-api-ai-models-video-generation) interface (`GET /api/ai/models/video/generation`) to obtain the currently available model list and the parameter restrictions of each model (resolution, duration, aspect ratio, reference media constraints and price), and then fill in the parameters of this interface accordingly.



## OpenAPI

````yaml /openapi/en/aitoearn.openapi.json post /api/ai/video/generations
openapi: 3.0.1
info:
  title: AiToEarn Open Platform API
  description: >-
    AiToEarn Open Platform API. You can switch between the China and
    international sites for testing. Business success is determined by whether
    the response body has code === 0.
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: China site
  - url: https://aitoearn.ai
    description: International site
security: []
tags:
  - name: AI Services
  - name: AI Services/Video Generation
  - name: AI Services/Image Generation
  - name: Channel Management
  - name: Channel Management/Accounts
  - name: Channel Management/Publishing
  - name: Channel Management/Platforms
  - name: Channel Management/Works
  - name: Channel Management/Account Groups
  - name: Channel Management/Authorization
  - name: Asset Management
  - name: AI Services/Large Language Models
paths:
  /api/ai/video/generations:
    post:
      tags:
        - AI Services/Video Generation
      summary: Generate Video
      description: >-
        Interface description: Submit a video generation task, and you can pass
        in reference pictures, videos, and audios. The task is executed
        asynchronously and taskId is returned for polling results.


        Before calling this interface, please request the ["Video Generation
        Model"](/en/api-reference/get-api-ai-models-video-generation) interface
        (`GET /api/ai/models/video/generation`) to obtain the currently
        available model list and the parameter restrictions of each model
        (resolution, duration, aspect ratio, reference media constraints and
        price), and then fill in the parameters of this interface accordingly.
      operationId: VideoController_videoGeneration
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: >-
                    Video generation model name. First call the ["Video
                    Generation
                    Model"](/en/api-reference/get-api-ai-models-video-generation)
                    interface (`GET /api/ai/models/video/generation`) and pass
                    in the `data[n].name` returned by it; the resolution,
                    duration, aspect ratio and price supported by each model are
                    subject to the return of this interface.
                  minLength: 1
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 4000
                  description: Prompt word, length 1-4000 characters
                images:
                  description: >-
                    Reference image URL list. The maximum number and format
                    limits vary from model to model, and are subject to the
                    `data[n].maxInputImages` and `data[n].inputConstraints`
                    returned by the ["Video Generation
                    Model"](/en/api-reference/get-api-ai-models-video-generation)
                    interface.
                  type: array
                  items:
                    type: string
                videos:
                  description: >-
                    Reference video URL list. Whether video input is supported,
                    as well as the quantity, format, duration, and size limits
                    vary from model to model, and are subject to the
                    `data[n].modes` and `data[n].inputConstraints` returned by
                    the ["Video Generation
                    Model"](/en/api-reference/get-api-ai-models-video-generation)
                    interface.
                  type: array
                  items:
                    type: string
                audios:
                  description: >-
                    Reference audio URL list. Whether audio input is supported,
                    as well as the quantity, format, duration, and size limits
                    vary from model to model, and are subject to the
                    `data[n].modes` and `data[n].inputConstraints` returned by
                    the ["Video Generation
                    Model"](/en/api-reference/get-api-ai-models-video-generation)
                    interface.
                  type: array
                  items:
                    type: string
                resolution:
                  type: string
                  description: >-
                    Video resolution. The optional values ​​vary from model to
                    model, and are subject to the `data[n].resolutions` returned
                    by the ["Video Generation
                    Model"](/en/api-reference/get-api-ai-models-video-generation)
                    interface.
                  enum:
                    - 480p
                    - 720p
                    - 1080p
                ratio:
                  description: >-
                    Video aspect ratio. The optional values ​​vary from model to
                    model, and are subject to the `data[n].aspectRatios`
                    returned by the ["Video Generation
                    Model"](/en/api-reference/get-api-ai-models-video-generation)
                    interface.
                  type: string
                duration:
                  description: >-
                    Video duration (seconds). The optional range varies with the
                    model, and is subject to the `data[n].durations` returned by
                    the ["Video Generation
                    Model"](/en/api-reference/get-api-ai-models-video-generation)
                    interface.
                  type: number
              required:
                - model
                - prompt
            examples:
              '1':
                value:
                  model: seedance-2-beta-1080p
                  prompt: >-
                    Generate a travel vlog style video, the picture is used as
                    the subject reference, the video is used as the movement
                    reference, the audio is used as the rhythm reference, the
                    picture is natural and real
                  images:
                    - https://example.com/input/character.png
                  videos:
                    - https://example.com/input/motion-reference.mp4
                  audios:
                    - https://example.com/input/music-reference.mp3
                  resolution: 1080p
                  ratio: '9:16'
                  duration: 12
                summary: Generate video from multiple references
              '2':
                value:
                  model: seedance-2-fast-beta
                  prompt: >-
                    A smart desk lamp lights up slowly in a modern studio, the
                    lens advances smoothly, the picture is clean and high-end,
                    and the product reflects light naturally
                  resolution: 480p
                  ratio: '16:9'
                  duration: 6
                summary: Text generation video
        required: true
      responses:
        '200':
          description: >-
            The request has been processed by the service. Business success is
            determined by whether the response body has code === 0.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/VideoGenerationResponseVo'
                  code:
                    type: integer
                    description: >-
                      Business status code. 0 means success; non-zero means a
                      business error.
                  message:
                    type: string
                    description: Response message.
                  requestId:
                    type: string
                    description: Request ID.
                  timestamp:
                    type: integer
                    description: Error response timestamp in Unix milliseconds.
                required:
                  - code
                  - message
              examples:
                success:
                  summary: Success
                  value:
                    code: 0
                    message: Request succeeded
                    data:
                      id: string
                      status: string
                validationFailed10002:
                  summary: ValidationFailed (10002)
                  value:
                    code: 10002
                    message: Parameter validation failed
                    data: {}
                    timestamp: 1772099056662
                unauthorized401:
                  summary: Unauthenticated or invalid API Key
                  value:
                    code: 401
                    message: Unauthorized
                    data: {}
                    timestamp: 1772099056662
                aiVideoGenerationUnsupportedMode12310:
                  summary: AiVideoGenerationUnsupportedMode (12310)
                  value:
                    code: 12310
                    message: Unsupported video generation mode
                    data: {}
                    timestamp: 1772099056662
                invalidModel12300:
                  summary: InvalidModel (12300)
                  value:
                    code: 12300
                    message: Invalid AI model
                    data: {}
                    timestamp: 1772099056662
                materialGroupNotFound12801:
                  summary: MaterialGroupNotFound (12801)
                  value:
                    code: 12801
                    message: Material group not found
                    data: {}
                    timestamp: 1772099056662
      deprecated: false
      security:
        - apikey-header-X-Api-Key: []
components:
  schemas:
    VideoGenerationResponseVo:
      type: object
      properties:
        id:
          description: Task ID
          type: string
        status:
          type: string
          description: Task status
      required:
        - id
        - status
      additionalProperties: false
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Need to get API Key from AiToEarn. Click to go to ["API Key Obtaining
        Tutorial"](/en/use/api-key).

````