---
title: &quot;通过 RunAPI 在龙虾 (OpenClaw) 中使用 Wan —— 视频与图像 API 指南&quot;
url: &quot;https://runapi.ai/zh-CN/openclaw-wan.md&quot;
canonical: &quot;https://runapi.ai/zh-CN/openclaw-wan&quot;
locale: &quot;zh-CN&quot;
model: &quot;wan&quot;
---

# 在 OpenClaw 中使用 Wan。

Wan 是 Alibaba 的开源视频与图像生成模型，采用 Apache 2.0 许可，在 Artificial Analysis 文生视频排行榜上位列第一。它涵盖从 Wan 2.2 到 2.7 的 20 多个版本 —— 文生视频、图生视频、带唇形同步的语音生视频、通过 R2V 进行视频编辑，以及最高 4K 的图像生成。OpenClaw 智能体使用与聊天相同的 RunAPI 密钥调用任意 Wan 端点。

## API example

```bash
curl -X POST https://runapi.ai/api/v1/task/text_to_video \
  -H &quot;Authorization: Bearer $RUNAPI_API_KEY&quot; \
  -H &quot;Content-Type: application/json&quot; \
  -d &#39;{
    &quot;model&quot;: &quot;wan-2.7-text-to-video&quot;,
    &quot;prompt&quot;: &quot;A drone shot rising over terraced rice paddies at golden hour, mist rolling through the valleys, slow upward camera tilt&quot;,
    &quot;output_resolution&quot;: &quot;1080p&quot;
  }&#39;

```

### Response

```json
{
  &quot;task_id&quot;: &quot;tsk_abc123&quot;,
  &quot;status&quot;: &quot;pending&quot;,
  &quot;model&quot;: &quot;wan-2.7-text-to-video&quot;
}

```

## How it works

1. **Configure RunAPI** — Set RUNAPI_API_KEY in your environment. If you already configured RunAPI in OpenClaw for chat or image generation, the same key works for all Wan endpoints — no extra provider setup needed.
2. **Call a Wan endpoint** — Send a POST request to text_to_video with model set to wan-2.7-text-to-video and output_resolution to 720p or 1080p. For image-to-video, use wan-2.7-image-to-video with a first_frame_image_url. For speech-driven video, use wan-2.2-a14b-speech-to-video-turbo with source_audio_url and source_image_url.
3. **Poll for the result** — The endpoint returns a task_id immediately. Poll the task status endpoint until the status is completed, then read the output video or image URL from the response. RunAPI SDKs and the CLI handle polling automatically.

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `model` | `string` | Required. wan-2.7-text-to-video, wan-2.6-text-to-video, wan-2.5-text-to-video, wan-2.2-a14b-text-to-video-turbo, or wan-2.7-r2v. |
| `prompt` | `string` | Required. Text description of the desired video scene, including camera motion, lighting, and subject detail. |
| `output_resolution` | `string` | Optional. 720p or 1080p for Wan 2.5+. Wan 2.2 also accepts 480p and 580p. Defaults to 720p. |
| `aspect_ratio` | `string` | Optional. For wan-2.7-r2v only. Accepted values: 16:9, 9:16, 1:1, 4:3, 3:4. |
| `duration_seconds` | `integer` | Optional. For wan-2.7-r2v only. Video length in seconds, 2 to 10. |
| `seed` | `integer` | Optional. Reproducibility seed for deterministic output. |
| `callback_url` | `string` | Optional. Webhook URL that receives a POST when the task completes. |

## FAQ

### Which Wan endpoints can I call from OpenClaw?

All of them. text_to_video, image_to_video, speech_to_video, text_to_image (Wan 2.7 Image), edit_video, and animate. Each endpoint uses a different model slug — for example wan-2.7-text-to-video for video generation and wan-2.7-image for image generation up to 4K.

### What is the difference between Wan 2.5, 2.6, and 2.7?

Wan 2.5 introduced 1080p output. Wan 2.6 added video editing (R2V) and flash variants for faster generation. Wan 2.7 adds image generation (wan-2.7-image, wan-2.7-image-pro up to 4K), video editing (wan-2.7-edit-video), and improved text-to-video quality that leads the Artificial Analysis leaderboard.

### How does speech-to-video work with Wan?

Use wan-2.2-a14b-speech-to-video-turbo with source_audio_url (the audio file) and source_image_url (the face to animate). Wan generates a lip-synced video where the face speaks the audio. Output resolution supports 480p, 580p, or 720p.

### Can I generate images with Wan?

Yes. Wan 2.7 added text_to_image endpoints. Use wan-2.7-image for standard generation or wan-2.7-image-pro for higher quality. Both support aspect ratios from 1:1 to 21:9 and output resolutions of 1k, 2k, or 4k.

### Is Wan open-source? Can I self-host it?

Yes. Wan is released under Apache 2.0 by Alibaba and the model weights are publicly available. Through RunAPI you skip the GPU setup — one API call generates video or images. If you need a self-hosted pipeline for privacy, the same weights run on your own infrastructure.


## Links

- [OpenClaw 配置指南 →](https://runapi.ai/zh-CN/openclaw)
- [Wan on RunAPI →](https://runapi.ai/zh-CN/models/wan)
- [Model catalog](https://runapi.ai/zh-CN/models)
- [API docs](https://runapi.ai/zh-CN/docs)
