语音转文字 (Audio Transcriptions)
语音转文字(Audio Transcriptions)接口用于将输入的音频文件转录为相对应的文本内容。支持 Whisper 系列等语音识别模型。此接口使用 multipart/form-data 数据类型。
POST /v1/audio/transcriptions| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
file | file | ✅ | - | 需要转录的音频文件。支持格式:mp3, mp4, mpeg, mpga, m4a, wav, webm。大小限制在 25MB 以内。 |
model | string | ✅ | - | 调用的语音识别模型 ID(例如 whisper-1)。 |
language | string | ❌ | - | 音频所使用语言的 ISO-639-1 代码(如 zh, en),有助于提升识别准确度。 |
prompt | string | ❌ | - | 可选的提示词,用来纠正音频中人名或生僻词的拼写。 |
response_format | string | ❌ | json | 返回数据的格式。可选:json, text, srt, vtt。 |
temperature | number | ❌ | 0 | 采样温度,介于 0 到 1 之间。 |
cURL 请求
Section titled “cURL 请求”curl https://api.easytakeai.com/v1/audio/transcriptions \ -H "Authorization: Bearer YOUR_API_KEY" \ -F file="@speech.mp3" \ -F model="whisper-1" \ -F language="zh"JSON 响应示例
Section titled “JSON 响应示例”{ "text": "欢迎使用大模型中转平台进行语音识别测试。"}