Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Commit d438cc5

Browse files
authored
Merge pull request #27 from QuantumNous/openai-video-api
docs: 添加 openai 视频格式文档
2 parents 40710f7 + 922c8ad commit d438cc5

4 files changed

Lines changed: 368 additions & 120 deletions

File tree

Lines changed: 68 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
# 生成视频
1+
# 可灵AI (Kling)和即梦 (Jimeng)格式
22

33
调用视频生成接口生成视频,支持多种视频生成服务:
44

55
- **可灵AI (Kling)**: [API文档](https://app.klingai.com/cn/dev/document-api/apiReference/commonInfo)
66
- **即梦 (Jimeng)**: [API文档](https://www.volcengine.com/docs/85621/1538636)
77

8-
## API 端点
8+
## 生成视频
9+
10+
### API 端点
911

1012
```
1113
POST /v1/video/generations
1214
```
1315

14-
## 请求头
16+
### 请求头
1517

1618
| 参数 | 类型 | 必填 | 描述 |
1719
|------|------|------|------|
1820
| Authorization | string || 用户认证令牌 (Bearer: sk-xxxx) |
1921
| Content-Type | string || application/json |
2022

21-
## 请求参数
23+
### 请求参数
2224

2325
| 参数 | 类型 | 必填 | 描述 |
2426
|------|------|------|------|
@@ -35,9 +37,9 @@ POST /v1/video/generations
3537
| seed | integer || 随机种子 |
3638
| user | string || 用户标识符 |
3739

38-
## 请求示例
40+
### 请求示例
3941

40-
### 可灵AI 示例
42+
#### 可灵AI 示例
4143

4244
```bash
4345
curl https://你的newapi服务器地址/v1/video/generations \
@@ -58,7 +60,7 @@ curl https://你的newapi服务器地址/v1/video/generations \
5860
}'
5961
```
6062

61-
### 即梦AI 示例
63+
#### 即梦AI 示例
6264

6365
```bash
6466
curl https://你的newapi服务器地址/v1/video/generations \
@@ -79,7 +81,7 @@ curl https://你的newapi服务器地址/v1/video/generations \
7981
}'
8082
```
8183

82-
### Vidu 渠道示例
84+
#### Vidu 渠道示例
8385

8486
```bash
8587
curl https://你的newapi服务器地址/v1/video/generations \
@@ -104,11 +106,63 @@ curl https://你的newapi服务器地址/v1/video/generations \
104106
}'
105107
```
106108

107-
## 响应格式
109+
## 查询视频
110+
111+
根据任务ID查询视频生成任务的状态和结果
112+
113+
### API 端点
114+
115+
```
116+
GET /v1/video/generations/{task_id}
117+
```
118+
119+
### 路径参数
120+
121+
| 参数 | 类型 | 必填 | 描述 |
122+
|------|------|------|------|
123+
| task_id | string || 任务ID |
124+
125+
### 请求示例
126+
127+
```bash
128+
curl 'https://你的newapi服务器地址/v1/video/generations/{task_id}'
129+
```
130+
131+
### 响应格式
132+
133+
#### 200 - 成功响应
134+
135+
```json
136+
{
137+
"error": null,
138+
"format": "mp4",
139+
"metadata": {
140+
"duration": 5,
141+
"fps": 30,
142+
"height": 512,
143+
"seed": 20231234,
144+
"width": 512
145+
},
146+
"status": "succeeded",
147+
"task_id": "abcd1234efgh",
148+
"url": "string"
149+
}
150+
```
151+
152+
#### 响应字段说明
153+
154+
| 字段 | 类型 | 描述 |
155+
|------|------|------|
156+
| task_id | string | 任务ID |
157+
| status | string | 任务状态(processing: 处理中, succeeded: 成功, failed: 失败) |
158+
| format | string | 视频格式 |
159+
| url | string | 视频资源URL(成功时) |
160+
| metadata | object | 结果元数据 |
161+
| error | object | 错误信息(成功时为null) |
108162

109-
### 错误响应
163+
## 错误响应
110164

111-
#### 400 - 请求参数错误
165+
### 400 - 请求参数错误
112166
```json
113167
{
114168
"code": null,
@@ -118,7 +172,7 @@ curl https://你的newapi服务器地址/v1/video/generations \
118172
}
119173
```
120174

121-
#### 401 - 未授权
175+
### 401 - 未授权
122176
```json
123177
{
124178
"code": null,
@@ -128,7 +182,7 @@ curl https://你的newapi服务器地址/v1/video/generations \
128182
}
129183
```
130184

131-
#### 403 - 无权限
185+
### 403 - 无权限
132186
```json
133187
{
134188
"code": null,
@@ -138,7 +192,7 @@ curl https://你的newapi服务器地址/v1/video/generations \
138192
}
139193
```
140194

141-
#### 500 - 服务器内部错误
195+
### 500 - 服务器内部错误
142196
```json
143197
{
144198
"code": null,

0 commit comments

Comments
 (0)