Skip to main content
POST
Speech to Text

Authorizations

Authorization
string
header
required

HTTP: Bearer Auth

  • Security Scheme Type: http
  • HTTP Authorization Scheme: Bearer API_key, used to verify account information. You can view it in Account Management > API Key.

Headers

Content-Type
enum<string>
default:multipart/form-data
required

The media type of the request body. Must be multipart/form-data.

Available options:
multipart/form-data
language
string
default:""

An optional BCP-47 language tag that hints at the primary spoken language. Omit this header or pass an empty value to enable mixed-language recognition.

Currently supported values: zh (Chinese), yue (Cantonese), en (English), ja (Japanese), ko (Korean), th (Thai), vi (Vietnamese), id (Indonesian), ms (Malay), fil (Filipino), ar (Arabic), tr (Turkish), fr (French), de (German), es (Spanish), it (Italian), pt (Portuguese), pl (Polish), ru (Russian), and uk (Ukrainian).

Example:

"en"

Body

multipart/form-data
model
enum<string>
default:asr-1.0
required

The model version used for this request.

Available options:
asr-1.0
Example:

"asr-1.0"

file
file
required

The audio file to transcribe. Provide the path to the file.

The uploaded audio file must meet the following requirements:

Raw PCM without a container is not supported.

Speech recognition does not benefit from high sample rates or stereo. Uncompressed high-specification audio easily exceeds the size limit (for example, 500 seconds of 48 kHz stereo WAV is about 92 MB). Convert to mono 16 kHz, or use a compressed format such as mp3 / aac / opus; the transcription result is unaffected.

response_format
enum<string>
default:json

The format of the transcription result.

verbose_json / srt / vtt enable speaker diarization and forced alignment, and therefore cannot be combined with stream=true.

Response body for srt:

Response body for vtt:

Available options:
json,
verbose_json,
srt,
vtt
Example:

"json"

stream
boolean
default:false

Whether to stream the transcription result.

  • false (default): the full result is returned once transcription completes.
  • true: incremental text is pushed over SSE and the response type is text/event-stream. In this case response_format only supports json.

A streaming response is pushed line by line as data: <json>, with events separated by blank lines:

The data field of each event is a JSON object: index is the event sequence number starting from 0, delta is the newly transcribed text for this event, finish indicates whether this is the terminating event, and duration is the audio duration in seconds (returned only in the terminating event). Clients should concatenate all delta values in index order and stop reading after receiving finish=true.

Example:

false

Response

Transcription succeeded. The fields below apply when response_format is json or verbose_json. For the response body of srt / vtt or stream=true, see the description of the corresponding request parameter.

text
string

The full transcribed text. Under verbose_json this equals the concatenation of all segments[].text in time order.

duration
number

The duration of the input audio, in seconds. Billing is based on this duration.

n_speakers
integer

The number of detected speakers. Returned only when response_format=verbose_json.

segments
object[]

Sentence-level transcription results, each carrying start/end times and a speaker identifier. Returned only when response_format=verbose_json.

trace_id
string

The trace ID of this request, useful for troubleshooting.