WAN3 Developer Platform

API เดียวสำหรับรูปภาพและวิดีโอ

ค้นหาโมเดล อัปโหลดสื่อของคุณอย่างปลอดภัย ส่งงานแบบ idempotent และอ่านผลจากพื้นที่จัดเก็บของ WAN3

/models

ค้นหาโมเดลที่ใช้ได้

/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"}}'
OpenAPI 3.1MarkdownIdempotency-Key requiredNo browser CORS keys

WAN3 Agent Skills · v1.0.0

ดาวน์โหลด Skills สำหรับรูปภาพและวิดีโอ

Skills เรียก WAN3 ด้วย API key ของคุณ ข้อมูลรับรองภายในจะอยู่บนเซิร์ฟเวอร์เท่านั้น

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"

สัญญาข้อผิดพลาดที่เสถียร

codeHTTPmeaning
invalid_request400Request fields or owned media are invalid
unauthorized401API key is invalid, expired, or revoked
insufficient_credits402Account balance cannot fund the task
forbidden403The key does not have the required scope
not_found404The owned generation or media was not found
idempotency_conflict409The key was reused with another public request
rate_limited429Retry after the Retry-After interval
provider_rejected502The task was rejected and exposes no upstream details
service_busy503Retry safely with the same Idempotency-Key

API key จะแสดงครั้งเดียวและต้องเก็บบนเซิร์ฟเวอร์ ใช้ Idempotency-Key เดิมเมื่อส่งซ้ำเพราะเครือข่าย และใช้คีย์ใหม่เฉพาะงานใหม่ ดูโมเดลที่ GET /models และการใช้เครดิตที่ GET /usage