/modelsWAN3 Developer Platform
一个 API,连接图像与视频创作。
发现当前可用模型,安全导入素材,以跨模型幂等键提交任务,并从 WAN3 自有存储读取结果。
/uploads受验证的私有素材
/generations统一图像与视频任务
第一次生成
curl https://wan3.net/api/v1/generations \
-H "Authorization: Bearer $WAN3_API_KEY" \
-H "Idempotency-Key: video-job-001" \
-H "Content-Type: application/json" \
-d '{"model":"wan3","input":{"type":"text-to-video","workflow":"t2v","prompt":"A paper dragon crossing an orange-lit city","duration":5,"resolution":"720p","aspect_ratio":"16:9"}}'WAN3 Agent Skills · v1.0.0
下载图像与视频生成 Skills
Skill 使用你的 WAN3 API Key 调用 WAN3 平台。内部服务凭据只保存在 WAN3 服务端,不会交给 Skill 或开发者。
unzip wan3-agent-skills-v1.0.0.zip
export WAN3_API_KEY=wan3_live_...
# Copy wan3-image-generation or wan3-video-generation into your agent's skills directory.文本生成图片
curl https://wan3.net/api/v1/generations \
-H "Authorization: Bearer $WAN3_API_KEY" \
-H "Idempotency-Key: image-job-001" \
-H "Content-Type: application/json" \
-d '{"model":"nano-banana","input":{"type":"text-to-image","prompt":"A ceramic fox in a quiet studio","aspect_ratio":"1:1"}}'Node.js
const response = await fetch("https://wan3.net/api/v1/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WAN3_API_KEY}`,
"Idempotency-Key": "video-job-001",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "wan3",
input: { type: "text-to-video", workflow: "t2v", prompt: "A paper dragon crossing a city", duration: 5, resolution: "720p" },
}),
});
console.log(await response.json());Python
import os, requests
response = requests.post(
"https://wan3.net/api/v1/generations",
headers={
"Authorization": f"Bearer {os.environ['WAN3_API_KEY']}",
"Idempotency-Key": "image-job-001",
},
json={"model": "nano-banana", "input": {"type": "text-to-image", "prompt": "A ceramic fox"}},
timeout=30,
)
print(response.json())素材上传
# 1. Reserve: POST /api/v1/uploads with file_name, file_type, file_size
# 2. PUT bytes to data.upload_url with every data.required_headers value
# 3. Complete: POST /api/v1/uploads/{reservation_id}/complete
# 4. Pass the returned opaque media id in input.media_ids任务轮询
curl https://wan3.net/api/v1/generations/{generation_id} \
-H "Authorization: Bearer $WAN3_API_KEY"稳定错误契约
| code | HTTP | meaning |
|---|---|---|
| invalid_request | 400 | Request fields or owned media are invalid |
| unauthorized | 401 | API key is invalid, expired, or revoked |
| insufficient_credits | 402 | Account balance cannot fund the task |
| forbidden | 403 | The key does not have the required scope |
| not_found | 404 | The owned generation or media was not found |
| idempotency_conflict | 409 | The key was reused with another public request |
| rate_limited | 429 | Retry after the Retry-After interval |
| provider_rejected | 502 | The task was rejected and exposes no upstream details |
| service_busy | 503 | Retry safely with the same Idempotency-Key |
API Key 只在创建时显示一次并且只能保存在服务端。每次生成都必须提供稳定的 Idempotency-Key;网络重试复用原键,有意创建新任务时才使用新键。实时模型字段以 GET /models 为准,额度用量通过 GET /usage 查询。