切换主题
创建视频
OpenAI 兼容的视频生成接口。
参考文档: https://platform.openai.com/docs/api-reference/videos/create
创建视频
POST /v1/videos
OpenAI 兼容的视频生成接口。
参考文档: https://platform.openai.com/docs/api-reference/videos/create
认证
BearerAuth
请求体
必填:否
multipart/form-data
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| model | 否 | string | 模型/风格 ID Examples: kling-v1 |
| prompt | 否 | string | 文本描述提示词 Examples: 宇航员站起身走了 |
| image | 否 | string | 图片输入 (URL 或 Base64) Examples: https://example.com/image.jpg |
| duration | 否 | number | 视频时长(秒) Examples: 5 |
| width | 否 | integer | 视频宽度 Examples: 1280 |
| height | 否 | integer | 视频高度 Examples: 720 |
| fps | 否 | integer | 视频帧率 Examples: 30 |
| seed | 否 | integer | 随机种子 Examples: 20231234 |
| n | 否 | integer | 生成视频数量 Examples: 1 |
| response_format | 否 | string | 响应格式 Examples: url |
| user | 否 | string | 用户标识 Examples: user-1234 |
| metadata | 否 | object | 扩展参数 (如 negative_prompt, style, quality_level 等) |
原始 Schema
json
{
"type": "object",
"description": "视频生成请求",
"properties": {
"model": {
"type": "string",
"description": "模型/风格 ID",
"examples": [
"kling-v1"
]
},
"prompt": {
"type": "string",
"description": "文本描述提示词",
"examples": [
"宇航员站起身走了"
]
},
"image": {
"type": "string",
"description": "图片输入 (URL 或 Base64)",
"examples": [
"https://example.com/image.jpg"
]
},
"duration": {
"type": "number",
"description": "视频时长(秒)",
"examples": [
5
]
},
"width": {
"type": "integer",
"description": "视频宽度",
"examples": [
1280
]
},
"height": {
"type": "integer",
"description": "视频高度",
"examples": [
720
]
},
"fps": {
"type": "integer",
"description": "视频帧率",
"examples": [
30
]
},
"seed": {
"type": "integer",
"description": "随机种子",
"examples": [
20231234
]
},
"n": {
"type": "integer",
"description": "生成视频数量",
"examples": [
1
]
},
"response_format": {
"type": "string",
"description": "响应格式",
"examples": [
"url"
]
},
"user": {
"type": "string",
"description": "用户标识",
"examples": [
"user-1234"
]
},
"metadata": {
"type": "object",
"description": "扩展参数 (如 negative_prompt, style, quality_level 等)",
"additionalProperties": true,
"properties": {},
"x-apifox-orders": []
}
},
"x-apifox-orders": [
"model",
"prompt",
"image",
"duration",
"width",
"height",
"fps",
"seed",
"n",
"response_format",
"user",
"metadata"
]
}响应
200 成功创建视频任务
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| id | 是 | string | 视频 ID |
| object | 是 | string | 对象类型 |
| model | 是 | string | 使用的模型 |
| status | 是 | string | 任务状态 |
| progress | 是 | integer | 进度百分比 |
| created_at | 是 | integer | 创建时间戳 |
| seconds | 是 | string | 视频时长 |
| completed_at | 否 | integer | 完成时间戳 |
| expires_at | 否 | integer | 过期时间戳 |
| size | 否 | string | 视频尺寸 |
| error | 否 | object | OpenAI 视频错误信息 |
| error.message | 否 | string | 错误信息 |
| error.code | 否 | string | 错误码 |
| metadata | 否 | object | 额外元数据 |
原始 Schema
json
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "视频 ID"
},
"object": {
"type": "string",
"description": "对象类型"
},
"model": {
"type": "string",
"description": "使用的模型"
},
"status": {
"type": "string",
"description": "任务状态"
},
"progress": {
"type": "integer",
"description": "进度百分比"
},
"created_at": {
"type": "integer",
"description": "创建时间戳"
},
"seconds": {
"type": "string",
"description": "视频时长"
},
"completed_at": {
"type": "integer",
"description": "完成时间戳"
},
"expires_at": {
"type": "integer",
"description": "过期时间戳"
},
"size": {
"type": "string",
"description": "视频尺寸"
},
"error": {
"type": "object",
"description": "OpenAI 视频错误信息",
"properties": {
"message": {
"type": "string",
"description": "错误信息"
},
"code": {
"type": "string",
"description": "错误码"
}
},
"x-apifox-orders": [
"message",
"code"
]
},
"metadata": {
"type": "object",
"description": "额外元数据",
"additionalProperties": true,
"x-apifox-orders": [],
"properties": {}
}
},
"required": [
"id",
"object",
"model",
"status",
"progress",
"created_at",
"seconds"
],
"x-apifox-orders": [
"id",
"object",
"model",
"status",
"progress",
"created_at",
"seconds",
"completed_at",
"expires_at",
"size",
"error",
"metadata"
],
"x-apifox-refs": {}
}400 请求参数错误
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| error | 否 | object | - |
| error.message | 否 | string | 错误信息 |
| error.type | 否 | string | 错误类型 |
| error.param | 否 | string | null | 相关参数 |
| error.code | 否 | string | null | 错误代码 |
原始 Schema
json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "错误信息"
},
"type": {
"type": "string",
"description": "错误类型"
},
"param": {
"type": [
"string",
"null"
],
"description": "相关参数"
},
"code": {
"type": [
"string",
"null"
],
"description": "错误代码"
}
},
"x-apifox-orders": [
"message",
"type",
"param",
"code"
]
}
},
"x-apifox-orders": [
"error"
]
}