Authorizationstring · headerrequired所有接口都要求 Authorization: Bearer $VIDRUSH_API_KEY。密钥在「设置 → API Keys」中创建和吊销,并共用账户的积分余额。
Open API v1 · Vidrush V1
Vidrush Open API 是一个异步生成网关:创建请求立即返回任务,网站与 API 共用同一份积分账本,所有公开视频模型——Vidrush V1、Seedance 2.0、Veo 3.1、Kling 2.6、MiniMax H3 等——都使用同一种请求结构。图片、音乐、语音和音效走同样的任务生命周期。
任何已登录用户都可以在「设置 → API Keys」创建 sk_ 密钥。密钥只显示一次,请保存在你的服务器端。
设置环境变量
所有请求都发往基础地址,并以 Bearer token 形式携带密钥。
export VIDRUSH_BASE_URL=https://vidrush-ai.com/api/v1
export VIDRUSH_API_KEY=sk-xxx报价(可选,免费)
把与创建完全相同的请求体 POST 到 /videos/quote,读取 data.costCredits。报价与创建使用同一套计费公式。
创建任务
POST /videos。成功返回 200 与任务对象;data.id 是任务句柄,data.costCredits 是实际扣除的积分。
轮询任务
每 5 秒 GET /tasks/{id},直到 status 变为 success、failed 或 canceled。成功后播放 data.taskUrls 中的地址。
让 Vidrush 留在你的后端。用户只与你的产品交互;由你的服务持有 API Key 并同步任务状态。
产品界面
收集提示词、模型和素材。
你的后端
校验用户、落库记录,然后调用 Vidrush。
Vidrush API
扣除积分并返回任务 id。
结果页
读取你的任务状态并播放视频。
Authorizationstring · headerrequired所有接口都要求 Authorization: Bearer $VIDRUSH_API_KEY。密钥在「设置 → API Keys」中创建和吊销,并共用账户的积分余额。
Content-Typestring · headerrequired所有 POST 请求使用 application/json。请求体是普通 JSON 对象;URL 数组必须是公网可访问的 HTTPS 地址。
所有响应都是 {"code", "message", "data"}。code 为 0 表示成功,data 携带数据;非 0 的 code 加上 HTTP 错误状态表示请求未被接受。请根据 HTTP 状态与 code 分支处理,不要依赖 message 文本。
{
"code": 0,
"message": "ok",
"data": {
"remainingCredits": 1240
}
}/api/v1/modelsendpoint返回当前可用的公开模型:每种模式支持的时长、分辨率、画幅、音频开关和积分价格。这是实时的数据来源;下表由同一份目录渲染。
?type=video|image|music — type 选择目录:video(默认)、image 或 music。响应可缓存一小时。
21 个公开视频模型
| 模型 ID | 厂商 | 模式 | 时长 | 分辨率 | 积分 |
|---|---|---|---|---|---|
| p-video | Pruna AI | text-to-videoimage-to-video | 1s – 20s | 720p · 1080p | 4-160 credits |
| seedance-2-0 | ByteDance | text-to-videoimage-to-videoframes-to-videoreference-to-video | 4s – 15s | 480p · 720p · 1080p · 4k | 60-3270 credits |
| seedance-2-0-fast | ByteDance | text-to-videoimage-to-videoframes-to-videoreference-to-video | 4s – 15s | 480p · 720p | 42-420 credits |
| seedance-2-mini | ByteDance | text-to-videoimage-to-videoframes-to-videoreference-to-video | 4s – 15s | 480p · 720p | 16-150 credits |
| seedance-1-5-pro | ByteDance | text-to-videoimage-to-video | 4s – 12s | 480p · 720p · 1080p | 7-60 credits |
| grok-imagine | Grok | text-to-videoimage-to-video | 6s – 30s | 480p · 720p | 10-90 credits |
| grok-imagine-1-5 | Grok | text-to-videoimage-to-video | 6s – 30s | 480p · 720p | 18-90 credits |
| kling-2-6 | Kling | text-to-videoimage-to-video | 5s – 10s | — | 55-220 credits |
| runway | Runway | text-to-videoimage-to-video | 5s – 10s | 720p · 1080p | 12-30 credits |
| veo-3-1 | text-to-videoimage-to-videoframes-to-videoreference-to-video | — | 720p · 1080p · 4k | 225-285 credits | |
| veo-3-1-fast | text-to-videoimage-to-videoframes-to-videoreference-to-video | — | 720p · 1080p · 4k | 30-100 credits | |
| veo-3-1-lite | text-to-videoimage-to-videoframes-to-videoreference-to-video | — | 720p · 1080p · 4k | 15-75 credits | |
| gemini-omni-cheap | text-to-videoimage-to-videovideo-to-video | 10s | 720p | 35 credits | |
| gemini-omni | text-to-videoimage-to-videovideo-to-video | 10s | 720p · 1080p | 50 credits | |
| gemini-omni-video | text-to-videoimage-to-videovideo-to-video | 4s – 10s | 720p · 1080p · 4k | 45-180 credits | |
| flux-3 | Black Forest Labs | text-to-videoimage-to-videovideo-to-videoframes-to-video | 5s – 20s | — | 80-320 credits |
| minimax-h3 | MiniMax | text-to-videoimage-to-videoreference-to-video | 4s – 15s | 768P · 2K | 72-435 credits |
| seedence-1-0-pro | ByteDance | text-to-videoimage-to-video | 5s – 10s | 480p · 720p · 1080p | 14-42 credits |
| seedence-1-0-pro-fast | ByteDance | image-to-video | 5s – 10s | 720p · 1080p | 16+ credits |
| seedence-1-0-lite | ByteDance | text-to-videoimage-to-video | 5s – 10s | 480p · 720p · 1080p | 10-40 credits |
| vidrush-v1 | VidRush | text-to-videoimage-to-videoframes-to-videoreference-to-video | 1s – 15s | 480p · 768P | 1-15 credits |
{
"code": 0,
"message": "ok",
"data": {
"models": [
{
"id": "vidrush-v1",
"label": "Vidrush V1",
"vendor": "VidRush",
"modes": {
"text-to-video": {
"durations": [
"1s",
"2s",
"3s",
"4s",
"5s",
"6s",
"7s",
"8s",
"9s",
"10s",
"11s",
"12s",
"13s",
"14s",
"15s"
],
"resolutions": [
"480p",
"768P"
],
"aspect_ratios": [
"16:9",
"9:16"
],
"audio_toggle": false,
"credits_per_second": {
"480p": 1,
"768P": 1
}
},
"image-to-video": {
"durations": [
"1s",
"2s",
"3s",
"4s",
"5s",
"6s",
"7s",
"8s",
"9s",
"10s",
"11s",
"12s",
"13s",
"14s",
"15s"
],
"resolutions": [
"480p",
"768P"
],
"aspect_ratios": [
"16:9",
"9:16"
],
"audio_toggle": false,
"credits_per_second": {
"480p": 1,
"768P": 1
}
},
"frames-to-video": {
"durations": [
"1s",
"2s",
"3s",
"4s",
"5s",
"6s",
"7s",
"8s",
"9s",
"10s",
"11s",
"12s",
"13s",
"14s",
"15s"
],
"resolutions": [
"480p",
"768P"
],
"aspect_ratios": [
"16:9",
"9:16"
],
"audio_toggle": false,
"credits_per_second": {
"480p": 1,
"768P": 1
}
},
"reference-to-video": {
"durations": [
"1s",
"2s",
"3s",
"4s",
"5s",
"6s",
"7s",
"8s",
"9s",
"10s",
"11s",
"12s",
"13s",
"14s",
"15s"
],
"resolutions": [
"480p",
"768P"
],
"aspect_ratios": [
"16:9",
"9:16"
],
"audio_toggle": false,
"credits_per_second": {
"480p": 1,
"768P": 1
}
}
},
"credits_label": "1-15 credits"
},
"…"
]
}
}/api/v1/videos/quoteendpoint使用与创建完全相同的请求体。不会创建任何任务、不会移动积分;返回创建时将会扣除的 model、mode 和 costCredits。
{
"code": 0,
"message": "ok",
"data": {
"model": "vidrush-v1",
"mode": "text-to-video",
"costCredits": 5
}
}先报价再决定用户能否提交——配合 GET /credits 做余额检查。
/api/v1/videosendpoint创建一个异步视频任务,预先扣除 costCredits,并返回任务对象。用右侧的监视面板切换模型、模式和语言。
modelstringrequired来自 GET /models 的当前模型 ID。请使用上表中的公开 ID,不要发送上游别名。
promptstringrequired非空的视频指令。描述主体、动作、镜头和风格;模型会原样接收。
modeenumtext-to-video、image-to-video、frames-to-video、reference-to-video 或 video-to-video,且必须被模型支持。默认 text-to-video;带 image_urls 时默认 image-to-video。
image_urlsstring[]公网 HTTPS 图片地址。image-to-video 需要一张,frames-to-video 需要首尾两张,reference-to-video 最多到模型的参考位数量。
video_urlsstring[]video-to-video 模型使用的公网 HTTPS 视频地址。按秒计价的模型需同时传 options.source_video_duration_seconds。
optionsobject模型相关的控制项。只发送所选模型与模式在 GET /models 中声明的取值。
| field | type | description |
|---|---|---|
| duration | string | 支持的时长,例如 "5s" 或 "10s"。 |
| resolution | string | 支持的分辨率,例如 "720p"、"768P" 或 "1080p"。 |
| aspect_ratio | string | 支持的画幅,例如 "16:9"、"9:16" 或 "Auto"。 |
| audio | boolean | 仅当模型/模式声明 audio_toggle: true 时有效。 |
| source_video_duration_seconds | number | 按秒计价的模型在使用 video_urls 时必填。 |
{
"code": 0,
"message": "ok",
"data": {
"id": "task_01JQ9X2B6XK9K4VQY2QZ4H6W3R",
"userId": "user_1",
"mediaType": "video",
"model": "vidrush-v1",
"scene": "text-to-video",
"status": "pending",
"costCredits": 5,
"taskId": null,
"taskUrls": [],
"createdAt": "2026-09-07T12:00:00.000Z",
"updatedAt": "2026-09-07T12:00:00.000Z"
}
}任务记录在返回前会被脱敏:供应商名称、内部提示词与请求指纹永远不会暴露。
/api/v1/tasks/{taskId}endpoint轮询直到 status 为 success、failed 或 canceled。返回的是与创建时相同的脱敏任务对象;任务仍在进行时会从供应商刷新。
| status | |
|---|---|
| pending | 已接受并排队。继续轮询。 |
| processing | 供应商正在生成。继续轮询。 |
| success | 完成。播放或下载 data.taskUrls 中的地址。 |
| failed | 生成失败。积分已自动退回。 |
| canceled | 供应商取消了任务。积分已自动退回。 |
{
"code": 0,
"message": "ok",
"data": {
"id": "task_01JQ9X2B6XK9K4VQY2QZ4H6W3R",
"userId": "user_1",
"mediaType": "video",
"model": "vidrush-v1",
"scene": "text-to-video",
"status": "success",
"costCredits": 5,
"taskId": "prov_8f1c",
"taskUrls": [
"https://r2.vibevideo.app/vidrush/videos/task_01JQ9X2B.mp4"
],
"createdAt": "2026-09-07T12:00:00.000Z",
"updatedAt": "2026-09-07T12:02:41.000Z"
}
}每 5 秒轮询一次。结果地址是平台地址而非上游临时链接,可以放心保存。
/api/v1/tasksendpoint你自己的任务,按创建时间倒序,结构与 GET /tasks/{id} 相同。
statusenumpending、processing、success、failed 或 canceled。
media_typeenumvideo、image、music、audio 或 speech。
pageinteger从 1 开始的页码,默认 1。
limitinteger1–100,默认 20。data.has_more 表示是否还有下一页。
{
"code": 0,
"message": "ok",
"data": {
"tasks": [
{
"id": "task_01JQ9X2B…",
"status": "success",
"mediaType": "video"
},
{
"id": "task_01JQ9WZ4…",
"status": "processing",
"mediaType": "image"
}
],
"page": 1,
"limit": 20,
"has_more": false
}
}/api/v1/imagesendpoint文生图与图生图共用同一套任务生命周期。用 GET /models?type=image 查看模型。
modelstringrequired当前图片模型 ID,例如 nano-banana-2。
promptstringrequired非空的图片指令。
sceneenumtext-to-image 或 image-to-image。带 image_urls 时默认 image-to-image。
image_urlsstring[]公网 HTTPS 图片地址;图生图必填。
optionsobject模型声明的 aspect_ratio(如 "1:1"、"16:9")与 quality("1K"、"2K"、"4K")。
{
"model": "nano-banana-2",
"prompt": "Editorial product shot of a ceramic mug on linen, soft window light",
"options": {
"aspect_ratio": "1:1",
"quality": "2K"
}
}/api/v1/musicendpoint根据提示词生成原创音轨。目前开放一个模型;GET /models?type=music 列出其控制项。
promptstringrequired音轨描述——情绪、风格、乐器、节奏。
options.duration_secondsnumber目标时长,3–300 秒。
options.instrumentalbooleantrue 表示纯音乐无人声。
options.style / options.lyricsstring可选的风格提示与歌词。
文字转语音使用 ElevenLabs 音色库;音效接受一段提示词。两者都返回任务,音频地址在 taskUrls 中。
/api/v1/speechendpointtextstringrequired要朗读的非空文本。
voice_idstringrequired来自 GET /voices 的音色 id。
optionsobjectmodel_id、speed(0.25–4)、stability(0–1)、similarity_boost(0–1)。
/api/v1/sound-effectsendpointpromptstringrequired声音描述。
optionsobjectduration_seconds(0.5–22)、prompt_influence(0–1)。
/api/v1/voicesendpointGET /voices 返回公开音色库,包含 id、名称、语言和试听地址。读取音色库无需鉴权。
/api/v1/creditsendpoint返回该密钥所属账户的 data.remainingCredits。先报价,再与余额比较,然后决定是否允许用户提交。
同一账户在网站和 API 中使用相同价格。任务被接受时扣除积分,无法交付时退回。
| 阶段 | 行为 |
|---|---|
| quote | 不扣费;返回 costCredits。 |
| create | 扣除 costCredits 并返回任务。 |
| success | 扣费生效;结果地址归你保存。 |
| failed / canceled | costCredits 自动退回余额。 |
根据 HTTP 状态与稳定的 code 字段分支处理。500 可以安全重试。
| HTTP | code | 含义 |
|---|---|---|
| 400 | -1 | 请求体格式错误、未知模型、不支持的模式或选项——message 会说明具体原因。 |
| 401 | -1001 | 缺少、无效或已吊销的 API Key。 |
| 402 | -1002 | 积分不足以支付 costCredits。请充值或选择更便宜的配置。 |
| 404 | -1 | 任务不存在或属于其他账户。 |
| 500 | -1 | 供应商或内部错误;对外 message 是通用文案。请重试。 |