POST /v1/chat/completions| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| Authorization | string | 是 | Bearer YOUR_API_KEY |
| Content-Type | string | 是 | application/json |
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 固定值:sora_url |
| messages | array | 是 | 消息数组,包含分享链接 |
| messages[].role | string | 是 | 固定值:user |
| messages[].content | string | 是 | Sora官方分享链接 |
| 参数名 | 类型 | 说明 |
|---|---|---|
| id | string | 响应ID |
| object | string | 对象类型 |
| created | number | 创建时间戳(秒) |
| model | string | 使用的模型,返回 sora_url |
| choices | array | 响应选项数组 |
| choices[].message.content | string | 解析结果消息 |
| links | object | 视频链接信息(解析成功时返回) |
| links.id | string | 视频ID |
| links.text | string | 视频提示词 |
| links.mp4 | string | 无水印视频下载地址 |
| links.mp4_wm | string | 带水印视频下载地址 |
| links.gif | string | GIF预览图地址 |
| links.thumbnail | string | 缩略图地址 |
| links.md | string | Markdown格式信息 |
| post_info | object | 帖子信息(包含浏览量、点赞数等) |
| post_info.view_count | number | 浏览量 |
| post_info.like_count | number | 点赞数 |
| usage | object | Token使用情况 |
{
"id": "chatcmpl-xxxxxxxxxxxxx",
"object": "chat.completion",
"created": 1709876543,
"model": "sora_url",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "解析成功"
},
"finish_reason": "stop"
}
],
"links": {
"id": "s_68f6140d88a88191a6b5c803d4e47b6c",
"text": "一只可爱的小猫在花园里玩耍",
"mp4": "https://videos.openai.com/az/files/000000xxxxx...",
"mp4_wm": "https://videos.openai.com/az/files/000000xxxxx...",
"gif": "https://videos.openai.com/az/files/000000xxxxx...",
"thumbnail": "https://videos.openai.com/az/files/000000xxxxx...",
"md": "**Prompt:** 一只可爱的小猫在花园里玩耍"
},
"post_info": {
"view_count": 12345,
"like_count": 678
},
"usage": {
"prompt_tokens": 10,
"completion_tokens": 5,
"total_tokens": 15
}
}{
"id": "chatcmpl-xxxxxxxxxxxxx",
"object": "chat.completion",
"created": 1709876543,
"model": "sora_url",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "解析失败:链接无效或视频不存在"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 5,
"total_tokens": 15
}
}| HTTP状态码 | 说明 |
|---|---|
| 200 | 请求成功(包括解析失败的情况) |
| 400 | 参数错误 |
| 401 | 未授权 |
| 503 | 服务暂时不可用 |
| 500 | 服务器内部错误 |
links 字段是否存在来判断是否解析成功links.mp4:无水印高清视频(推荐)links.mp4_wm:带水印视频links.gif:GIF预览图links.thumbnail:缩略图https://videos.openai.com/az/files/{uuid}%2Fraw?... 带有签名参数的Azure存储链接links.text 字段包含原始视频的提示词