Skip to main content

创建语音 gpt-4o-mini-tts

POST /v1/audio/speech 官方文档:https://platform.openai.com/docs/guides/text-to-speech

请求体参数 (Body)

string
required
要生成音频的文本。最大长度为4096个字符。
string
required
可用的 TTS 模型之一:tts-1 或 tts-1-hd
string
默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。
number
默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。
string
required
生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。

请求示例 (JSON)

请求示例 (cURL)

响应示例 (200 OK)


音频转文字 gpt-4o-transcribe

POST /v1/audio/transcriptions 官方文档:https://platform.openai.com/docs/guides/speech-to-text

请求示例 (cURL)

响应示例 (200 OK)


创建翻译(部分模型不支持)

POST /v1/audio/translations 将音频翻译为英文文本。官方文档:https://platform.openai.com/docs/api-reference/audio/createTranslation

请求示例 (cURL)

响应示例 (200 OK)