curl -X GET https://www.geeknow.top/v1/videos/task_xxxx \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
task_id = "task_xxxx"
response = requests.get(
f"https://www.geeknow.top/v1/videos/{task_id}",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(response.json())
const taskId = "task_xxxx";
const response = await fetch(`https://www.geeknow.top/v1/videos/${taskId}`, {
method: "GET",
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
});
console.log(await response.json());
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "in_progress",
"progress": 50,
"created_at": 1782690295,
"video_url": null,
"error": null
}
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "completed",
"progress": 100,
"created_at": 1782690295,
"completed_at": 1782690494,
"video_url": "https://example.com/output.mp4",
"metadata": {
"content_url": "https://www.geeknow.top/v1/videos/task_xxxx/content"
},
"error": null
}
{
"output": {
"task_id": "fb40ef13-19e2-4418-9639-5bc89d49b33d",
"task_status": "SUCCEEDED",
"video_url": "https://example.com/output.mp4"
},
"usage": {
"duration": 5.0,
"output_video_duration": 5.0,
"fps": 30,
"ratio": "16:9"
}
}
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "failed",
"error": {
"code": "generation_failed",
"message": "video generation failed"
}
}
Wan 3.0
Wan 3.0 查询视频任务
使用 GET /v1/videos/ 查询 Wan 3.0 视频任务状态、结果和错误信息。
GET
https://www.geeknow.top
/
v1
/
videos
/
{task_id}
curl -X GET https://www.geeknow.top/v1/videos/task_xxxx \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
task_id = "task_xxxx"
response = requests.get(
f"https://www.geeknow.top/v1/videos/{task_id}",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(response.json())
const taskId = "task_xxxx";
const response = await fetch(`https://www.geeknow.top/v1/videos/${taskId}`, {
method: "GET",
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
});
console.log(await response.json());
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "in_progress",
"progress": 50,
"created_at": 1782690295,
"video_url": null,
"error": null
}
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "completed",
"progress": 100,
"created_at": 1782690295,
"completed_at": 1782690494,
"video_url": "https://example.com/output.mp4",
"metadata": {
"content_url": "https://www.geeknow.top/v1/videos/task_xxxx/content"
},
"error": null
}
{
"output": {
"task_id": "fb40ef13-19e2-4418-9639-5bc89d49b33d",
"task_status": "SUCCEEDED",
"video_url": "https://example.com/output.mp4"
},
"usage": {
"duration": 5.0,
"output_video_duration": 5.0,
"fps": 30,
"ratio": "16:9"
}
}
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "failed",
"error": {
"code": "generation_failed",
"message": "video generation failed"
}
}
Wan 3.0 查询视频任务
Wan 3.0 视频任务是异步执行的。创建任务后,保存响应中的id 或 task_id,再通过 GET /v1/videos/{task_id} 轮询任务状态。任务完成后,可以读取 video_url,或者使用内容代理接口下载 MP4。
查询任务
GET /v1/videos/{task_id}
curl -X GET https://www.geeknow.top/v1/videos/task_xxxx \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
task_id = "task_xxxx"
response = requests.get(
f"https://www.geeknow.top/v1/videos/{task_id}",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(response.json())
const taskId = "task_xxxx";
const response = await fetch(`https://www.geeknow.top/v1/videos/${taskId}`, {
method: "GET",
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
});
console.log(await response.json());
下载视频内容
GET /v1/videos/{task_id}/content
curl -L https://www.geeknow.top/v1/videos/task_xxxx/content \
-H "Authorization: Bearer YOUR_API_KEY" \
--output result.mp4
video_url,可以使用此接口获取视频内容。
响应示例
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "in_progress",
"progress": 50,
"created_at": 1782690295,
"video_url": null,
"error": null
}
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "completed",
"progress": 100,
"created_at": 1782690295,
"completed_at": 1782690494,
"video_url": "https://example.com/output.mp4",
"metadata": {
"content_url": "https://www.geeknow.top/v1/videos/task_xxxx/content"
},
"error": null
}
{
"output": {
"task_id": "fb40ef13-19e2-4418-9639-5bc89d49b33d",
"task_status": "SUCCEEDED",
"video_url": "https://example.com/output.mp4"
},
"usage": {
"duration": 5.0,
"output_video_duration": 5.0,
"fps": 30,
"ratio": "16:9"
}
}
{
"id": "task_xxxx",
"object": "video",
"model": "wan3.0-video",
"status": "failed",
"error": {
"code": "generation_failed",
"message": "video generation failed"
}
}
Path Parameters
string
required
创建接口返回的任务 ID。通常使用响应中的
id,部分响应也会返回兼容字段 task_id。状态处理
| 状态 | 含义 | 客户端处理 |
|---|---|---|
queued | 任务排队中 | 继续轮询 |
in_progress | 视频生成中 | 继续轮询 |
completed | 生成完成 | 读取 video_url 或下载 /content |
failed | 生成失败 | 读取 error.code 和 error.message |
output.task_status = SUCCEEDED表示生成成功。output.task_status处于排队或运行状态时,继续轮询。- 其他失败状态应按失败任务处理,并记录完整的
output或错误信息。
5 到 10 秒。任务处理中不要重复提交相同的生成请求。
Response
string
视频任务 ID。后续用于查询状态或下载视频内容。
string
视频任务 ID 的兼容字段,通常与
id 相同。string
对象类型,通常为
video。string
任务实际使用的模型,例如
wan3.0-video 或 wan3.0-video-prime。string
统一任务状态,常见值为
queued、in_progress、completed 和 failed。integer
任务进度百分比。部分上游不会稳定更新进度,客户端应以终态状态为准。
string
生成完成后的视频地址。为空或不可访问时,可使用
/v1/videos/{task_id}/content 下载。object
任务附加信息,可能包含
content_url、过期时间或计费用量等字段。object
任务失败时返回的错误对象,通常包含
code 和 message。常见问题
| 现象 | 处理 |
|---|---|
| 查询不到任务 | 确认使用的是创建响应返回的 id 或 task_id,并且请求使用同一个 API Token |
| 任务持续处理中 | 按 5 到 10 秒间隔继续轮询,不要重复提交 |
| 任务完成但没有直链 | 请求 GET /v1/videos/{task_id}/content 下载 |
| 百炼返回 400 互斥错误 | 检查是否混传了首尾帧和参考素材 |
| 结果比例或清晰度不符合预期 | 创建任务时显式传 size 和 aspect_ratio |