Speech to Text
Transcribe audio with transcribe-1 or transcribe-1-pro, with optional timestamps and emotion cues.
Transcribe audio with transcribe-1 or transcribe-1-pro, with optional timestamps and emotion cues.
This endpoint is BETA: it accepts only multipart/form-data (file upload) or application/msgpack. JSON + Base64 audio is not supported.
Base URL
https://api.autorouter.top— Production
Authentication
BearerAuth: http (bearer)
Authenticate using a Bearer Token.
Format: Authorization: Bearer sk-xxxxxx
Endpoints
POST /fishaudio/v1/asr
Create Speech Transcription Request
Upload an audio file and receive transcribed text. Select the model via the model HTTP header.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Request authentication. Format: Bearer sk-xxxxxx |
model | string | No | ASR model. transcribe-1 (default if omitted): general transcription; transcribe-1-pro: multi-speaker conversations, preserving emotion and vocal-event cues in the text. Applies to both multipart and MessagePack |
Request Body
Content-Type: multipart/form-data or application/msgpack
Let your HTTP client set the multipart Content-Type and boundary. For MessagePack, set Content-Type: application/msgpack and encode audio as binary bytes.
Example:
{
"audio": "<binary>",
"language": "zh",
"ignore_timestamps": false
}Properties:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
audio | file | Yes | — | Audio file upload for multipart, or raw audio bytes for MessagePack |
language | string | null | No | Unset | Optional language hint, such as en, zh, or ja. The language is still auto-detected |
ignore_timestamps | boolean | No | true | Set to false to request timestamped segments. Alignment adds processing time; more noticeable for audio shorter than 30 seconds |
Responses
200: Transcription succeeded
Content-Type: application/json
401: Unauthorized
Content-Type: application/json
402: Insufficient balance
Content-Type: application/json
503: Service overloaded
Content-Type: application/json
Request Example
The examples below use multipart. Let the HTTP client set Content-Type (including the boundary). Do not hardcode multipart/form-data without a boundary—that breaks the request. The Go example sets it via FormDataContentType(). For MessagePack, see below.
curl --request POST https://api.autorouter.top/fishaudio/v1/asr \
--header "Authorization: Bearer sk-xxxxxx" \
--header "model: transcribe-1-pro" \
--form audio=@conversation.wav \
--form ignore_timestamps=falseMessagePack Request Example
Set Content-Type: application/msgpack and encode audio as raw binary bytes.
import msgpack
import requests
url = "https://api.autorouter.top/fishaudio/v1/asr"
with open("conversation.wav", "rb") as f:
payload = msgpack.packb({
"audio": f.read(),
"ignore_timestamps": False,
})
headers = {
"Authorization": "Bearer sk-xxxxxx",
"model": "transcribe-1-pro",
"Content-Type": "application/msgpack",
}
response = requests.post(url, headers=headers, data=payload)
print(response.text)Response Example
{
"text": "<|speaker:0|>你好。<|speaker:1|>[高兴]很开心认识你。<|speaker:0|>我也是。",
"duration": 6.4,
"segments": [],
"language_code": "zh",
"language": "Chinese"
}Response fields:
| Name | Type | Description |
|---|---|---|
text | string | Full transcript. Pro includes inline speaker markers such as <|speaker:0|> and can include emotion and vocal-event cues such as [高兴] (happy) or [laughter] |
duration | number | Audio duration in seconds |
segments | object[] | Array of { "text", "start", "end" } with timestamps in seconds. Empty when timestamps are skipped, alignment is unavailable, or no speech is detected |
segments[]. | string | Segment text (excludes speaker, emotion, and event markers) |
segments[]. | number | Segment start time in seconds |
segments[]. | number | Segment end time in seconds |
language_code | string | null | Detected ISO 639-1 language code, e.g. en or ja. Use this field in application logic |
language | string | null | Detected language name, e.g. English, for display only |
Multi-speaker response format
Pro returns speaker turns inside the text string, using <|speaker:N|> markers. The numeric label N identifies the speaker for the text that follows, up to the next marker. A repeated label means that speaker is speaking again. Labels apply within the recording; they are not names or identities shared across requests.
In the 200 response example above (with ignore_timestamps=true), read it as speaker 0 saying 你好。, speaker 1 saying [高兴]很开心认识你。, and speaker 0 saying 我也是。. The [高兴] cue describes the delivery of speaker 1's speech.
With ignore_timestamps=false (as in the curl example above), the same markers remain in text. The segments array contains timed speech with text, start, and end; alignment excludes speaker, emotion, and event markers. Segments are not speaker turns and do not contain a speaker_id field.
The API returns no separate speaker list or emotion field. Parse the inline markers in text when your application needs speaker turns or emotion cues.
Error Handling
HTTP 401 / 403 Auth Errors
401 Unauthorized: API Key invalid or expired403 Forbidden: API Key has no access to this model (check token's model allowlist)
HTTP 402 Insufficient Balance
Returns insufficient user quota. Top up at the AutoRouter console.
HTTP 503 Service Overloaded
The server is under too much load to process the request. Retry later.