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

# Create Video Generation

> Create a BytePlus Seedance video generation task.

Returns immediately with ``{"id": "<task_id>"}``.
Poll ``GET /v1/video/generations/{id}`` until status is
``succeeded``, ``failed``, or ``expired``.

Pass ``callback_url`` to receive a POST notification when the task
status changes. We intercept the BytePlus callback, update our DB,
then forward the full task payload to your URL.



## OpenAPI

````yaml /api/openapi.json post /v1/video/generations
openapi: 3.1.0
info:
  title: MeshAPI
  description: One key, all AI models.
  version: 0.1.0
servers:
  - url: https://api.meshapi.ai
security:
  - BearerAuth: []
paths:
  /v1/video/generations:
    post:
      tags:
        - Video
      summary: Create Video Generation
      description: |-
        Create a BytePlus Seedance video generation task.

        Returns immediately with ``{"id": "<task_id>"}``.
        Poll ``GET /v1/video/generations/{id}`` until status is
        ``succeeded``, ``failed``, or ``expired``.

        Pass ``callback_url`` to receive a POST notification when the task
        status changes. We intercept the BytePlus callback, update our DB,
        then forward the full task payload to your URL.
      operationId: create_video_generation
      parameters:
        - in: header
          name: X-Mesh-Version
          required: false
          schema:
            type: string
            enum:
              - 2026-08
            default: 2026-08
          example: 2026-08
          description: >-
            Dated version of the API contract to pin this request to. Omit it
            and the request is served under `2026-08` — the oldest supported
            version, so an existing integration is never moved by a release. A
            malformed or unsupported value is rejected with `400
            invalid_api_version` rather than falling back silently. The version
            actually served is echoed as `X-Mesh-Version` on every response,
            including errors.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
            examples:
              default:
                summary: Example request
                value:
                  model: byteplus/dreamina-seedance-2-0
                  content:
                    - type: text
                      text: A paper boat drifting across a calm pond at sunrise.
                  duration: 5
                  ratio: '16:9'
                  generate_audio: true
                  watermark: false
      responses:
        '200':
          description: Task created; poll the returned id for status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              examples:
                default:
                  summary: Example response
                  value:
                    id: vid_01JZ0S8R7G5A4N3C2V1B0M9K8J
        '401':
          description: Missing or invalid API key
        '402':
          description: Insufficient balance or spend cap reached
        '422':
          description: Model not found or not a BytePlus video model
        '429':
          description: Rate limit exceeded
        '502':
          description: BytePlus upstream error
      security:
        - BearerAuth: []
components:
  schemas:
    VideoGenerationRequest:
      properties:
        model:
          type: string
          title: Model
        content:
          items:
            $ref: '#/components/schemas/VideoContentItem'
          type: array
          title: Content
        previous_task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Task Id
        callback_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Callback Url
        return_last_frame:
          type: boolean
          title: Return Last Frame
          default: false
        service_tier:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Tier
        execution_expires_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Execution Expires After
        generate_audio:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Generate Audio
        draft:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Draft
        resolution:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution
        ratio:
          anyOf:
            - type: string
            - type: 'null'
          title: Ratio
        duration:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration
        fast_pretreatment:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Fast Pretreatment
        frames:
          anyOf:
            - type: integer
            - type: 'null'
          title: Frames
        seed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seed
        camera_fixed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Camera Fixed
        watermark:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Watermark
        safety_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Safety Identifier
        priority:
          anyOf:
            - type: integer
              maximum: 9
              minimum: 0
            - type: 'null'
          title: Priority
      type: object
      required:
        - model
        - content
      title: VideoGenerationRequest
      example:
        callback_url: https://webhook.site/your-id
        content:
          - text: >-
              A girl holding a fox, the girl opens her eyes and gently looks at
              the camera.
            type: text
          - image_url:
              url: https://example.com/reference.png
            type: image_url
        duration: 5
        generate_audio: true
        model: byteplus/dreamina-seedance-2-0
        ratio: adaptive
        watermark: false
    VideoTaskResponse:
      properties:
        id:
          type: string
          title: Id
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        status:
          type: string
          title: Status
          default: queued
        error:
          anyOf:
            - $ref: '#/components/schemas/VideoTaskError'
            - type: 'null'
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated At
        content:
          anyOf:
            - $ref: '#/components/schemas/VideoTaskContent'
            - type: 'null'
        seed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seed
        resolution:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution
        ratio:
          anyOf:
            - type: string
            - type: 'null'
          title: Ratio
        duration:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration
        frames:
          anyOf:
            - type: integer
            - type: 'null'
          title: Frames
        framespersecond:
          anyOf:
            - type: integer
            - type: 'null'
          title: Framespersecond
        generate_audio:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Generate Audio
        safety_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Safety Identifier
        priority:
          anyOf:
            - type: integer
            - type: 'null'
          title: Priority
        draft:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Draft
        draft_task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Draft Task Id
        service_tier:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Tier
        execution_expires_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Execution Expires After
        usage:
          anyOf:
            - $ref: '#/components/schemas/VideoTaskUsage'
            - type: 'null'
      type: object
      required:
        - id
      title: VideoTaskResponse
    VideoContentItem:
      properties:
        type:
          type: string
          title: Type
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        image_url:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Image Url
        video_url:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Video Url
        audio_url:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Audio Url
        draft_task:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Draft Task
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
      type: object
      required:
        - type
      title: VideoContentItem
      description: >-
        A single item in the content array (text, image_url, video_url,
        audio_url).
    VideoTaskError:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
        - code
        - message
      title: VideoTaskError
    VideoTaskContent:
      properties:
        video_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Video Url
        last_frame_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Frame Url
      type: object
      title: VideoTaskContent
    VideoTaskUsage:
      properties:
        completion_tokens:
          type: integer
          title: Completion Tokens
        total_tokens:
          type: integer
          title: Total Tokens
      type: object
      required:
        - completion_tokens
        - total_tokens
      title: VideoTaskUsage
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Enter your MeshAPI key (`rsk_...`) — sent as `Authorization: Bearer
        <key>`.

````