Audio

Audio input, transcription, translation, and speech output through compatible OpenAI-style routes.

POSThttps://onerouter.com/v1/audio/speech

Troubleshooting

Errors carry an HTTP status and a JSON error body. See Errors & Retries for the full list.

Supported models

Speech and transcription support is model-specific — e.g. openai/gpt-audio for speech. See the Audio Models page for the current lineup.

Overview

The audio routes are compatible with OpenAI's audio API. Use /v1/audio/speech to synthesize speech from text (the response is an audio file), /v1/audio/transcriptions to convert speech to text, and /v1/audio/translations to translate spoken audio into English text. Audio-capable chat models can also accept input_audio content parts. Transcription and translation use multipart/form-data to upload the file; text-to-speech uses JSON.

Request headers

ParameterTypeRequiredDescription
Authorizationstring · requiredrequiredBearer token, formatted as `Bearer YOUR_API_KEY`.
Content-Typestring · requiredrequired`application/json` for speech; `multipart/form-data` for transcription/translation.

Routes

ParameterTypeRequiredDescription
/v1/audio/speechPOSToptionalText-to-speech for compatible speech models.
/v1/audio/transcriptionsPOSToptionalTranscribe audio when the upstream model supports it.
/v1/audio/translationsPOSToptionalTranslate audio when supported upstream.
Chat audio input/outputfeatureoptionalSome chat models accept `input_audio` content parts or return streamed audio chunks.

Text-to-speech body

ParameterTypeRequiredDescriptionValues
modelstringrequiredSpeech model ID, e.g. `openai/gpt-audio`.
inputstringrequiredThe text to synthesize into audio.
voicestringoptionalVoice preset, e.g. `alloy`, `verse` (model-dependent).
response_formatstringoptionalAudio container: `mp3`, `wav`, `opus`, `flac`, or `pcm`.
mp3wavopusflacpcm
speednumberoptionalPlayback speed multiplier when supported (e.g. 0.5–2.0).

Transcription body

ParameterTypeRequiredDescription
modelstringrequiredTranscription model ID.
filebinaryrequiredAudio file to transcribe (multipart/form-data). Common formats: mp3, wav, m4a, webm.
languagestringoptionalISO-639-1 language hint to improve accuracy.
response_formatstringoptionalOutput: `json`, `text`, `srt`, `verbose_json`, or `vtt`.

Billing

Audio billing may depend on audio duration, generated speech length, model, or upstream unit pricing. Token usage can appear in responses for some audio-capable language models, but it is not the only billing unit for audio products.