API
CLUB

Seedance 2.5

从你提供的画面开始,一次生成完整的 30 秒场景。

bytedance/seedance-2.5/image-to-video

能力

最适合

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

不适合

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

身份验证

API 密钥标头

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

标题
X-API-Key: YOUR_API_KEY

端点

异步·轮询结果

发布https://api.dev.pika.art/v1/media/bytedance/seedance-2.5/image-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}删除存储的媒体并提示

参考上传

媒体输入

媒体输入接受任何公共 URL。要使用本地文件,请将其 content_type 和 size_bytes 发布到 /v1/media/uploads,将文件放入返回的 upload_url,然后传递 url.

上传
# 1. Request a presigned upload URL. Send the file's content
# type and its exact size in bytes.
curl -X POST https://api.dev.pika.art/v1/media/uploads \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content_type": "image/png", "size_bytes": 12345}'
# The response returns two URLs:
# upload_url: a temporary URL to upload the file to. Expires in 5 minutes.
# url: the permanent Uika URL. Pass it to the model as the input.
# {
# "upload_url": "https://upload.r2.pika.art/...?X-Amz-Signature=...",
# "url": "https://cdn.pika.art/v2/media/uploads/org_abc/9f8e7d.png"
# }
# 2. Upload the file to upload_url, then pass url to the model.
curl -X PUT "<upload_url>" \
-H "Content-Type: image/png" \
--data-binary @input.png

生成

POST /v1/media/bytedance/seedance-2.5/image-to-video

请求

curl -X POST https://api.dev.pika.art/v1/media/bytedance/seedance-2.5/image-to-video \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"draft": false,
"prompt": "Cinematic fashion editorial, a narrow vintage elevator lined in deep oxblood mahogany panelling with a brass button plate, a woman in a liquid gold silk slip dress standing perfectly centred, an ocean of cream silk pooled across the floor and spilling out toward camera. Rich low-contrast grade, warm practical light inside the car, soft falloff into the dark wood, fine 35mm grain. Shot 1 — Locked symmetrical wide, matching the frame exactly. She holds still, then slowly raises her right arm and reaches toward the brass button plate on the wall beside her, the silk shifting faintly around her feet as she moves. Camera creeps forward a few inches as her finger nears the panel. Shot 2 — Hard cut to an extreme macro close-up of her hand at the brass plate, shallow focus. Her fingertip presses a worn button; it depresses and lights up warm amber, the glow reflecting in the polished brass and on her skin. A soft mechanical click. Camera drifts a fraction, rack focusing from the lit button to her knuckles. Shot 3 — Hard cut to a high overhead angle looking straight down at her from the elevator ceiling, the gold dress a single stroke of colour in a sea of cream silk. Camera orbits slowly above her as the car rises, the overhead light pulsing as floors pass, warm then dark then warm. She tilts her face up toward the lens. Shot 4 — Hard cut to a low wide from outside as the brass doors slide open and she steps forward out of the car, wading through the cream silk, the whole mass of it dragging with her across the threshold in a slow heavy wave. Camera retreats ahead of her, holding her centred, until she fills the frame and walks past the lens. Audio: deep elevator motor hum, cable creak, a soft button click and amber-lit chime, the dry whisper of silk sliding on wood, doors clunking open, bare feet on polished floor.",
"duration": 10,
"resolution": "720p",
"generate_audio": true,
"watermark": false,
"image_url": "https://cdn.pika.art/v2/files/agent/b9ea9264-867b-4db3-ad83-9ee371093a8a/seedance-2.5-i2v-elevator-silk-input.jpg",
"ratio": "adaptive"
}'

返回数据

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

请求正文

草稿布尔值默认: false
渲染 480p 草稿预览。通过‘bytedance/seedance-2.5/draft-to-video’可以在7天内完成1080p的草稿,并按自己的工作收费。
提示词字符串需要
描述你想生成的视频。
持续时间枚举需要
视频长度以秒为单位 (4-30),或“自动”以让模型选择。
分辨率枚举
输出分辨率(2.5 为 480p/720p/1080p)。
generate_audio布尔值默认: true
是否为视频生成音频。
水印布尔值默认: false
是否为输出视频添加水印。
output_formatenum
输出容器格式。
bitrate_modeenum
输出码率。high 会生成码率更高、体积更大的文件,默认为 standard。
image_urlstringrequired
用作动画首帧的图片链接。
end_image_urlstring
可选的尾帧图片链接。
比例字符串已修复: 自适应
输出画面比例。

接受的值

分辨率
output_format
bitrate_mode

输入模式

图片链接image_url

可直接使用公开链接。若文件在本地,先向 /v1/media/uploads 提交 { content_type, size_bytes },再带上返回的请求头,使用 PUT 将图片上传至 upload_url,最后使用返回的 url。

尾帧图片链接end_image_url

可直接使用公开链接。若文件在本地,先向 /v1/media/uploads 提交 { content_type, size_bytes },再带上返回的请求头,使用 PUT 将图片上传至 upload_url,最后使用返回的 url。

返回

返回一个 工作对象 状态 ,不是最终输出。存储响应中的 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"}}