Tera Router
Gateway API

Audio

Text-to-speech and speech-to-text in OpenAI's audio format — POST /v1/audio/speech and POST /v1/audio/transcriptions.

Both endpoints use OpenAI's audio API, so the OpenAI SDK works by swapping its base URL. model resolves exactly like chat — provider/model, an alias, or chain:<name> — and the router keeps only the targets whose provider supports the capability.

EndpointProviders
POST /v1/audio/speechOpenAI, ElevenLabs, Deepgram, OpenAI-compatible custom providers
POST /v1/audio/transcriptionsOpenAI, Groq, ElevenLabs, Deepgram, OpenAI-compatible custom providers

Text-to-speech

curl http://localhost:8080/v1/audio/speech \
  -H "Authorization: Bearer sk_tr_..." \
  -H "Content-Type: application/json" \
  -d '{ "model": "openai/gpt-4o-mini-tts", "input": "Hello from Tera Router.", "voice": "alloy" }' \
  --output speech.mp3

The response is the audio file itself; its Content-Type is the audio type (audio/mpeg for MP3).

Providermodel examplevoice
OpenAIopenai/gpt-4o-mini-tts, openai/tts-1alloy, nova, shimmer, …
ElevenLabselevenlabs/eleven_multilingual_v2required: an ElevenLabs voice id
Deepgramdeepgram/aura-2-thalia-ennot used — the model is the voice

response_format and speed are honored by OpenAI-compatible providers; ElevenLabs and Deepgram return MP3.

Speech-to-text

Send multipart/form-data, as with OpenAI's transcription API:

curl http://localhost:8080/v1/audio/transcriptions \
  -H "Authorization: Bearer sk_tr_..." \
  -F file=@meeting.mp3 \
  -F model=groq/whisper-large-v3-turbo
{ "text": "Hello from the meeting." }
FieldRequiredNotes
fileyesThe audio file, up to 25 MB.
modelyesprovider/model, an alias, or chain:<name>.
languagenoISO-639-1 code such as en or id.
promptnoContext hint — OpenAI-compatible providers only.
response_formatnojson (default), text, verbose_json, srt, or vtt.

response_format picks the reply's shape. OpenAI, Groq, and OpenAI-compatible providers get it as sent and their body comes back verbatim, so verbose_json keeps its segments and srt/vtt come as subtitle text. ElevenLabs and Deepgram answer json ({"text": …}) and text (text/plain) only; for any other format an alias or chain moves on to the next target.

Providermodel example
OpenAIopenai/gpt-4o-mini-transcribe, openai/whisper-1
Groqgroq/whisper-large-v3-turbo
ElevenLabselevenlabs/scribe_v2
Deepgramdeepgram/nova-3

GET /v1/models/tts and GET /v1/models/stt list the speech models this key may use (see Models by kind).

Errors

400 means the model names a provider without the capability (or file is missing); 503 means no account is connected for it. An alias or chain that mixes providers falls back to the next one when a provider fails.

On this page