Skip to main content
post/audio-to-text
Request example
Response
post/audio-to-text

Authorization

Authorizationstringheaderrequired#

每个请求都通过 API Key 认证:Authorization: Bearer {API_KEY}。应用接口使用应用 API Key,知识库接口使用知识库 API Key(快速开始)。

API Key 应保存在服务端,切勿嵌入客户端代码。缺失或无效的 Key 会返回 HTTP 401(unauthorized)。

Body

multipart/form-data
filefilerequired#
要转写的音频文件。接受的 MIME 类型:audio/mp3、audio/m4a(也接受 audio/x-m4a)、audio/wav、audio/amr、audio/mpga。其他类型(包括常见的 audio/mpeg)会返回 unsupported_audio_type 错误。最大 30 MB。
userstring#
终端用户标识,由你的应用定义,需在应用内唯一。参见 终端用户身份。

Responses

application/json
语音转文字成功。
textstring#
语音识别输出的文字。