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

# Wan Text to Video

> Applies to Wan series text-to-video models. The platform currently supports Ali `wan2.7-t2v`. After submitting a task, query its status via `GET /v1/videos/{task_id}`.

Public fields: `model`, `prompt`, `seconds`, `size`, `prompt_extend`, `watermark`, `seed`, `negative_prompt`.



## OpenAPI

````yaml api-reference/en/zmodelVideo/ali/text-to-video.json POST /v1/videos
openapi: 3.0.1
info:
  title: Wan text-to-video
  version: 1.0.0
  description: >-
    Wan series text-to-video capability documentation. The unified API endpoint
    is `/v1/videos`, used to create asynchronous video generation tasks.
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://api.powertokens.ai
    description: Baze API server endpoint
security: []
tags:
  - name: Wan Video
    description: Wan text-to-video capability
paths:
  /v1/videos:
    post:
      tags:
        - Wan Video
      summary: Wan text-to-video
      description: >-
        Applies to Wan series text-to-video models. The platform currently
        supports Ali `wan2.7-t2v`. After submitting a task, query its status via
        `GET /v1/videos/{task_id}`.


        Public fields: `model`, `prompt`, `seconds`, `size`, `prompt_extend`,
        `watermark`, `seed`, `negative_prompt`.
      operationId: aliTextToVideo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToVideoRequest'
            examples:
              text_to_video:
                summary: Basic text-to-video request
                value:
                  model: wan2.7-t2v
                  prompt: >-
                    Realistic style, a black kitten curiously looks up at the
                    sky, the camera gradually rises from eye level.
                  seconds: '5'
                  size: 1080P
      responses:
        '200':
          description: Submitted successfully. Returns a video task object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: Parameter error
                  value:
                    error:
                      message: Malformed request body or invalid field value
                      type: invalid_request_error
                      code: bad_request_body
                      param: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: Unauthorized
                  value:
                    error:
                      message: Invalid token
                      type: api_error
                      code: access_denied
                      param: ''
          description: Authentication failed, e.g. missing or invalid token.
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                request_too_large:
                  summary: Request body too large
                  value:
                    error:
                      message: >-
                        Request body too large, please reduce the input and
                        retry
                      type: api_error
                      code: read_request_body_failed
                      param: ''
          description: Request body too large.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quota_exceeded:
                  summary: Insufficient quota or rate limited
                  value:
                    error:
                      message: Insufficient account quota, please try again later
                      type: api_error
                      code: insufficient_user_quota
                      param: ''
          description: Rate limit triggered or insufficient account quota.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: Internal processing failure
                  value:
                    error:
                      message: Internal processing failed, please try again later
                      type: api_error
                      code: gen_relay_info_failed
                      param: ''
          description: An internal error occurred while processing the request.
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                bad_gateway:
                  summary: Upstream provider response error
                  value:
                    error:
                      message: The upstream provider returned an invalid response
                      type: api_error
                      code: bad_response_status_code
                      param: ''
          description: The upstream provider returned an abnormal response.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                service_unavailable:
                  summary: Service temporarily unavailable
                  value:
                    error:
                      message: >-
                        No available channel for the current model, please try
                        again later
                      type: api_error
                      code: get_channel_failed
                      param: ''
          description: >-
            The upstream provider is temporarily unavailable, or no channel is
            currently available for this model.
      security:
        - BearerAuth: []
components:
  schemas:
    TextToVideoRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          enum:
            - wan2.7-t2v
          description: 'Model name. Available value: `wan2.7-t2v`.'
        prompt:
          type: string
          description: >-
            Text prompt describing the desired video content and visual
            characteristics. Supports Chinese and English; each character or
            letter counts as one. Excess characters are automatically truncated.


            - `wan2.7-t2v`: up to 5000 characters.
        seconds:
          type: string
          description: >-
            Important: `seconds` directly affects cost. Confirm the model
            pricing before calling.


            Video duration in seconds.

            - `wan2.7-t2v`: range [2, 15]. Default: 5.
          default: '5'
          enum:
            - '2'
            - '3'
            - '4'
            - '5'
            - '6'
            - '7'
            - '8'
            - '9'
            - '10'
            - '11'
            - '12'
            - '13'
            - '14'
            - '15'
        size:
          type: string
          enum:
            - 720P
            - 1080P
          description: >-
            Important: `size` directly affects cost. Confirm the model pricing
            before calling.


            Output video resolution tier, controlling video clarity (total
            pixels).


            `wan2.7-t2v`: available values `720P`, `1080P`. Default: `1080P`.
          default: 1080P
        prompt_extend:
          type: boolean
          description: >-
            Whether to enable intelligent prompt rewriting. When enabled, a
            large language model rewrites the input prompt intelligently,
            significantly improving results for short prompts but increasing
            processing time.

            - `true` (default): enable intelligent rewriting.

            - `false`: disable intelligent rewriting.
          default: false
        watermark:
          type: boolean
          description: >-
            Whether to add a watermark to the video. The watermark is positioned
            at the bottom-right corner with the text 'AI生成'.

            - `false` (default): no watermark.

            - `true`: add watermark.
          default: false
        seed:
          type: integer
          description: >-
            Random seed, range [0, 2147483647]. If not specified, the system
            automatically generates a random seed. To improve reproducibility of
            generation results, it is recommended to fix the seed value.


            Note: Due to the probabilistic nature of model generation, the same
            seed does not guarantee identical results every time.
        negative_prompt:
          type: string
          description: >-
            Negative prompt describing content you do not want to see in the
            video. Limits unwanted visual elements. Supports Chinese and
            English, up to 500 characters.


            Example: low resolution, error, worst quality, low quality,
            deformed, extra fingers, bad proportions, etc.
    VideoTaskResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique task identifier.
        task_id:
          type: string
          description: Task ID (same as id).
        object:
          type: string
          example: video
        model:
          type: string
          description: Model name used.
        status:
          type: string
          enum:
            - pending
            - queued
            - running
            - succeeded
            - failed
            - cancelled
          description: Task status.
        progress:
          type: integer
          description: Task progress (percentage).
        created_at:
          type: integer
          format: int64
          description: Creation time as a Unix timestamp (seconds).
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              description: >-
                Error type, e.g. `invalid_request_error`, `api_error`, or
                upstream-compatible error types.
            code:
              type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````