API
CLUB

Wan 3.0

文生视频最长 30 秒,支持原生音频。

alibaba/wan3.0-video/text-to-video

能力

最适合

  • •电影感文生视频镜头
  • •社交媒体短片与广告
  • •连贯的多镜头片段
  • •视觉开发与风格探索

不适合

  • •逐帧精确转描
  • •长篇视频渲染
  • •像素级精确合成
  • •准确呈现画面文字

身份验证

API 密钥标头

Uika API 使用 API 密钥来验证请求。将您的密钥发送到 X-API 密钥 标题。API 密钥必须保密,不要暴露在浏览器或其他客户端代码中。请从服务端调用 API。登录后的试玩使用控制台会话,不会发送你的 API 密钥。

标题
X-API-Key: YOUR_API_KEY

端点

异步·轮询结果

发布https://api.dev.pika.art/v1/media/alibaba/wan3.0-video/text-to-video生成端点
获取https://api.dev.pika.art/v1/media/jobs/{request_id}民意调查直至完成
获取https://api.dev.pika.art/v1/media/jobs/{request_id}/content输出 URL,适用于仅保留 id 的客户端
删除https://api.dev.pika.art/v1/media/jobs/{request_id}删除存储的媒体并提示

REST 接入

标准 HTTPS

视频 通过上方 REST 接口生成。API 使用 HTTPS 传输标准 JSON,可搭配任意 HTTP 客户端,无需厂商专用 SDK。

生成

POST /v1/media/alibaba/wan3.0-video/text-to-video

请求

curl -X POST https://api.dev.pika.art/v1/media/alibaba/wan3.0-video/text-to-video \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "WIDE 16:9 CINEMATIC LETTERBOX PANORAMA — twice as wide as tall, like a cinema screen. NOT square, NOT vertical. A single continuous 10-second shot that travels from above the water to below it.\nTHE SCENE. A rectangular tiled bathing pool fills the frame from the far left edge to the far right edge as a long horizontal band, seen slightly from above and square-on; the pool's tiled steps and shallow ledges run along the left and right edges as symmetrical leading lines, the far tiled wall closing the top third, the still water filling the whole lower half. One woman is submerged in the pool up to her chin, only her head above the waterline, dead centre in frame, dark hair slicked flat and wet against her scalp with a centre parting, water beading on her forehead and running down her temples, chin level, facing camera, deadpan, entirely still. The water is pale and milky at the surface, perfectly calm, unbroken but for the meniscus curving where it meets her jaw. The pool is lined edge to edge in matte glazed square ceramic tiles in a soft chalky RED — a dusty brick-rose red at a gentle, low-to-moderate saturation, exactly as soft as a pale sage green, chalky and powdery rather than vivid: NOT scarlet, NOT crimson, NOT a bright saturated red, NOT a strong primary. The same soft tone across the far wall, the steps and the ledges, with pale grout lines and a faint mottled variation in the glaze.\nTHE MOTION. One unbroken shot, no cuts. FIRST BEAT: she holds absolutely still at the surface, deadpan, chin level, the water flat around her. She draws one slow breath in, her chest lifting, and closes her mouth. SECOND BEAT: she lowers herself straight down and submerges — sinking smoothly, not falling, the waterline climbing over her mouth, over her nose, over her open eyes, over her hair, until the milky surface closes above her and seals flat again. The camera SINKS WITH HER, descending in one continuous move and passing THROUGH the waterline in the middle of the shot — a brief blurred smear of surface and spray across the lens as it crosses — and comes out underwater, now fully submerged with her. THIRD BEAT: underwater. Her face fills more of the frame, lit softly from above, hair lifting and drifting slowly around her head in the water, the red tiles of the pool walls visible behind her but diffused and desaturated by the water. She holds her breath, cheeks faintly full, eyes open and steady on the camera, still deadpan. Then she parts her lips and slowly BLOWS OUT A STREAM OF AIR — a rising column of silver bubbles of mixed sizes tumbling and wobbling upward past her cheeks and forehead towards the surface, catching the light, the last few small ones trailing after. She keeps looking at the camera the whole time. Below the surface the water is clear enough to see her face and the tiled walls softly — hazy and diffused, never opaque, never black, never murky.\nColour: soft but vibrant — never oversaturated, never desaturated or washed out. Build one complementary pairing: pale milky cool water and bare skin against the soft chalky red tile. Colours true; no cast, no teal-and-orange or stylised tint. Contrast controlled, low-to-moderate. Do not let brown, tan, beige, khaki, sepia or muddy earthy tones spread through the frame. Lighting: bright, high-key and luminous like an airy daylight studio or a clean overcast day — light-filled and open, never dark, never moody, never low-key. A large soft close source from above, carrying down through the water as soft shafts. Shadows filled so texture holds in skin and tile; shadows soft but PRESENT. No bare flash, no harsh sun, no sharp-edged shadows. Light neutral and true, never coloured for mood. Skin with real photographic texture — visible pores, fine hairs, freckles, natural variation in tone, never smoothed or retouched or plastic. Anatomy correct and believable, face correctly formed and symmetrical, eyes level. Film texture: shot on real photographic film, medium-format or 35mm, fine organic grain across the whole frame, gentle halation where bright highlights meet darker tone, filmic and analogue, never clinical, never digitally sharp — no HDR, no clarity, no over-sharpening. Natural restrained grade, blacks open, slightly creamy finish, highlights rolling off softly. Deadpan, entirely straight-faced, quiet dry wit. Elevated high-end fashion campaign film. No text, no lettering, no logos, no branding, no watermark.\nAudio: above water — quiet tiled-room reverb, a faint lap of water against tile, one clear intake of breath. As the camera crosses the surface, the sound drops abruptly into a muffled underwater world: a low pressure hum, everything distant and dulled. Then the soft burble and rush of exhaled bubbles rising and popping. No music, no dialogue, no narration.",
"resolution": "1080p",
"ratio": "adaptive",
"duration": 5,
"audio": true,
"watermark": false
}'

返回数据

{
"id": "media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0",
"status": "queued"
}

请求正文

提示词字符串需要
文本提示(最多 20000 个字符)。
分辨率枚举
输出分辨率。
比例枚举
输出宽高比; “自适应”让模型进行选择。
持续时间枚举默认: 5
输出长度以秒为单位 (2-30),或“自动”表示智能持续时间。
音频布尔值默认: true
是否生成音频。
种子整数0 – 2147483647
确定性种子。
水印布尔值默认: false
还返回带水印的结果。

接受的值

分辨率
比例

返回

返回一个 工作对象 状态 ,不是最终输出。存储响应中的 ID 并轮询作业直至完成。

民意调查状态

获取/v1/media/jobs/{request_id}

请求

curl https://api.dev.pika.art/v1/media/jobs/{request_id} \
-H "X-API-Key: YOUR_API_KEY"

返回数据

{
"id": "media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0",
"status": "running"
}

按 ID 轮询作业,直到达到最终状态:已完成或失败。已完成的作业在输出中携带其下载 URL,并且 GET /v1/media/jobs/{request_id}/content 返回与 { "url" } 对于只保留 ID 的客户端。

DELETE /v1/media/jobs/{request_id} 删除作业的存储介质以及提交时捕获的请求(提示和参数)。然后作业报告 deleted_at 并且没有输出,内容端点回答410。

作业对象

id字符串
作业的唯一标识符。
状态枚举
作业的状态。其中之一:
对象
生成输出。工作完成后立即出现。
错误字符串
如果作业失败,则失败的原因。
deleted_atnumber
当您删除作业的存储媒体时,以纪元秒为单位。在此之前为空,一旦设置后输出为空。
用法对象
提供者为作业报告的单位,例如 video_output_tokens 或 image_output_tokens。一旦作业终止就存在,仅携带作业报告的单位,并且当没有报告任何内容时为空。
对象
工作收费。工作结束后在场;提交响应和 webhooks 上为 null。

错误

在通话中共享

错误使用传统的 HTTP 状态代码以及形状的 JSON 主体 {"message": "..."}. 参数校验失败时返回 422 并带有一条命名有问题字段的消息。作业行存在后提交拒绝(余额、速率限制)返回失败的作业信封 — 分支 error.code.

状态当身体
401 未经授权API 密钥丢失或无效。{"message":"Invalid API key"}
403 禁止非活动密钥被拒绝 {"message"} 身体。作业行存在并返回失败的作业信封后,组织余额或后付费周期限制无法覆盖的提交将被拒绝。 GET /billing/balance 将两者分开: 200 表示密钥处于活动状态,因此拒绝的是余额或循环限制。{"id":"media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0","status":"failed","error":{"code":"insufficient_balance","message":"Insufficient org balance"}}
404 未找到您的组织中不存在具有该 ID 的作业,或者媒体路径名称未知的供应商/型号/功能。{"message":"media job not found"}
409冲突在作业完成之前请求结果,或者将 Idempotency-Key 标头与不同的正文重用。{"message":"media job is not ready"}
422 无法处理的实体请求正文验证失败:枚举值无效、缺少必填字段、类型错误或 JSON 格式错误。 JSON 消息命名有问题的字段。无法定价的架构有效参数组合在创建作业后失败,并返回失败的作业信封和错误代码 invalid_input.{"message":"duration: Input should be less than or equal to 15"}
429 请求太多您已达到每分钟或每天的请求限制,或者您组织的作业队列已满。作为失败的作业信封返回。如果存在 Retry-After 标头,请等待那么长时间,然后使用新的 Idempotency-Key 重试。{"id":"media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0","status":"failed","error":{"code":"rate_limited","message":"rate limit exceeded: rpm"}}
503服务不可用模型导轨或后端依赖项暂时不可用。作为失败的作业信封退回;使用退避和新的幂等密钥重试。{"id":"media_8f3a2c91-5b7d-4e0a-9c26-31d4f2a8e6b0","status":"failed","error":{"code":"provider_unavailable","message":"media dispatch unavailable"}}