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

# Wan 2.2

> Wan 2.2 text-to-video and image-to-video generation. Pass `image_url` to use a reference image, or omit it for text-to-video.

**Pricing** — per task, in tokens (USD at $0.02/token):

| resolution | tokens | USD |
|---|---|---|
| 480p | 5 | $0.10 |
| 720p | 10 | $0.20 |

Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use `custom_callback_url`) to get the generated video.



## OpenAPI

````yaml api-reference/video-generations/openapi-wan-2-2.json POST /api/v1/videos/generations
openapi: 3.1.0
info:
  title: GoEnhance API - Wan 2.2
  description: >-
    Generate videos from text or a reference image with Wan 2.2 through the
    unified Video Generation API.
  version: 1.0.0
servers:
  - url: https://api.goenhance.ai
security: []
paths:
  /api/v1/videos/generations:
    post:
      tags:
        - VideoGenerations
      summary: Wan 2.2
      description: >-
        Wan 2.2 text-to-video and image-to-video generation. Pass `image_url` to
        use a reference image, or omit it for text-to-video.


        **Pricing** — per task, in tokens (USD at $0.02/token):


        | resolution | tokens | USD |

        |---|---|---|

        | 480p | 5 | $0.10 |

        | 720p | 10 | $0.20 |


        Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use
        `custom_callback_url`) to get the generated video.
      parameters:
        - name: Authorization
          in: header
          description: Bearer API key.
          required: true
          example: Bearer YOUR_API_KEY
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: >-
                Wan 2.2 supports text-to-video and first-frame image-to-video at
                480p or 720p.
              properties:
                model:
                  type: string
                  enum:
                    - wan22_spicy
                  description: Model name. Must be `wan22_spicy`.
                prompt:
                  type: string
                  description: Text prompt describing the video.
                image_url:
                  type: string
                  format: uri
                  description: >-
                    Optional first-frame image URL. If provided, runs
                    image-to-video; otherwise text-to-video.
                resolution:
                  type: string
                  enum:
                    - 480p
                    - 720p
                  default: 720p
                  description: >-
                    Output resolution. A 480p task costs 5 tokens; a 720p task
                    costs 10 tokens.
                custom_callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. A publicly accessible HTTPS URL. When the task
                    status changes (processing / success / failed), GoEnhance
                    sends a POST request to this URL. The request body is
                    identical to the response of GET /api/v1/jobs/detail. If
                    your server does not respond with HTTP 200, the notification
                    is retried up to 3 times, with a 3-second timeout per
                    attempt.
                  example: https://your-server.com/goenhance/callback
              required:
                - model
                - prompt
            example:
              model: wan22_spicy
              prompt: >-
                A paper boat floats down a rain-soaked city street, cinematic
                lighting
              image_url: https://your-cdn.com/paper-boat.jpg
              resolution: 720p
      responses:
        '200':
          description: Task submitted or application-level error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      img_uuid:
                        type: string
                required:
                  - code
                  - msg
              examples:
                success:
                  summary: Success
                  value:
                    code: 0
                    msg: Success
                    data:
                      img_uuid: c12b656c-747a-44fd-9c80-add79b0c52d5
                insufficientTokens:
                  summary: Insufficient tokens
                  value:
                    code: 100
                    msg: tokens is not enough
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                required:
                  - code
                  - msg
              example:
                code: 401
                msg: Unauthorized
      deprecated: false

````