官方文档:https://platform.openai.com/docs/guides/text-to-speech
POST
/v1/audio/speech创建语音 gpt-4o-mini-tts
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/v1/audio/speech \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini-tts",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
model | JSON body | string | 是 | 可用的 TTS 模型之一:tts-1 或 tts-1-hd | - |
input | JSON body | string | 是 | 要生成音频的文本。最大长度为4096个字符。 | - |
voice | JSON body | string | 是 | 生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。 | - |
response_format | JSON body | string | 否 | 默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。 | - |
speed | JSON body | number | 否 | 默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。 | - |
返回响应 (200)
此部分没有定义参数。
来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 497676096,
"name": "创建语音 gpt-4o-mini-tts",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "官方文档:https://platform.openai.com/docs/guides/text-to-speech",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/v1/audio/speech",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "可用的 TTS 模型之一:tts-1 或 tts-1-hd"
},
"input": {
"type": "string",
"description": "要生成音频的文本。最大长度为4096个字符。"
},
"voice": {
"type": "string",
"description": "生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。"
},
"response_format": {
"type": "string",
"description": "默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。"
},
"speed": {
"type": "number",
"description": "默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。"
}
},
"required": [
"model",
"input",
"voice"
],
"x-apifox-orders": [
"model",
"input",
"voice",
"response_format",
"speed"
]
},
"examples": [
{
"value": "{\r\n \"model\": \"gpt-4o-mini-tts\",\r\n \"input\": \"The quick brown fox jumped over the lazy dog.\",\r\n \"voice\": \"alloy\"\r\n }",
"mediaType": "application/json",
"description": ""
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": []
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {},
"responses": [
{
"id": 134879737,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92749353,
"ordering": 24,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {}
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-05T15:03:02.000Z",
"updatedAt": "2026-08-05T15:03:05.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [
"BLANK.134879737"
],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}