Audio
Turn text into speech, and transcribe or translate audio.
The gateway turns text into speech at https://gateway.respan.ai/v1/audio/speech, transcribes audio at https://gateway.respan.ai/v1/audio/transcriptions, and translates audio into English text at https://gateway.respan.ai/v1/audio/translations. See All API formats.
Quickstart
Text to speech
curl https://gateway.respan.ai/v1/audio/speech \
-H "Authorization: Bearer $RESPAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "tts-1", "voice": "alloy", "input": "Your order has shipped."}' \
-o speech.mp3Transcription
curl https://gateway.respan.ai/v1/audio/transcriptions \
-H "Authorization: Bearer $RESPAN_API_KEY" \
-F model="gpt-4o-transcribe" \
-F file="@speech.mp3"Respan parameters work here as on chat: see Respan parameters. Transcription and translation are forms, so send them in the X-Data-Respan-Params header (base64 JSON).
To send audio to a chat model or get a spoken answer, see Chat. For live voice over a WebSocket, see Realtime.
Models and providers
| Provider | Speech | Transcription and translation |
|---|---|---|
| OpenAI | Yes | Yes |
| Groq | Yes | Yes |
| Mistral (Voxtral) | Yes | Transcription only |
| Inworld (on DeepInfra and EmpirioLabs) | Yes | No |
| Grok (on OpenRouter) | Yes | No |
To find a model, filter by output type speech or transcription on the model catalog . Set the model in model, such as tts-1, gpt-4o-transcribe or Groq’s whisper-large-v3-turbo. To keep a model on one provider, prefix it, as in groq/whisper-large-v3-turbo. See Models.
Text to speech
| Option | Description |
|---|---|
voice | A voice name of the model’s provider. Required. |
response_format | mp3 (default), wav or pcm. |
Voice names differ by provider, and a provider refuses another’s names: alloy works on OpenAI models but fails on Mistral, Inworld and Grok models.
| Models | Voices, for example |
|---|---|
OpenAI (tts-1) | alloy, coral, sage |
Mistral Voxtral (voxtral-mini-tts-3.0) | en_paul_neutral, fr_marie_neutral |
Inworld (inworld-tts-2, inworld-realtime-tts-2) | Ashley, Dennis, Olivia |
Grok (grok-voice-tts-1.0) | eve, ara, rex |
The gateway prices speech by the length of the audio it makes, so it takes only the formats it can measure: mp3, wav and pcm. Any other format (such as opus, aac or flac) is refused before the request is sent, on any key.
Transcription
Transcription takes a multipart upload, as OpenAI’s API does, with the audio in file.
| Option | Description |
|---|---|
language | Language hint, where the provider takes it. Detected if left out. |
prompt | Text to guide spelling or style, where the provider takes it. |
response_format | json (default), or another format the provider offers, such as text, srt or vtt. |
For live transcription over a WebSocket, see Realtime.
Translation
Translation turns speech in any language into English text. It takes the same form as transcription, without language.
curl https://gateway.respan.ai/v1/audio/translations \
-H "Authorization: Bearer $RESPAN_API_KEY" \
-F model="whisper-1" \
-F file="@speech-fr.mp3"Pricing and logs
- Text to speech writes one
speechrow, priced per minute of audio made at the model’s unit price (per million characters sent, on OpenRouter), never per token. - Transcription writes one
transcriptionrow, priced per minute of audio sent, never per token. A transcription whose duration neither the gateway nor the provider can read costs nothing. - Respan’s credits pay for speech and transcription on any provider whose catalog entry states a unit price. Calls on Respan’s credits are held before they are sent.
- Audio calls pass the same checks as chat (limit policies, RPM, key usage cap, customer budgets).
- Audio requests are not redacted, so an organization with PII redaction on is refused for them.