curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mini-2.0",
"prompt": "清晨海边,航拍镜头掠过浪花,阳光穿过薄雾,电影感",
"duration": 8,
"ratio": "16:9",
"resolution": "480p"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mini-2.0",
"prompt": "参考人物外观和服装,让人物自然转身并走向镜头,保持竖屏构图",
"duration": 6,
"ratio": "9:16",
"resolution": "480p",
"images": [
"https://example.com/assets/character.png",
"https://example.com/assets/background.png"
]
}'
import requests
resp = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "mini-2.0",
"prompt": "参考产品图生成一段镜头缓慢环绕产品的广告视频",
"duration": 8,
"ratio": "16:9",
"resolution": "480p",
"images": ["https://example.com/assets/product.png"],
},
timeout=120,
)
print(resp.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: "mini-2.0",
prompt: "清晨森林中的小路,镜头平稳向前推进",
duration: 8,
ratio: "16:9",
resolution: "480p",
}),
});
console.log(await response.json());
{
"id": "mini-2.0_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task_id": "mini-2.0_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"object": "video",
"model": "mini-2.0",
"status": "queued",
"progress": 0,
"created_at": 1782690295,
"completed_at": null,
"duration": 8,
"url": null,
"video_url": null,
"metadata": {},
"error": null
}
{
"error": {
"message": "ratio must be 16:9 or 9:16",
"type": "invalid_request_error",
"param": "ratio",
"code": "invalid_request_error"
}
}
mini-2.0
mini-2.0 视频生成
使用 JSON 请求调用 mini-2.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": "mini-2.0",
"prompt": "清晨海边,航拍镜头掠过浪花,阳光穿过薄雾,电影感",
"duration": 8,
"ratio": "16:9",
"resolution": "480p"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mini-2.0",
"prompt": "参考人物外观和服装,让人物自然转身并走向镜头,保持竖屏构图",
"duration": 6,
"ratio": "9:16",
"resolution": "480p",
"images": [
"https://example.com/assets/character.png",
"https://example.com/assets/background.png"
]
}'
import requests
resp = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "mini-2.0",
"prompt": "参考产品图生成一段镜头缓慢环绕产品的广告视频",
"duration": 8,
"ratio": "16:9",
"resolution": "480p",
"images": ["https://example.com/assets/product.png"],
},
timeout=120,
)
print(resp.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: "mini-2.0",
prompt: "清晨森林中的小路,镜头平稳向前推进",
duration: 8,
ratio: "16:9",
resolution: "480p",
}),
});
console.log(await response.json());
{
"id": "mini-2.0_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task_id": "mini-2.0_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"object": "video",
"model": "mini-2.0",
"status": "queued",
"progress": 0,
"created_at": 1782690295,
"completed_at": null,
"duration": 8,
"url": null,
"video_url": null,
"metadata": {},
"error": null
}
{
"error": {
"message": "ratio must be 16:9 or 9:16",
"type": "invalid_request_error",
"param": "ratio",
"code": "invalid_request_error"
}
}
mini-2.0 视频生成
mini-2.0 使用 application/json 请求体提交异步视频任务。可以只传文字生成视频,也可以通过 images 传入参考图生成视频。
模型规格
| 项目 | 说明 |
|---|---|
model | 固定传 mini-2.0 |
| 请求格式 | application/json |
| 时长 | duration 支持 4 到 15 秒的整数 |
| 画幅 | ratio 仅支持 16:9、9:16 |
| 清晰度 | resolution 固定为 480p,服务端会统一按 480p 处理 |
| 参考图 | images 可选,最多 9 张公网图片 URL |
方法与路径
POST /v1/videos
请求示例
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mini-2.0",
"prompt": "清晨海边,航拍镜头掠过浪花,阳光穿过薄雾,电影感",
"duration": 8,
"ratio": "16:9",
"resolution": "480p"
}'
curl -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mini-2.0",
"prompt": "参考人物外观和服装,让人物自然转身并走向镜头,保持竖屏构图",
"duration": 6,
"ratio": "9:16",
"resolution": "480p",
"images": [
"https://example.com/assets/character.png",
"https://example.com/assets/background.png"
]
}'
import requests
resp = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "mini-2.0",
"prompt": "参考产品图生成一段镜头缓慢环绕产品的广告视频",
"duration": 8,
"ratio": "16:9",
"resolution": "480p",
"images": ["https://example.com/assets/product.png"],
},
timeout=120,
)
print(resp.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: "mini-2.0",
prompt: "清晨森林中的小路,镜头平稳向前推进",
duration: 8,
ratio: "16:9",
resolution: "480p",
}),
});
console.log(await response.json());
响应示例
{
"id": "mini-2.0_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task_id": "mini-2.0_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"object": "video",
"model": "mini-2.0",
"status": "queued",
"progress": 0,
"created_at": 1782690295,
"completed_at": null,
"duration": 8,
"url": null,
"video_url": null,
"metadata": {},
"error": null
}
{
"error": {
"message": "ratio must be 16:9 or 9:16",
"type": "invalid_request_error",
"param": "ratio",
"code": "invalid_request_error"
}
}
认证
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Body
string
required
模型名称。固定传
mini-2.0。string
required
视频生成提示词。参考图模式下,说明图片中的主体、动作和镜头关系。
integer
required
输出视频时长,单位为秒。支持
4 到 15 秒的整数。string
required
画幅比例。仅支持
16:9 和 9:16。string
required
输出清晰度。传
480p;该模型不提供其它清晰度档位。array<string>
可选参考图数组。最多 9 张,每项使用公网图片 URL;本地图片需要先上传。
注意事项
- JSON 请求必须携带
Content-Type: application/json。 duration只能传4到15的整数。ratio只能传16:9或9:16。- 服务端将
resolution统一按480p处理。 images不是content数组,最多传 9 张,不能使用 data URI。