AI 模型接口视频(Videos)Sora格式
创建视频
接口
POST /v1/videos
请求头
| Header | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <token> |
Content-Type | 是 | multipart/form-data |
Accept | 是 | application/json |
请求参数
multipart/form-data
说明:以下字段按 schema 展示,OpenAPI 未显式声明 body 字段必填项。
| 字段 | 位置 | 类型 | 说明 |
|---|---|---|---|
model | body | string | 模型 / 风格 ID |
prompt | body | string | 文本提示词 |
image | body | string | 图片输入,支持 URL 或 Base64 |
duration | body | number | 视频时长,单位秒 |
width | body | integer | 视频宽度 |
height | body | integer | 视频高度 |
fps | body | integer | 视频帧率 |
seed | body | integer | 随机种子 |
n | body | integer | 生成数量 |
response_format | body | string | 响应格式,通常为 url |
user | body | string | 用户标识 |
metadata | body | object | 扩展元数据,支持自定义字段 |
响应参数
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 | 错误信息 |
metadata | object | 额外元数据 |
error
| 字段 | 类型 | 说明 |
|---|---|---|
message | string | 错误信息 |
code | string | 错误码 |
metadata
| 字段 | 类型 | 说明 |
|---|---|---|
additionalProperties | boolean | 允许自定义扩展字段 |
错误响应
400 Bad Request
| 字段 | 类型 | 说明 |
|---|---|---|
error.message | string | 错误信息 |
error.type | string | 错误类型 |
error.param | string | null | 相关参数 |
error.code | string | null | 错误代码 |
说明
image可传图片 URL 或 Base64 数据。response_format当前按url返回。
Authorization
BearerAuth
AuthorizationBearer <token>
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
In: header
Request Body
multipart/form-data
model?string
模型/风格 ID
prompt?string
文本描述提示词
image?string
图片输入 (URL 或 Base64)
duration?number
视频时长(秒)
width?integer
视频宽度
height?integer
视频高度
fps?integer
视频帧率
seed?integer
随机种子
n?integer
生成视频数量
response_format?string
响应格式
user?string
用户标识
metadata?
扩展参数 (如 negative_prompt, style, quality_level 等)
Response Body
application/json
application/json
curl -X POST "https://tokenfleet.cn/v1/videos"{
"id": "string",
"object": "string",
"model": "string",
"status": "string",
"progress": 0,
"created_at": 0,
"seconds": "string",
"completed_at": 0,
"expires_at": 0,
"size": "string",
"error": {
"message": "string",
"code": "string"
},
"metadata": {}
}{
"error": {
"message": "string",
"type": "string",
"param": "string",
"code": "string"
}
}