All pages

Audio (TTS & STT)

Two audio endpoints: POST /v1/audio/speech converts text to speech (MP3 or PCM output depending on the model) and POST /v1/audio/transcriptions converts speech to text. Via multipart upload or JSON with base64 audio. Both are OpenAI-SDK compatible.

POST/v1/audio/speechBearer auth

Text-to-speech (TTS)

Convert text to spoken audio. Drop-in compatible with the OpenAI SDK's client.audio.speech.create(...). Billed per character of input, per second of generated audio, or both, as each model's page states; the charge settles when the audio has been sent.

Every text-to-speech model in GET /v1/models (api_shape speech) works here and on POST /v1/predictions. Voices are model-specific: each model's input_fields lists its own. response_format is mp3 or pcm (24 kHz mono); when omitted the audio is PCM, so send mp3 to get an MP3 file.

Request bodyrequired

FieldTypeDescription
modelrequiredstring

Example: x-ai/grok-voice-tts-1.0

inputrequiredstring

Example: Hello world

voicerequiredstring

Example: eve

response_formatstring

Default: pcm

Allowed values: mp3 · pcm

Example

Responses

200

Audio bytestream.

POST/v1/audio/transcriptionsBearer auth

Speech-to-text (STT)

Transcribe audio to text. Drop-in compatible with the OpenAI SDK's client.audio.transcriptions.create(...) (multipart file upload). You may also send the JSON shape ({model, input_audio:{data:<base64>, format}}) directly. Models: every speech-to-text model in GET /v1/models (api_shape: transcriptions), e.g. openai/whisper-1, openai/gpt-4o-transcribe, elevenlabs/scribe-v2, microsoft/mai-transcribe-2. OpenAI's bare ids (whisper-1) work too. An unknown model is 404 MODEL_NOT_FOUND.

Price. Per minute of audio, or per token on the token-priced models (gpt-4o-transcribe, gpt-4o-mini-transcribe, gemini-3.5-transcribe); the rate is on each model's page. We measure the audio's length before reserving credit, so the reserve matches the recording; you are charged the reported usage.cost.

Inline audio only. Send the file (multipart file) or base64 input_audio.data; pcm is raw 16-bit mono at 16 kHz. A URL (input_audio.url) is refused here: send it to POST /v1/predictions (input.audio), which also suits long recordings. Audio whose length cannot be read is 400.

Some models cap audio duration: google/chirp-3 accepts at most 60 seconds per request and answers anything longer with 400 AUDIO_DURATION_LIMIT, before anything is reserved. Split long recordings, or use openai/whisper-large-v3 / openai/gpt-4o-transcribe, which take multi-minute audio in one call.

diarize: true (with response_format: verbose_json) labels speakers on the models that support it (ElevenLabs Scribe); others answer 400. For Persian on Deepgram Nova-3, set language: "fa".

Request bodymultipart/form-datarequired

FieldTypeDescription
filerequiredstring (binary)
modelrequiredstring

Example: openai/gpt-4o-mini-transcribe

response_formatstring
languagestring

Request bodyapplication/jsonrequired

FieldTypeDescription
modelrequiredstring

Example: openai/gpt-4o-mini-transcribe

input_audiorequiredobject
datarequiredstring

base64-encoded audio

formatrequiredstring

Allowed values: mp3 · wav · ogg · flac · webm · m4a · pcm

languagestring

ISO-639-1, e.g. fa; detected when omitted

response_formatstring

Allowed values: json · verbose_json

diarizeboolean

label speakers (verbose_json, supported models)

Example

Responses

200

Transcription result.

Updated 2026-10-13