| 项目 | 内容 |
|---|---|
| Base URL | https://llm.ai-nebula.com |
| 认证方式 | API Key (Token) |
| 请求头 | Authorization: Bearer sk-xxxx |
| Content-Type | application/json |
| 任务模式 | 异步任务(提交任务 → 轮询状态 → 下载结果) |
sora-2 - Sora 2 标准版POST /v1/video/generationsAuthorization: Bearer sk-xxxx
Content-Type: application/json| 参数名 | 类型 | 必填 | 说明 | 示例值 |
|---|---|---|---|---|
model | string | 是 | 模型名称 | "sora-2" |
prompt | string | 是 | 视频生成提示词 | "一只可爱的小猫在花园里玩耍" |
seconds | string/int | 否 | 视频时长(秒),支持:4、8、12,默认:4 | "4" 或 8 |
size | string | 否 | 视频分辨率,支持:"720x1280"(竖屏)或 "1280x720"(横屏),注意:只能传尺寸刚好的图片 | "720x1280" |
width | int | 否 | 视频宽度(与 height 一起使用,会自动转换为 size) | 720 |
height | int | 否 | 视频高度(与 width 一起使用,会自动转换为 size) | 1280 |
input_reference | string | 否 | 参考图片(支持 URL 或 base64 格式) | "https://example.com/image.jpg" 或 "data:image/jpeg;base64,..." |
remix_from_video_id | string | 否 | Remix 模式:基于已有视频ID进行重新生成(必须以 video_ 开头) | "video_12345" |
user | string | 否 | 用户标识 | "user-1234" |
{
"format": "mp4",
"metadata": {
"completed_at": null,
"created_at": 1762220876,
"error": null,
"expires_at": null,
"id": "video_69095b4ce0048190893a01510c0c98b0",
"model": "sora-2",
"object": "video",
"progress": 0,
"remixed_from_video_id": null,
"seconds": "4",
"size": "1280x720",
"status": "queued"
},
"status": "submitted",
"task_id": "video_69095b4ce0048190893a01510c0c98b0"
}
| 字段名 | 类型 | 说明 |
|---|---|---|
task_id | string | 任务ID,用于后续查询任务状态和下载视频 |
status | string | 任务状态,初始值为 "submitted" |
GET /v1/video/generations/{task_id}Authorization: Bearer sk-xxxx| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
task_id | string | 是 | 任务ID(从提交任务的响应中获取) |
{
"task_id": "video_1234567890abcdef",
"id": "video_1234567890abcdef",
"object": "video_generation",
"model": "sora-2",
"status": "queued",
"progress": 0,
"created_at": 1704067200,
"prompt": "一只可爱的小猫在花园里玩耍,阳光明媚,画面温馨",
"seconds": "4",
"size": "720x1280"
}{
"task_id": "video_1234567890abcdef",
"id": "video_1234567890abcdef",
"object": "video_generation",
"model": "sora-2",
"status": "in_progress",
"progress": 50,
"created_at": 1704067200,
"prompt": "一只可爱的小猫在花园里玩耍,阳光明媚,画面温馨",
"seconds": "4",
"size": "720x1280"
}{
"task_id": "video_1234567890abcdef",
"id": "video_1234567890abcdef",
"object": "video_generation",
"model": "sora-2",
"status": "succeeded",
"progress": 100,
"created_at": 1704067200,
"completed_at": 1704067800,
"prompt": "一只可爱的小猫在花园里玩耍,阳光明媚,画面温馨",
"seconds": "4",
"size": "720x1280",
"width": 720,
"height": 1280,
"n_seconds": 4
}{
"task_id": "video_1234567890abcdef",
"id": "video_1234567890abcdef",
"object": "video_generation",
"model": "sora-2",
"status": "failed",
"progress": 100,
"created_at": 1704067200,
"failure_reason": "提示词包含不当内容",
"error": {
"message": "提示词包含不当内容",
"code": "content_policy_violation"
}
}| 状态值 | 说明 | 进度 |
|---|---|---|
queued | 任务已排队,等待处理 | 0-20% |
in_progress | 任务正在处理中 | 20-99% |
succeeded | 任务成功完成 | 100% |
failed | 任务失败 | 100% |
queued 或 in_progress 时,需要定期轮询(建议每 3-5 秒查询一次)succeeded 时,可以使用任务ID下载视频failed 时,可以查看 failure_reason 或 error 字段了解失败原因GET /v1/video/generations/download?id={task_id}Authorization: Bearer sk-xxxx| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 是 | 任务ID(必须是已完成的任务) |
{
"success": true,
"generation_id": "video_1234567890abcdef",
"task_id": "video_1234567890abcdef",
"format": "mp4",
"size": 15728640,
"base64": "AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAB...",
}| 字段名 | 类型 | 说明 |
|---|---|---|
success | boolean | 是否成功 |
generation_id | string | 生成ID(与 task_id 相同) |
task_id | string | 任务ID |
format | string | 视频格式(固定为 "mp4") |
size | number | 视频文件大小(字节) |
base64 | string | Base64 编码的视频数据 |
| 值 | 说明 |
|---|---|
"4" | 4秒视频(默认值) |
"8" | 8秒视频 |
"12" | 12秒视频 |
"4"。| 值 | 说明 | 宽高比 |
|---|---|---|
"720x1280" | 竖屏(默认值) | 9:16 |
"1280x720" | 横屏 | 16:9 |
width 和 height 参数,系统会自动转换为 size 参数width 和 height 不匹配上述分辨率,会自动修正为默认值 "720x1280""https://example.com/image.jpg""data:image/jpeg;base64,/9j/4AAQSkZJRg..."task_idvideo_ 开头prompt 参数,其他参数会被忽略| HTTP状态码 | 错误信息 | 说明 |
|---|---|---|
| 400 | invalid_request_error | 请求参数错误 |
| 401 | authentication_error | API Key 无效或未提供 |
| 403 | permission_denied | 无权限访问 |
| 404 | not_found | 任务不存在 |
| 429 | rate_limit_error | 请求频率过高 |
| 500 | server_error | 服务器内部错误 |
{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}