Api
API 错误
Vidrush v1 响应码、HTTP 状态码和常见请求修复方式。
错误码
code | HTTP 状态码 | 含义 | 修复方式 |
|---|---|---|---|
0 | 200 | 成功 | 读取 data |
-1 | 400、404 或 500 | 请求无效、任务不可访问、内容审核拦截或服务端错误 | 阅读 message 并结合 HTTP 状态码处理 |
-1001 | 401 | 未认证 | 发送有效的 Authorization: Bearer sk-... 请求头 |
-1002 | 402 | 积分不足 | 不要重试该任务;补充积分后再创建 |
常见 400 响应
| 示例 message | 原因 | 修复方式 |
|---|---|---|
model is required | model 缺失或为空 | 发送 GET /api/v1/models 中的模型 ID |
prompt is required | prompt 缺失或为空 | 发送非空提示词 |
| `mode must be one of text-to-video | image-to-video | video-to-video |
image_urls must be an array of URLs | image_urls 不是字符串数组 | 发送公开 HTTP(S) URL 数组 |
video_urls must be an array of URLs | video_urls 不是字符串数组 | 发送公开 HTTP(S) URL 数组 |
options must be an object | options 不是对象 | 将生成控制项放入对象 |
| `sora-2 text-to-video supports duration 4s | 8s | 12s, got 30s` |
... requires image_urls | 模式需要图片 | 补充所需的公开图片 URL |
... requires image_urls and video_urls | Motion Control 同时需要两种输入 | 补充两个输入数组 |
... requires options.source_video_duration_seconds when video_urls is provided | 按秒计费模型收到视频输入但缺少源时长 | 在 options 中发送正数秒数 |
出现 unsupported video model 或不支持的模式/选项组合时,应刷新 GET /api/v1/models,而不是原样重试请求。