Operations
创建视频生成任务
const url = 'https://visioncoder.cn/v1/contents/generations/tasks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"model":"seedance-1-5-pro","content":[{"type":"text","text":"一艘帆船驶过晨雾中的湖面,电影感运镜","image_url":{"url":"https://example.com/reference.png"},"video_url":{"url":"https://example.com/reference.png"},"audio_url":{"url":"https://example.com/reference.png"},"role":"reference_image"}],"generate_audio":false,"ratio":"16:9","size":"1280x720","resolution":"480p","seed":1,"duration":5,"watermark":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://visioncoder.cn/v1/contents/generations/tasks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedance-1-5-pro", "content": [ { "type": "text", "text": "一艘帆船驶过晨雾中的湖面,电影感运镜", "image_url": { "url": "https://example.com/reference.png" }, "video_url": { "url": "https://example.com/reference.png" }, "audio_url": { "url": "https://example.com/reference.png" }, "role": "reference_image" } ], "generate_audio": false, "ratio": "16:9", "size": "1280x720", "resolution": "480p", "seed": 1, "duration": 5, "watermark": false }'提交 Ark Seedance 兼容的视频生成任务。任务异步执行,创建成功后返回任务 ID。
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Ark Seedance 兼容的视频生成请求。
object
视频生成模型 ID。可调用 GET /v1/models 获取当前可用模型。
Example
seedance-1-5-pro多模态内容数组。至少传入一项。
object
内容类型。
Example
text提示词。type 为 text 时使用。
Example
一艘帆船驶过晨雾中的湖面,电影感运镜object
参考媒体地址。
Example
https://example.com/reference.pngobject
参考媒体地址。
Example
https://example.com/reference.pngobject
参考媒体地址。
Example
https://example.com/reference.png参考媒体的角色。
是否生成音频。
Example
false输出视频的宽高比,如 16:9、9:16、1:1,可选值随模型不同。显式传入时优先于 size 换算出的比例。
Example
16:9像素尺寸“宽x高”,如 1280x720。会换算成比例和分辨率档位,短边不小于 720 归 720p 并按高清每秒价计价;显式传入的 ratio / resolution 优先。
Example
1280x720分辨率档位,不区分大小写。不传按 480p 计价;480p 按标准每秒价,720p 及以上按高清每秒价。
Example
720p随机种子。不传或 -1 为随机;同种子加同参数可复现。
输出视频时长,单位为秒,视频按秒计价。不传或 -1 使用模型默认时长;模型没有默认时长时返回 400121。
Example
5是否添加水印。
Example
falseResponses
Section titled “Responses”任务创建成功。使用返回的 id 查询任务状态。
object
任务 ID。
执行任务的模型 ID。
任务状态。
出片进度百分比。上游没报进度时为 0,0 表示未知而不是没开始;succeeded 时为 100。
计费秒数:完成时为实际扣费秒数,未完成时为请求时长。
object
成品视频的短时签名地址,每次查询都会重新签发,过期后重新查询任务即可。只在 succeeded 时出现。
失败类别,status 为 failed 时返回:upstream_error、client_error、rate_limited、timeout、credential、no_endpoint、storage、internal,不透出上游原话。
任务创建时间,Unix 秒。
任务更新时间,Unix 秒。
Example
{ "id": "task_01JVIDEO9Q2W7X4K8", "model": "seedance-1-5-pro", "status": "queued", "progress": 0, "seconds": 5, "content": { "video_url": "https://cdn.visioncoder.cn/videos/task_01JVIDEO/result.mp4" }, "created_at": 1783742400, "updated_at": 1783742400}请求参数或模型无效。
API Key 缺失或无效。
当前账户或 API Key 无权执行请求。
请求频率超过限制。
服务或上游处理失败。
