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

# Create video task

> Submits a text-to-video task and returns its ID at once; poll the task until it finishes. Billed by output tokens generated (USD 25 per million list price): width x height x (24 x seconds + 1) / 1024. The cost of the largest frame at the requested resolution and duration, plus 10 percent, is held at submit; a succeeded task settles the tokens actually generated, and failed, expired or cancelled tasks are not charged. Only the documented fields are accepted.



## OpenAPI

````yaml /openapi.json post /api/v3/contents/generations/tasks
openapi: 3.1.0
info:
  title: OmniRelay API
  version: 1.0.0
  description: >-
    OpenAI-compatible gateway for reviewed real text models. Access is
    workspace-specific; query your own model list for capabilities and customer
    prices.
servers:
  - url: https://api.omnirelay.ai
security:
  - bearerAuth: []
tags:
  - name: Service
  - name: Models
  - name: Chat
  - name: Management
  - name: Responses
  - name: Embeddings
  - name: Images
  - name: Videos
paths:
  /api/v3/contents/generations/tasks:
    post:
      tags:
        - Videos
      summary: Create video task
      description: >-
        Submits a text-to-video task and returns its ID at once; poll the task
        until it finishes. Billed by output tokens generated (USD 25 per million
        list price): width x height x (24 x seconds + 1) / 1024. The cost of the
        largest frame at the requested resolution and duration, plus 10 percent,
        is held at submit; a succeeded task settles the tokens actually
        generated, and failed, expired or cancelled tasks are not charged. Only
        the documented fields are accepted.
      operationId: createVideoTask
      parameters:
        - name: X-Gateway-Tags
          in: header
          required: false
          description: >-
            Tags for this call as comma-separated `key=value` pairs, for example
            `client=acme,env=prod`. Merged with the API key's default tags; the
            `tags` body field wins on the same key. `X-OmniRelay-Tags` is the
            same header under its former name and stays accepted.
          schema:
            type: string
          example: client=acme,env=prod
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoTaskRequest'
            example:
              model: doubao-seedance-2-0-260128
              content:
                - type: text
                  text: >-
                    A paper boat drifting on a calm pond at sunrise, slow camera
                    pan
              resolution: 480p
              ratio: '16:9'
              duration: 5
      responses:
        '200':
          description: Task accepted and its hold dispatched.
          headers:
            X-Request-ID:
              description: OmniRelay task ID; the same value as the id in the body.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskCreated'
              example:
                id: 3f0c9a2e-6b1d-4c35-9a7e-2d8c5b1e4f60
        '400':
          description: >-
            invalid_parameter: an unknown field, more than one content item, a
            non-text item, or a value outside the documented range; error.param
            names the field. Nothing is sent or charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: invalid_parameter
                request_id: 2f6c1d0e9a
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: >-
            inference_budget_or_access_denied or member_budget_exceeded: the
            hold cannot be covered. Rejected before dispatch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: inference_budget_or_access_denied
                request_id: 2f6c1d0e9a
        '403':
          description: 'model_not_allowed: the API key is limited to other models.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: model_not_allowed
                request_id: 2f6c1d0e9a
        '404':
          description: 'model_unavailable: not a video model this workspace can call.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: model_unavailable
                request_id: 2f6c1d0e9a
        '413':
          description: 'payload_too_large: the body is larger than 64 KiB.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: payload_too_large
                request_id: 2f6c1d0e9a
        '429':
          description: >-
            Rate or concurrency limit. Nothing is charged; retry after
            Retry-After seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: rate_limited
                request_id: 2f6c1d0e9a
        '502':
          description: >-
            video_submit_held: the task could not be confirmed after it was
            sent. Held for review and charged only if the video was generated.
            upstream_rejected: the provider refused the task; nothing is
            charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: video_submit_held
                request_id: 2f6c1d0e9a
        '503':
          description: >-
            Live video generation is not available for this workspace right now.
            Nothing is sent or charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: live_provider_unavailable
                request_id: 2f6c1d0e9a
        '504':
          description: >-
            video_submit_held: the submit timed out. Held for review and charged
            only if the video was generated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: video_submit_held
                request_id: 2f6c1d0e9a
components:
  schemas:
    VideoTaskRequest:
      type: object
      required:
        - model
        - content
      additionalProperties: false
      properties:
        model:
          type: string
          description: A video model ID from GET /v1/models (type video).
          example: doubao-seedance-2-0-260128
        content:
          type: array
          minItems: 1
          maxItems: 1
          description: Exactly one text item, 1 to 4000 characters.
          items:
            type: object
            required:
              - type
              - text
            additionalProperties: false
            properties:
              type:
                type: string
                enum:
                  - text
              text:
                type: string
                maxLength: 4000
        resolution:
          type: string
          enum:
            - 480p
            - 720p
          default: 480p
        ratio:
          type: string
          enum:
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
            - '21:9'
            - adaptive
          default: '16:9'
        duration:
          type: integer
          minimum: 4
          maximum: 10
          default: 5
          description: Length in whole seconds.
        seed:
          type: integer
          minimum: -1
          maximum: 4294967295
        generate_audio:
          type: boolean
          description: The clip has a soundtrack unless this is false.
        watermark:
          type: boolean
        camera_fixed:
          type: boolean
    VideoTaskCreated:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: Task ID. Poll it with GET /api/v3/contents/generations/tasks/{id}.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - type
          properties:
            code:
              type: string
              example: model_unavailable
            message:
              type: string
              example: The model does not exist or is disabled.
              description: >-
                Short English description for logs and SDK exceptions. Its
                wording can change; branch on code.
            type:
              type: string
              example: not_found_error
              description: >-
                Error family by HTTP status: invalid_request_error,
                authentication_error, insufficient_quota, permission_error,
                not_found_error, conflict_error, rate_limit_error,
                service_unavailable or api_error.
            param:
              type: string
              maxLength: 200
              description: >-
                Rejected request field path when identifiable; never a parameter
                value. Responses uses native field names.
        request_id:
          type: string
          description: Present on chat completion, Responses and embeddings errors.
  responses:
    Unauthorized:
      description: '`unauthorized`: the API key is missing, revoked, or invalid.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key created in the OmniRelay console. The owner can view it again
        in the console after confirming their identity.

````

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