Skip to main content
POST
Speech to Text
This BETA endpoint accepts audio only as multipart/form-data (a file upload) or application/msgpack. JSON with base64-encoded audio is not supported.

Select a model

Send POST https://api.fish.audio/v1/asr with Authorization: Bearer <API_KEY> and an optional model HTTP header: The model belongs in the header for both multipart and MessagePack requests. The request body contains:
Let your HTTP client set the multipart Content-Type and boundary. For MessagePack, set Content-Type: application/msgpack and encode audio as binary bytes. See the Speech to Text guide for an example.

Read the response

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. This illustrative response has two speakers and three turns. With ignore_timestamps=true, timestamps are skipped:
Read this 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. See the speaker parsing example. See the model capabilities and SDK examples for more detail.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

model
enum<string>
default:transcribe-1

Specify which speech-to-text model to use.

Available options:
transcribe-1,
transcribe-1-pro

Body

audio
file
required

Audio file to be converted to text

language
string | null

Optional hint. The language is auto-detected regardless; the detected language is returned as language_code.

ignore_timestamps
boolean
default:true

Whether to return precise timestamps in the text, this will increase the latency in audio shorter than 30 seconds

Response

Request fulfilled, document follows

text
string
required
duration
number
required

Duration of the audio in seconds

segments
ASRSegment · object[]
required
language_code
string | null

Detected language as an ISO 639-1 code (e.g. en, ja). Omitted if no language is detected.

language
string | null

Detected language name (e.g. English). For display only; use language_code in code.