官方文档:https://platform.openai.com/docs/api-reference/chat/create
POST
/v1/chat/completionsGPT-4o-audio
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/v1/chat/completions \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-audio-preview",
"modalities": ["text", "audio"],
"audio": { "voice": "alloy", "format": "wav" },
"messages": [
{
"role": "user",
"content": "Is a golden retriever a good family dog?"
}
]
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Content-Type | Header | string | 是 | - | application/json |
Authorization | Header | string | 是 | - | Bearer $OPENAI_API_KEY |
model | JSON body | string | 是 | 要使用的模型 ID。 | - |
modalities | JSON body | array<string> | 否 | 模型生成的输出类型。默认设置:["text"]。要请求此模型生成文本和音频响应,您可以使用:["text", "audio"]。 | - |
audio | JSON body | object | 否 | 音频输出参数。 | - |
audio.voice | JSON body | string | 是 | 模型用于响应支持的语音有alloy, ash, ballad, coral, echo, fable, nova, onyx, sage,或者 shimmer。 | - |
audio.format | JSON body | string | 是 | 指定输出音频格式必须是wav, mp3, flac, opus, 或者 pcm16。 | - |
messages | JSON body | array<object> | 是 | 构成当前对话的消息列表。 | - |
messages[].role | JSON body | string | 是 | - | - |
messages[].content | JSON body | string | 是 | 消息内容。 | - |
返回响应 (200)
此部分没有定义参数。
来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 497673344,
"name": "GPT-4o-audio",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "官方文档:https://platform.openai.com/docs/api-reference/chat/create",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/v1/chat/completions",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "要使用的模型 ID。"
},
"modalities": {
"type": "array",
"items": {
"type": "string"
},
"description": "模型生成的输出类型。默认设置:[\"text\"]。要请求此模型生成文本和音频响应,您可以使用:[\"text\", \"audio\"]。"
},
"audio": {
"type": "object",
"properties": {
"voice": {
"type": "string",
"description": "模型用于响应支持的语音有alloy, ash, ballad, coral, echo, fable, nova, onyx, sage,或者 shimmer。"
},
"format": {
"type": "string",
"description": "指定输出音频格式必须是wav, mp3, flac, opus, 或者 pcm16。"
}
},
"required": [
"voice",
"format"
],
"x-apifox-orders": [
"voice",
"format"
],
"description": "音频输出参数。"
},
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"content": {
"type": "string",
"description": "消息内容。"
}
},
"x-apifox-orders": [
"role",
"content"
],
"required": [
"role",
"content"
]
},
"description": "构成当前对话的消息列表。"
}
},
"required": [
"model",
"messages"
],
"x-apifox-orders": [
"model",
"modalities",
"audio",
"messages"
]
},
"examples": [
{
"value": "{\n \"model\": \"gpt-4o-audio-preview\",\n \"modalities\": [\"text\", \"audio\"],\n \"audio\": { \"voice\": \"alloy\", \"format\": \"wav\" },\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Is a golden retriever a good family dog?\"\n }\n ]\n }",
"mediaType": "application/json",
"description": ""
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "d8C1kG4I6c",
"name": "Content-Type",
"required": true,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "application/json"
},
{
"id": "Ev17NGSTaX",
"name": "Authorization",
"required": true,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "Bearer $OPENAI_API_KEY"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {},
"responses": [
{
"id": 165412170,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92749335,
"ordering": 0,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {}
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-05T14:40:23.000Z",
"updatedAt": "2026-08-06T12:15:55.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [
"BLANK.165412170"
],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}