# Seedance 2.5 > Seedance 2.5,ByteDance 的视频生成模型。 - **模型 ID**: `bytedance/seedance-2.5` - **厂商**: ByteDance - **类型**: video - **状态**: live - **超时上限**: 3600 s - **统一格式**: 支持 - **接口**: `POST https://api.kerox.ai/v1/tasks` - **模型页**: https://kerox.ai/models/bytedance/seedance-2.5 ## 价格 **按 token 计费**。下表的约每秒价按 16:9 折算,720p 不带参考视频约 $0.2196 / 秒。 | 分辨率 | 不带参考视频(约每秒) | 带参考视频(约每秒) | 官方价 / 百万 token | Kerox / 百万 token | 带参考视频:官方价 / 百万 token | 带参考视频:Kerox / 百万 token | | --- | --- | --- | --- | --- | --- | --- | | 480p | $0.0977 | $0.0584 | $10.7000 | $10.1650 | $6.4000 | $6.0800 | | 720p | $0.2196 | $0.1313 | $10.7000 | $10.1650 | $6.4000 | $6.0800 | | 1080p | $0.5402 | $0.3232 | $11.7000 | $11.1150 | $7.0000 | $6.6500 | - **计算公式**:`token =(输出秒数 + 参考视频秒数)× 宽 × 高 × 24 / 1024`。带参考视频时,较低的单价按「输出秒数 + 参考视频秒数」的合计时长计。 - **画面比例与声音**:约每秒价按 16:9、不带参考视频折算;同一分辨率下其他画面比例的差异在 5% 以内,开不开声音不影响价格。 - **提交前预估**:用 `POST /v1/estimate` 或在 Studio 里查看这次参数的预估费用。 ## 请求示例 用原厂参数提交任务。 ### cURL ```bash curl -X POST https://api.kerox.ai/v1/tasks \ -H "Authorization: Bearer $KEROX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedance-2.5", "input": { "content": [ { "type": "text", "text": "a red fox running through fresh snow, cinematic lighting" } ], "resolution": "720p", "duration": 5 } }' ``` ### Python ```python import os import requests resp = requests.post( "https://api.kerox.ai/v1/tasks", headers={ "Authorization": f"Bearer {os.environ['KEROX_API_KEY']}", "Content-Type": "application/json", }, json={ "model": "bytedance/seedance-2.5", "input": { "content": [ { "type": "text", "text": "a red fox running through fresh snow, cinematic lighting", }, ], "resolution": "720p", "duration": 5, }, }, timeout=60, ) resp.raise_for_status() task = resp.json() print(task["id"], task["status"], task["output"]) ``` ### Node.js ```javascript const res = await fetch('https://api.kerox.ai/v1/tasks', { method: 'POST', headers: { Authorization: `Bearer ${process.env.KEROX_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "model": "bytedance/seedance-2.5", "input": { "content": [ { "type": "text", "text": "a red fox running through fresh snow, cinematic lighting" } ], "resolution": "720p", "duration": 5 } }), }); const task = await res.json(); console.log(task.id, task.status, task.output); ``` ### Go ```go package main import ( "bytes" "fmt" "io" "net/http" "os" ) func main() { body := []byte(`{ "model": "bytedance/seedance-2.5", "input": { "content": [ { "type": "text", "text": "a red fox running through fresh snow, cinematic lighting" } ], "resolution": "720p", "duration": 5 } }`) req, _ := http.NewRequest("POST", "https://api.kerox.ai/v1/tasks", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer "+os.Getenv("KEROX_API_KEY")) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ## 参数(原厂格式) | 参数 | 类型 | 默认值 | 可选值 | 说明 | | --- | --- | --- | --- | --- | | `ratio` | string | `"adaptive"` | adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 | 画面比例 | | `content` | array | — | — | 输入内容 | | `duration` | integer | `5` | -1, 4–30 | 时长 | | `priority` | integer | — | 0–9 | 排队优先级 | | `watermark` | boolean | `false` | — | 水印 | | `resolution` | string | `"720p"` | 480p, 720p, 1080p | 分辨率 | | `service_tier` | string | `"default"` | default | 服务档位 | | `output_format` | string | `"mp4"` | mp4, mov | 封装格式 | | `generate_audio` | boolean | `true` | — | 生成声音 | | `return_last_frame` | boolean | `false` | — | 返回尾帧 | | `safety_identifier` | string | — | — | 终端用户标识 | | `omni_reference_task_type` | string | `"auto"` | auto, reference, edit, extend | 参考任务类型 | ## 参数(统一格式,`format: "unified"`) | 参数 | 类型 | 默认值 | 可选值 | 说明 | | --- | --- | --- | --- | --- | | `n` | integer | `1` | 1 | 生成数量 | | `audios` | string \| string[] | — | — | 参考音频 | | `images` | string \| string[] | — | — | 参考图 | | `prompt` | string | — | — | 提示词 | | `videos` | string \| string[] | — | — | 参考视频 | | `duration` | integer | `5` | -1, 4–30 | 时长 | | `last_frame` | string | — | — | 尾帧 | | `resolution` | string | `"720p"` | 480p, 720p, 1080p | 分辨率 | | `first_frame` | string | — | — | 首帧 | | `aspect_ratio` | string | `"adaptive"` | adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 | 画面比例 | | `priority` | integer | — | 0–9 | 排队优先级 | | `watermark` | boolean | `false` | — | 水印 | | `service_tier` | string | `"default"` | default | 服务档位 | | `output_format` | string | `"mp4"` | mp4, mov | 封装格式 | | `generate_audio` | boolean | `true` | — | 生成声音 | | `return_last_frame` | boolean | `false` | — | 返回尾帧 | | `safety_identifier` | string | — | — | 终端用户标识 | | `omni_reference_task_type` | string | `"auto"` | auto, reference, edit, extend | 参考任务类型 | ## 轮询与输出 轮询 `GET /v1/tasks/{id}`,或用 Webhook 接收完成通知。结果文件在 `expires_at` 之后过期(完成后 7 天),想留的请下载。任务对象的其余字段见任务指南和 API 参考。 ```bash curl https://api.kerox.ai/v1/tasks/task_01JD8X9B4Q2M7T8N3K5P6R1S0V \ -H "Authorization: Bearer $KEROX_API_KEY" ``` ```json { "id": "task_01JD8X9B4Q2M7T8N3K5P6R1S0V", "object": "task", "model": "bytedance/seedance-2.5", "status": "succeeded", "output": { "videos": [ { "url": "https://cdn.kerox.ai/t/task_01JD8X9B4Q2M7T8N3K5P6R1S0V/5f2b8c1e9d3a4f6b8a7c0d1e2f3a4b5c/0.mp4", "content_type": "video/mp4", "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "expires_at": "2026-11-27T08:01:10Z" } ``` ## 输入 schema(JSON) ```json { "type": "object", "allOf": [ { "if": { "required": [ "omni_reference_task_type" ], "properties": { "omni_reference_task_type": { "const": "edit" } } }, "then": { "required": [ "duration" ], "x-message": "duration must be -1 when omni_reference_task_type is edit.", "properties": { "ratio": { "const": "adaptive", "x-message": "ratio must be adaptive when omni_reference_task_type is edit." }, "content": { "contains": { "required": [ "type" ], "properties": { "type": { "const": "video_url" } } }, "x-message": "content must have exactly one reference video when omni_reference_task_type is edit.", "maxContains": 1, "minContains": 1 }, "duration": { "const": -1, "x-message": "duration must be -1 when omni_reference_task_type is edit." } } } }, { "if": { "required": [ "omni_reference_task_type" ], "properties": { "omni_reference_task_type": { "const": "extend" } } }, "then": { "properties": { "ratio": { "const": "adaptive", "x-message": "ratio must be adaptive when omni_reference_task_type is extend." }, "content": { "contains": { "required": [ "type" ], "properties": { "type": { "const": "video_url" } } }, "x-message": "content must have at least one reference video when omni_reference_task_type is extend.", "minContains": 1 } } } }, { "if": { "required": [ "content" ], "properties": { "content": { "contains": { "anyOf": [ { "not": { "required": [ "role" ], "properties": { "role": true } } }, { "required": [ "role" ], "properties": { "role": { "const": "first_frame" } } } ], "required": [ "type" ], "properties": { "type": { "const": "image_url" } } } } } }, "then": { "properties": { "ratio": { "const": "adaptive", "x-message": "ratio must be adaptive for first-frame image-to-video." } } } } ], "$schema": "https://json-schema.org/draft/2020-12/schema", "required": [ "content" ], "properties": { "ratio": { "enum": [ "adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16" ], "type": "string", "x-tier": "common", "default": "adaptive", "x-label-en": "Aspect ratio", "x-label-zh": "画面比例" }, "content": { "type": "array", "items": { "oneOf": [ { "type": "object", "title": "Text", "required": [ "type", "text" ], "properties": { "text": { "type": "string", "maxLength": 10000, "minLength": 1 }, "type": { "const": "text" } }, "additionalProperties": false }, { "type": "object", "title": "Image", "required": [ "type", "image_url" ], "properties": { "role": { "enum": [ "first_frame", "last_frame", "reference_image" ], "type": "string" }, "type": { "const": "image_url" }, "image_url": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "pattern": "^(https://|data:image/)" } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "title": "Video", "required": [ "type", "video_url", "role" ], "properties": { "role": { "const": "reference_video" }, "type": { "const": "video_url" }, "video_url": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "pattern": "^https://" } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "title": "Audio", "required": [ "type", "audio_url", "role" ], "properties": { "role": { "const": "reference_audio" }, "type": { "const": "audio_url" }, "audio_url": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "pattern": "^(https://|data:audio/)" } }, "additionalProperties": false } }, "additionalProperties": false } ] }, "x-tier": "common", "minItems": 1, "x-label-en": "Content", "x-label-zh": "输入内容", "x-constraints": { "max_text_items": 1, "audio_only_allowed": true, "max_reference_audios": 10, "max_reference_images": 30, "max_reference_videos": 10, "first_last_frame_exclusive_with_references": true } }, "duration": { "type": "integer", "anyOf": [ { "const": -1 }, { "maximum": 30, "minimum": 4 } ], "x-tier": "common", "default": 5, "x-label-en": "Duration", "x-label-zh": "时长" }, "priority": { "type": "integer", "x-tier": "advanced", "maximum": 9, "minimum": 0, "x-label-en": "Queue priority", "x-label-zh": "排队优先级" }, "watermark": { "type": "boolean", "x-tier": "advanced", "default": false, "x-label-en": "Watermark", "x-label-zh": "水印" }, "resolution": { "enum": [ "480p", "720p", "1080p" ], "type": "string", "x-tier": "common", "default": "720p", "x-label-en": "Resolution", "x-label-zh": "分辨率" }, "service_tier": { "enum": [ "default" ], "type": "string", "x-tier": "advanced", "default": "default", "x-label-en": "Service tier", "x-label-zh": "服务档位" }, "output_format": { "enum": [ "mp4", "mov" ], "type": "string", "x-tier": "advanced", "default": "mp4", "x-label-en": "Container", "x-label-zh": "封装格式" }, "generate_audio": { "type": "boolean", "x-tier": "common", "default": true, "x-label-en": "Generate audio", "x-label-zh": "生成声音" }, "return_last_frame": { "type": "boolean", "x-tier": "advanced", "default": false, "x-label-en": "Return last frame", "x-label-zh": "返回尾帧" }, "safety_identifier": { "type": "string", "x-tier": "advanced", "maxLength": 64, "x-label-en": "End-user ID", "x-label-zh": "终端用户标识" }, "omni_reference_task_type": { "enum": [ "auto", "reference", "edit", "extend" ], "type": "string", "x-tier": "advanced", "default": "auto", "x-label-en": "Reference task", "x-label-zh": "参考任务类型" } }, "additionalProperties": false } ```