curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "角色从墙上活过来,缓缓转头并走向镜头",
"image": "https://example.com/first-frame.png",
"seconds": 5,
"size": "720P",
"aspect_ratio": "9x16"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video-prime",
"prompt": "画面中的人物从微笑慢慢变为大笑,镜头平滑推进",
"mode": "first-last-frame",
"image": "https://example.com/first.png",
"images": [
"https://example.com/last.png"
],
"metadata": {
"first_frame_url": "https://example.com/first.png",
"last_frame_url": "https://example.com/last.png"
},
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "参考人物、道具和场景风格生成一段自然行走的视频",
"images": [
"https://example.com/character.png",
"https://example.com/prop.png",
"https://example.com/scene.png"
],
"mode": "all-reference",
"seconds": 10,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "视频中的人物抱着图片中的物体,在场景图片的房间内弹奏",
"media": [
{
"type": "reference_video",
"url": "https://example.com/role.mp4"
},
{
"type": "reference_image",
"url": "https://example.com/object.png"
},
{
"type": "reference_image",
"url": "https://example.com/scene.png"
}
]
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 10,
"audio": true
}
}'
import requests
response = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "wan3.0-video",
"prompt": "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9",
},
timeout=60,
)
print(response.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "wan3.0-video",
prompt: "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
seconds: 5,
size: "1080P",
aspect_ratio: "16x9",
}),
});
console.log(await response.json());
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "queued",
"created_at": 1782690295
}
{
"error": {
"message": "prompt is required",
"type": "invalid_request_error",
"param": "prompt",
"code": "invalid_request_error"
}
}
{
"error": {
"message": "invalid token",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}
{
"error": {
"message": "insufficient quota",
"type": "invalid_request_error",
"code": "insufficient_quota"
}
}
{
"error": {
"message": "rate limit exceeded",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}
Wan 3.0
Wan 3.0 视频生成
使用 POST /v1/videos 调用通义万相 Wan 3.0,支持文生、图生、首尾帧、多图参考和多模态参考。
POST
https://magic666.top
/
v1
/
videos
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "角色从墙上活过来,缓缓转头并走向镜头",
"image": "https://example.com/first-frame.png",
"seconds": 5,
"size": "720P",
"aspect_ratio": "9x16"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video-prime",
"prompt": "画面中的人物从微笑慢慢变为大笑,镜头平滑推进",
"mode": "first-last-frame",
"image": "https://example.com/first.png",
"images": [
"https://example.com/last.png"
],
"metadata": {
"first_frame_url": "https://example.com/first.png",
"last_frame_url": "https://example.com/last.png"
},
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "参考人物、道具和场景风格生成一段自然行走的视频",
"images": [
"https://example.com/character.png",
"https://example.com/prop.png",
"https://example.com/scene.png"
],
"mode": "all-reference",
"seconds": 10,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "视频中的人物抱着图片中的物体,在场景图片的房间内弹奏",
"media": [
{
"type": "reference_video",
"url": "https://example.com/role.mp4"
},
{
"type": "reference_image",
"url": "https://example.com/object.png"
},
{
"type": "reference_image",
"url": "https://example.com/scene.png"
}
]
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 10,
"audio": true
}
}'
import requests
response = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "wan3.0-video",
"prompt": "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9",
},
timeout=60,
)
print(response.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "wan3.0-video",
prompt: "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
seconds: 5,
size: "1080P",
aspect_ratio: "16x9",
}),
});
console.log(await response.json());
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "queued",
"created_at": 1782690295
}
{
"error": {
"message": "prompt is required",
"type": "invalid_request_error",
"param": "prompt",
"code": "invalid_request_error"
}
}
{
"error": {
"message": "invalid token",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}
{
"error": {
"message": "insufficient quota",
"type": "invalid_request_error",
"code": "insufficient_quota"
}
}
{
"error": {
"message": "rate limit exceeded",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}
Wan 3.0 视频生成
Wan 3.0 通过POST /v1/videos 提交异步视频任务。请求体使用 application/json,客户端统一访问 https://magic666.top。
方法与路径
POST /v1/videos
认证
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
请求示例
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "角色从墙上活过来,缓缓转头并走向镜头",
"image": "https://example.com/first-frame.png",
"seconds": 5,
"size": "720P",
"aspect_ratio": "9x16"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video-prime",
"prompt": "画面中的人物从微笑慢慢变为大笑,镜头平滑推进",
"mode": "first-last-frame",
"image": "https://example.com/first.png",
"images": [
"https://example.com/last.png"
],
"metadata": {
"first_frame_url": "https://example.com/first.png",
"last_frame_url": "https://example.com/last.png"
},
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"prompt": "参考人物、道具和场景风格生成一段自然行走的视频",
"images": [
"https://example.com/character.png",
"https://example.com/prop.png",
"https://example.com/scene.png"
],
"mode": "all-reference",
"seconds": 10,
"size": "1080P",
"aspect_ratio": "16x9"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "视频中的人物抱着图片中的物体,在场景图片的房间内弹奏",
"media": [
{
"type": "reference_video",
"url": "https://example.com/role.mp4"
},
{
"type": "reference_image",
"url": "https://example.com/object.png"
},
{
"type": "reference_image",
"url": "https://example.com/scene.png"
}
]
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 10,
"audio": true
}
}'
import requests
response = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "wan3.0-video",
"prompt": "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
"seconds": 5,
"size": "1080P",
"aspect_ratio": "16x9",
},
timeout=60,
)
print(response.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "wan3.0-video",
prompt: "一只小猫在月光下的屋顶上奔跑,电影感镜头,细腻光影",
seconds: 5,
size: "1080P",
aspect_ratio: "16x9",
}),
});
console.log(await response.json());
响应示例
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "queued",
"created_at": 1782690295
}
{
"error": {
"message": "prompt is required",
"type": "invalid_request_error",
"param": "prompt",
"code": "invalid_request_error"
}
}
{
"error": {
"message": "invalid token",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}
{
"error": {
"message": "insufficient quota",
"type": "invalid_request_error",
"code": "insufficient_quota"
}
}
{
"error": {
"message": "rate limit exceeded",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}
Body
string
required
模型名称。支持
wan3.0-video(标准版)和 wan3.0-video-prime(优速版)。模型必须已在当前账户分组中开通。string
required
视频生成提示词。建议描述主体、动作、镜头运动、构图、光影和风格。文生、图生和参考素材场景都建议传入。
string | integer
生成时长,单位为秒。支持
2 到 30 秒,默认值为 5。可以传数字 5,也可以传字符串 "5"。integer
时长兼容字段,单位为秒。与顶层
seconds 同时传入时,优先使用 seconds。string
输出分辨率档位。支持
480P、720P、1080P,未传时默认使用 1080P。Wan 3.0 不使用 WxH 字符串作为主分辨率字段。string
输出画幅比例。支持
16x9 / 16:9、9x16 / 9:16、1x1 / 1:1、4x3 / 4:3、3x4 / 3:4 和 adaptive。string
单张首帧图或参考图 URL。必须是服务端可访问的
http:// 或 https:// 地址。单独传一张图时会映射为上游的 first_frame。array<string>
多张参考图 URL。没有首尾帧标记且传入至少两张时,会映射为多个
reference_image;参考图最多 10 张。string | array<string>
OpenAI Videos 兼容的参考图字段。传字符串时等同于一张图片,传数组时会并入
images。string
生成模式提示。
first-last-frame、first_last_frame 和 kf2v 表示首尾帧;all-reference、reference 和 r2v 表示全能参考。object
扩展参数。常用字段包括
first_frame_url、last_frame_url、reference_image_urls、reference_video_urls、reference_audio_urls 和 parameters.audio。object
高级原生请求结构。
input.media 存在时会原样透传,媒体类型使用 first_frame、last_frame、reference_image、reference_video 或 reference_audio。object
高级参数对象。原生结构中常用
resolution、ratio、duration 和 audio。参数优先级
时长优先级:- 顶层
seconds - 顶层
duration metadata.parameters.duration- 默认值
5
- 顶层
size metadata.parameters.resolution- 默认值
1080P
- 顶层
aspect_ratio metadata.parameters.ratio
请求构造规则
| 场景 | 关键字段 | 上游媒体类型 |
|---|---|---|
| 文生视频 | model + prompt | 无 media |
| 图生视频 | image | first_frame |
| 首尾帧 | mode: first-last-frame + 首尾帧 metadata | first_frame + last_frame |
| 多图参考 | images(至少 2 张)或 mode: all-reference | 多个 reference_image |
| 参考视频 | metadata.reference_video_urls 或原生 input.media | reference_video |
| 参考音频 | metadata.reference_audio_urls 或原生 input.media | reference_audio |
| 有声视频 | metadata.parameters.audio: true 或原生 parameters.audio | 由模型能力决定 |
首尾帧和参考素材是互斥场景。不要在同一个请求中混合
first_frame / last_frame 与 reference_image / reference_video / reference_audio。需要首尾帧时,显式传 mode 和首尾帧 URL。相关接口
⌘I