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

# Wan2.2 A14B

> Create and query Wan2.2 A14B text-to-video and image-to-video tasks.

Wan2.2 A14B uses one creation endpoint with two public AnyFast model IDs. Select the workflow that matches your input, then query the returned task ID.

<Tabs sync={false}>
  <Tab title="Text to video">
    ## Create task

    `POST /v1/video/generations`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/video/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "wan2.2-t2v-a14b",
          "prompt": "A paper lantern floats above a quiet riverside town at dusk. The camera follows from below.",
          "duration": 5,
          "width": 1280,
          "height": 720,
          "seed": 42
        }'
      ```
    </div>

    ## Request headers

    <ParamField header="Authorization" type="string" required>Bearer authentication in the form `Bearer YOUR_API_KEY`.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Request body format.</ParamField>

    ## Request body

    <ParamField body="model" type="string" required>Must be `wan2.2-t2v-a14b`.</ParamField>
    <ParamField body="prompt" type="string" required>Text description of the subject, action, setting, visual style, and camera movement.</ParamField>
    <ParamField body="duration" type="number" default={5}>Video duration from 3 through 5 seconds.</ParamField>
    <ParamField body="width" type="integer">Output width in pixels.</ParamField>
    <ParamField body="height" type="integer">Output height in pixels.</ParamField>
    <ParamField body="seed" type="integer">Optional random seed in `[0, 2147483647]` for more repeatable generation.</ParamField>
    <ParamField body="metadata" type="object">Optional extension fields passed to the upstream service.</ParamField>

    ## Create response

    <div className="kling-api-example-panel">
      ```json 200 theme={null}
      {
        "id": "asyntask_wan22t2vexample123",
        "task_id": "asyntask_wan22t2vexample123",
        "object": "video",
        "model": "wan2.2-t2v-a14b",
        "status": "",
        "progress": 0,
        "created_at": 1785426400
      }
      ```
    </div>

    <ResponseField name="id" type="string">Task ID used to query the result.</ResponseField>
    <ResponseField name="task_id" type="string">Task ID, identical to `id`.</ResponseField>
    <ResponseField name="object" type="string">Returned object type, `video`.</ResponseField>
    <ResponseField name="model" type="string">AnyFast model ID used by the task.</ResponseField>
    <ResponseField name="status" type="string">Initial status string. Use the query endpoint for the authoritative task state.</ResponseField>
    <ResponseField name="progress" type="integer">Initial task progress percentage.</ResponseField>
    <ResponseField name="created_at" type="integer">Creation time as a Unix timestamp in seconds.</ResponseField>
  </Tab>

  <Tab title="Image to video">
    ## Create task

    `POST /v1/video/generations`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/video/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "wan2.2-i2v-a14b",
          "prompt": "The cat runs forward through the grass while the camera tracks alongside it.",
          "image": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png",
          "duration": 5,
          "width": 1280,
          "height": 720,
          "seed": 42
        }'
      ```
    </div>

    ## Request headers

    <ParamField header="Authorization" type="string" required>Bearer authentication in the form `Bearer YOUR_API_KEY`.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Request body format.</ParamField>

    ## Request body

    <ParamField body="model" type="string" required>Must be `wan2.2-i2v-a14b`.</ParamField>
    <ParamField body="prompt" type="string" required>Text description of the motion and camera behavior.</ParamField>
    <ParamField body="image" type="string" required>Public first-frame image URL. Supported upstream formats include JPEG, JPG, PNG without alpha, BMP, and WebP; the Wan2.2 family limit is 10 MB with width and height from 240 through 8,000 pixels.</ParamField>
    <ParamField body="duration" type="number" default={5}>Video duration from 3 through 5 seconds.</ParamField>
    <ParamField body="width" type="integer">Output width in pixels.</ParamField>
    <ParamField body="height" type="integer">Output height in pixels.</ParamField>
    <ParamField body="seed" type="integer">Optional random seed in `[0, 2147483647]` for more repeatable generation.</ParamField>
    <ParamField body="metadata" type="object">Optional extension fields passed to the upstream service.</ParamField>

    ## Create response

    <div className="kling-api-example-panel">
      ```json 200 theme={null}
      {
        "id": "asyntask_wan22i2vexample123",
        "task_id": "asyntask_wan22i2vexample123",
        "object": "video",
        "model": "wan2.2-i2v-a14b",
        "status": "",
        "progress": 0,
        "created_at": 1785426400
      }
      ```
    </div>

    <ResponseField name="id" type="string">Task ID used to query the result.</ResponseField>
    <ResponseField name="task_id" type="string">Task ID, identical to `id`.</ResponseField>
    <ResponseField name="object" type="string">Returned object type, `video`.</ResponseField>
    <ResponseField name="model" type="string">AnyFast model ID used by the task.</ResponseField>
    <ResponseField name="status" type="string">Initial status string. Use the query endpoint for the authoritative task state.</ResponseField>
    <ResponseField name="progress" type="integer">Initial task progress percentage.</ResponseField>
    <ResponseField name="created_at" type="integer">Creation time as a Unix timestamp in seconds.</ResponseField>
  </Tab>

  <Tab title="Query task">
    ## Query task by ID

    `GET /v1/video/generations/{task_id}`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request GET \
        --url https://www.anyfast.ai/v1/video/generations/asyntask_wan22t2vexample123 \
        --header 'Authorization: Bearer YOUR_API_KEY'
      ```
    </div>

    ## Request headers

    <ParamField header="Authorization" type="string" required>Bearer authentication in the form `Bearer YOUR_API_KEY`.</ParamField>

    ## Path parameters

    <ParamField path="task_id" type="string" required>Task ID returned by a Wan2.2 create request.</ParamField>

    ## Task result

    <div className="kling-api-example-panel">
      ```json 200 theme={null}
      {
        "code": "success",
        "message": "",
        "data": {
          "task_id": "asyntask_wan22t2vexample123",
          "action": "textGenerate",
          "status": "SUCCESS",
          "fail_reason": "https://example.com/generated-video.mp4",
          "result_url": "https://example.com/generated-video.mp4",
          "submit_time": 1785426400,
          "start_time": 1785426414,
          "finish_time": 1785426560,
          "progress": "100%",
          "request_id": "request_wan22example123",
          "data": {
            "output": {
              "task_id": "upstream_task_wan22example123",
              "task_status": "SUCCEEDED",
              "video_url": "https://example.com/generated-video.mp4",
              "orig_prompt": "A paper lantern floats above a quiet riverside town at dusk.",
              "submit_time": "2026-07-30 23:46:53.873",
              "scheduled_time": "2026-07-30 23:46:53.900",
              "end_time": "2026-07-30 23:49:18.837"
            },
            "request_id": "upstream_request_wan22example123",
            "usage": {
              "SR": 720,
              "duration": 5,
              "input_video_duration": 0,
              "output_video_duration": 5,
              "ratio": "16:9",
              "video_count": 1
            }
          }
        }
      }
      ```
    </div>

    <ResponseField name="code" type="string">Query-call result. `success` means the query completed; use `data.status` for the generation outcome.</ResponseField>
    <ResponseField name="message" type="string">Response message, normally empty for a successful query.</ResponseField>
    <ResponseField name="data" type="object">AnyFast task state and result payload.</ResponseField>
    <ResponseField name="data.task_id" type="string">AnyFast task ID.</ResponseField>
    <ResponseField name="data.action" type="string">Generation workflow, such as `textGenerate` for text-to-video or `generate` for image-to-video.</ResponseField>
    <ResponseField name="data.status" type="string">`NOT_START`, `QUEUED`, or `IN_PROGRESS` means keep polling. On `SUCCESS`, read `result_url`; on `FAILURE`, read `fail_reason`.</ResponseField>
    <ResponseField name="data.fail_reason" type="string">Compatibility field. It can repeat `result_url` on success, so use `status` to determine the outcome.</ResponseField>
    <ResponseField name="data.result_url" type="string | null">Temporary generated-video URL for a successful task.</ResponseField>
    <ResponseField name="data.submit_time" type="integer">Task submission Unix timestamp in seconds.</ResponseField>
    <ResponseField name="data.start_time" type="integer">Task start Unix timestamp in seconds; `0` before processing starts.</ResponseField>
    <ResponseField name="data.finish_time" type="integer">Task completion Unix timestamp in seconds; `0` before a terminal state.</ResponseField>
    <ResponseField name="data.progress" type="string">Progress from `0%` through `100%`.</ResponseField>
    <ResponseField name="data.request_id" type="string">AnyFast request trace ID.</ResponseField>
    <ResponseField name="data.data" type="object">Raw upstream response data.</ResponseField>
    <ResponseField name="data.data.output" type="object">Raw upstream task output.</ResponseField>
    <ResponseField name="data.data.output.task_id" type="string">Upstream task ID.</ResponseField>
    <ResponseField name="data.data.output.task_status" type="string">Upstream status such as `PENDING`, `RUNNING`, `SUCCEEDED`, `FAILED`, `CANCELED`, or `UNKNOWN`.</ResponseField>
    <ResponseField name="data.data.output.video_url" type="string | null">Generated-video URL in the upstream output.</ResponseField>
    <ResponseField name="data.data.output.orig_prompt" type="string">Prompt received by the upstream service.</ResponseField>
    <ResponseField name="data.data.output.submit_time" type="string">Upstream task submission time.</ResponseField>
    <ResponseField name="data.data.output.scheduled_time" type="string">Upstream task scheduling time.</ResponseField>
    <ResponseField name="data.data.output.end_time" type="string">Upstream task completion time.</ResponseField>
    <ResponseField name="data.data.request_id" type="string">Upstream request trace ID.</ResponseField>
    <ResponseField name="data.data.usage" type="object | null">Upstream usage details, normally present after success.</ResponseField>
    <ResponseField name="data.data.usage.SR" type="integer">Output resolution value.</ResponseField>
    <ResponseField name="data.data.usage.duration" type="number">Billable duration in seconds.</ResponseField>
    <ResponseField name="data.data.usage.input_video_duration" type="number">Input-video duration reported for usage.</ResponseField>
    <ResponseField name="data.data.usage.output_video_duration" type="number">Generated output-video duration in seconds.</ResponseField>
    <ResponseField name="data.data.usage.ratio" type="string">Generated video aspect ratio when returned.</ResponseField>
    <ResponseField name="data.data.usage.video_count" type="integer">Number of generated videos.</ResponseField>
  </Tab>
</Tabs>

## Error responses

* `400 Bad Request` - Invalid input or an unsupported parameter.
* `401 Unauthorized` - The API key is missing or invalid.
* `404 Not Found` - The requested task does not exist.
* `429 Rate limit exceeded` - The request rate exceeded the applicable limit.

<script src="/public/feedback.js" />
