Generate Speech
Turn text into spoken audio through nRouter with one POST to /v1/audio/speech, using the same key, budgets, and request logs as your chat traffic.
Synthesize natural spoken audio from text using a single POST request to /v1/audio/speech, delivering raw audio binaries under unified API keys and budgets.
Request Syntax & Options
Synthesize audio binaries via /v1/audio/speech:
curl -X POST https://api.nrouter.ai/v1/audio/speech \
-H "Authorization: Bearer $NROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "tts-1", "input": "Your order has shipped.", "voice": "onyx", "response_format": "mp3"}' \
--output speech.mp3- Voices:
alloy,echo,fable,onyx,nova, andshimmer. - Options:
speed(0.25–4.0, default1.0), up to 4,096 characters per call (larger inputs return 400). - Formats:
mp3(default),opus(streaming),aac(Apple),flac(lossless),wav(PCM), andpcm(raw 24 kHz).
Charges settle at list price in request logs via x-nr-request-cost. See Audio Speech API, Generate Images, and Errors & Rate Limits.
Frequently asked questions
Which voices can I use?
Available voices include alloy, echo, fable, onyx, nova, and shimmer per the Audio Speech reference.
Which audio formats are supported?
mp3 is default, with opus, aac, flac, wav, and pcm selectable via response_format.
What if my text is longer than 4,096 characters?
Requests over 4,096 characters return HTTP 400; divide text into smaller chunks and concatenate resulting audio.
Do I need a separate key for speech?
No; one virtual key and credit balance covers text, audio, image, and video endpoints.