RouteMux Docs
Api referenceAudio

语音转文本(OpenAI 兼容)

POST
/v1/audio/transcriptions

以 multipart/form-data 上传音频文件,模型填写 minimax/asr-1.0。

调用示例

curl https://api.routemux.com/v1/audio/transcriptions \  -H "Authorization: Bearer $ROUTEMUX_API_KEY" \  -F "model=minimax/asr-1.0" \  -F "file=@./audio.wav" \  -F "language=ru" \  -F "response_format=verbose_json" \  -F "timestamp_level=word"

支持的参数

字段必填支持范围
model是minimax/asr-1.0
file是WAV、AIFF、FLAC、ALAC(M4A)、MP3、AAC、Opus、Ogg;最长 500 秒、最大 50 MB。不支持裸 PCM。
language否语言代码见下方;省略或空值表示自动识别和混合语言识别。兼容 OpenAI SDK 的表单字段,也支持官方的 language HTTP 请求头。RouteMux 会把表单字段转换为官方请求头;两者同传时,表单字段优先。
response_format否json(默认)返回文本与时长;verbose_json 增加说话人、n_speakers 与 segments;srt 返回 SRT 字幕;vtt 返回 WebVTT 字幕。
timestamp_level否空值或 sentence(默认)、word;对 verbose_json、srt、vtt 生效,json 接受但忽略。中文支持字级、英文支持词级时间戳。
timestamp_granularities[]否OpenAI SDK 别名:segment 映射为 sentence,word 映射为 word;两值同传时保留词级粒度。显式 timestamp_level 优先。
stream否false(默认)一次返回完整结果;true 使用 SSE 逐步返回文本,且必须使用 response_format=json。

支持的语言提示:zh、yue、en、ja、ko、th、vi、id、ms、fil、ar、tr、fr、de、es、it、pt、pl、ru、uk。其中 zh 为中文、ru 为俄语、en 为英语;不指定语言即可自动识别。 官方 ASR 没有 prompt、temperature 参数,传入会返回 400 REQUEST_INVALID,不会静默忽略。

字幕与流式输出

下载字幕时,在上面的示例中改用 -F response_format=srt -o transcript.srt,或 -F response_format=vtt -o transcript.vtt。 流式调用使用 curl -N,并传 -F response_format=json -F stream=true。SSE 事件示例:

data: {"index":0,"delta":"你好","finish":false}data: {"index":1,"delta":"","finish":true,"duration":5.952688}

按顺序拼接 delta,收到 finish=true 即结束;最后一个事件带有音频时长 duration。 stream=true 不能与 verbose_json、srt、vtt 组合,非法组合在调用上游前返回 400。 此端点接收上传文件;流式输出不代表支持麦克风实时音频流输入。

计费与下载

按输入音频秒数计费,不按 token。JSON 与 SSE 使用上游返回的 duration;字幕响应使用服务器从上传文件核验的音频时长,单价见当前模型价格。 在 Playground 中生成的语音与转写/字幕文件,会保存到产物库,支持预览和下载;这些对话产物在用户删除前持续保留。

官方参考:MiniMax ASR 接口参数、支持的语言与音频要求。

Authorization

bearerAuth
AuthorizationBearer <token>

Authorization: Bearer <your RouteMux API key>.

Create keys at https://routemux.com/console/keys. New keys use the sk- prefix; the legacy rmx_live_ prefix is still accepted.

The Anthropic SDK's x-api-key and the Google SDK's x-goog-api-key are accepted too. Sending several key headers with different values returns 400 AUTH_AMBIGUOUS_API_KEY.

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

通过 RouteMux 调用 MiniMax ASR 1.0 的受支持字段;与官方接口的差异见本页说明。

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/audio/transcriptions" \  -F model="string" \  -F file="string"
{  "text": "Hello, this is a speech recognition test. We process three hundred minutes of audio every day.",  "duration": 5.952688,  "n_speakers": 1,  "segments": [    {      "id": 0,      "start": 0.04,      "end": 5.74,      "speaker": "S1",      "text": "Hello, this is a speech recognition test. We process three hundred minutes of audio every day."    }  ]}