Wan 3.0

POST https://api.beatapi.io/v1/videos/tasks

一次直出 2–30 秒的 480p / 720p / 1080p 视频,是目录里最长的单镜头。

支持的生成方式

生成方式必填参数使用规则
文生视频model, prompt不要传入 images
图生视频model, prompt, images传入一张图,渲染就从这一帧开始。
带参考素材model, prompt, reference_videos or reference_audios带参考视频的请求按 1.5 倍计费。

异步任务流程

创建任务后保存 data.id,每 5–10 秒调用 GET /v1/tasks/{task_id} 查询状态。statussucceeded 时读取 data.output.media,为 failed 时读取 data.error_codedata.error_message,随后按错误与重试策略处理。

使用本地文件

请先上传本地输入,再将返回的 data.url 填入请求。

鉴权

Authorization   string   必填

Authorization 请求头中以 Bearer 令牌发送服务端 API 密钥,可在控制台创建。

Authorization: Bearer <BEATAPI_API_KEY>

永久 API 密钥只能保存在可信服务端,不能写入浏览器、移动端、公开脚本、日志或截图。请求体必须使用 Content-Type: application/json。建议为每个逻辑创建请求设置唯一的 Idempotency-Key,只有完全相同的请求体才能安全复用原键。

请求体

字段名、类型和枚举值保留英文原样,用途和限制用中文说明。

model   string   必填

稳定的公开模型 ID,必须使用当前页面列出的值。

取值与默认值: 固定值 wan-3.0


prompt   string   必填

描述生成、编辑或分析目标的提示词。

取值与默认值: 长度 1–5000 字符


images   string[]   选填

按当前模型或工作流要求排序的公网 HTTPS 图片 URL 列表。

取值与默认值: 1–10 项


reference_videos   string[]   选填

多模态或动作迁移使用的公网 HTTPS 视频 URL 列表。

取值与默认值: 1–5 项


reference_audios   string[]   选填

多模态生成使用的公网 HTTPS 参考音频 URL 列表。

取值与默认值: 1–5 项


duration   integer   选填

请求的输出时长,单位为秒。

取值与默认值: 默认值 5;取值范围 2–30


aspect_ratio   enum<string>   选填

输出素材的宽高比。

取值与默认值: 可选值 16:99:161:14:33:4;默认值 16:9


resolution   enum<string>   选填

输出素材的分辨率或质量档位。

取值与默认值: 可选值 480p720p1080p;默认值 720p

请求示例

文生视频

$curl --request POST \
> --url https://api.beatapi.io/v1/videos/tasks \
> --header 'Authorization: Bearer <BEATAPI_API_KEY>' \
> --header 'Content-Type: application/json' \
> --data '{
> "model": "wan-3.0",
> "prompt": "A slow dolly through a neon-lit night market in the rain, steam rising from food stalls.",
> "duration": 8,
> "aspect_ratio": "16:9",
> "resolution": "720p"
>}'

图生视频

$curl --request POST \
> --url https://api.beatapi.io/v1/videos/tasks \
> --header 'Authorization: Bearer <BEATAPI_API_KEY>' \
> --header 'Content-Type: application/json' \
> --data '{
> "model": "wan-3.0",
> "prompt": "The camera orbits the product as the light sweeps across it.",
> "images": [
> "https://media.beatapi.io/samples/smart-bottle.png"
> ],
> "duration": 20,
> "resolution": "1080p"
>}'

带参考素材

$curl --request POST \
> --url https://api.beatapi.io/v1/videos/tasks \
> --header 'Authorization: Bearer <BEATAPI_API_KEY>' \
> --header 'Content-Type: application/json' \
> --data '{
> "model": "wan-3.0",
> "prompt": "Match the motion of the reference clip and hold the subject for the full take.",
> "reference_videos": [
> "https://media.beatapi.io/inputs/motion.mp4"
> ],
> "duration": 30,
> "aspect_ratio": "9:16",
> "resolution": "480p"
>}'

响应

成功请求返回 HTTP 201,响应体如下。

1{
2 "data": {
3 "id": "task_8K2qA",
4 "object": "task",
5 "task_kind": "video",
6 "capability_id": "wan-3.0",
7 "capability_version": null,
8 "media_type": "video",
9 "model": "wan-3.0",
10 "status": "queued",
11 "stage": "queued",
12 "created_at": 1782210000,
13 "updated_at": 1782210000,
14 "completed_at": null,
15 "output": null,
16 "usage": {
17 "credits_reserved": 0.63,
18 "credits_charged": 0.63,
19 "billable_duration_seconds": 5,
20 "credits_settled": 0,
21 "credits_refunded": 0
22 },
23 "request_id": "req_abc123",
24 "error_code": null,
25 "error_message": null
26 }
27}

下一步

保存接受响应中的 data.id,每 5–10 秒轮询 GET /v1/tasks/{task_id}。任务成功后从 data.output.media 读取托管结果。

错误

状态码含义与处理方式
400请求字段、格式、取值或参数组合不合法,请修正后重新请求。
401API 密钥缺失、无效或未启用。
402USD 余额不足,请充值后再创建付费任务。
409幂等键已对应其他请求体,仅能对完全相同的逻辑请求复用原键。
429超过请求频率或并发上限,请遵守 Retry-After 或返回的等待时间。