- Text-to-speech (TTS) —
POST /v1/audio/speechreturns audio bytes for a text input. Find models whoseoutput_modalitiesincludesaudio. - Transcription (ASR) —
POST /v1/audio/transcriptionsreturns text for an audio file upload. Find models whoseinput_modalitiesincludesaudio.
Text-to-speech
The example below usesKokoro-82M. The response body is raw audio bytes (WAV by default) — write them straight to disk.
Voices
Voice names are model-specific — there’s no shared “Alloy/Echo/Fable/…” namespace. Check the model catalog for the supported set, or fall back to the model’s upstream documentation.Billing
TTS bills per input character. Read the active rate fromGET /v1/pricing — find the row for your model, where pricing_type is per_character, and take unit_price_usd. See also billing.
Transcription
/v1/audio/transcriptions is Whisper-compatible. Send the audio file as multipart/form-data, get back a JSON { "text": "..." }. The current model is whisper-large-v3-turbo.
Request fields
Billing
ASR bills per minute of input audio. Read the active rate fromGET /v1/pricing — find the row for your model, where pricing_type is per_minute, and take unit_price_usd.
See also
- Model discovery — how to tell text-to-speech and speech-to-text models apart on
/v1/models. - OpenAI compatibility —
/v1/audio/translationsis not supported.