Audio API

Use OpenAI-compatible endpoints for speech synthesis and transcription. Supported models, formats and pricing vary.

Endpoints

NameTypeRequiredDescription
POST /v1/audio/speech
syncText-to-speech. Returns audio bytes inline. Drop-in for OpenAI /v1/audio/speech.
POST /v1/audio/transcriptions
syncSpeech-to-text. Returns JSON transcript inline. Drop-in for OpenAI /v1/audio/transcriptions.
POST /v1/jobs (model=audio)
asyncAsync audio job. Returns 202 with job ID. Poll GET /v1/jobs/:id. Use for long inputs or background processing.

Text-to-Speech models

Voice options depend on the model. Check GET /v1/audio/models and the model documentation before making a request.

NameTypeRequiredDescription
openai/tts-1
ttsOpenAI text-to-speech; consult the current model page for pricing.
openai/tts-1-hd
ttsOpenAI high-definition text-to-speech.
openai/gpt-4o-mini-tts
ttsGPT-4o mini text-to-speech.
indexteam/indextts-2
ttsIndexTTS-2; see the speech reference for voice options.

Speech-to-Text models

NameTypeRequiredDescription
openai/whisper-1
sttOpenAI Whisper transcription.
openai/gpt-4o-transcribe
sttGPT-4o transcription.
openai/gpt-4o-mini-transcribe
sttGPT-4o mini transcription.

Sync vs async

The sync endpoints (/v1/audio/speech and /v1/audio/transcriptions) stream the result back inline β€” best for interactive or short inputs. For long audio files or batch workloads, use POST /v1/jobs with an audio model: the gateway queues the request, stores the output in S3, and returns a presigned URL when complete.

Configure the OpenAI SDK with a TheRouter key and base URL https://api.therouter.ai/v1. Test the selected model and options; support varies by route.

Billing

Billing units and prices depend on the model. Consult the current model catalog before calling the API. Previously listed SenseVoice, CosyVoice2 and Fish Speech aliases are not in the current public catalog; do not assume they are available as fallbacks.

Help & contact