API DocsAI Model APIsAudioFish Audio

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

NameTypeRequiredDescription
AuthorizationstringYesRequest authentication. Format: Bearer sk-xxxxxx
modelstringNoASR 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:

NameTypeRequiredDefaultDescription
audiofileYes—Audio file upload for multipart, or raw audio bytes for MessagePack
languagestring | nullNoUnsetOptional language hint, such as en, zh, or ja. The language is still auto-detected
ignore_timestampsbooleanNotrueSet 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=false

MessagePack 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:

NameTypeDescription
textstringFull transcript. Pro includes inline speaker markers such as <|speaker:0|> and can include emotion and vocal-event cues such as [高兴] (happy) or [laughter]
durationnumberAudio duration in seconds
segmentsobject[]Array of { "text", "start", "end" } with timestamps in seconds. Empty when timestamps are skipped, alignment is unavailable, or no speech is detected
segments[].textstringSegment text (excludes speaker, emotion, and event markers)
segments[].startnumberSegment start time in seconds
segments[].endnumberSegment end time in seconds
language_codestring | nullDetected ISO 639-1 language code, e.g. en or ja. Use this field in application logic
languagestring | nullDetected 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 expired
  • 403 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.

On this page