/audio/speech, and save the binary audio response.
Use this guide for standard voice generation. If you want to create speech from a custom reference voice, see Voice Cloning.
Basic Usage
tts-kokoro currently defaults to MP3.
Choose a Model and Voice
Voices are model-specific. Thevoice value must be valid for the model you choose.
Use the Text-to-Speech Models page to browse available models and voices. The voice picker lists the exact voice IDs to pass in your request.
Voice IDs are case-sensitive. If you switch TTS models, update the
voice value at the same time.Request Shape
Output Format
You can omitresponse_format to use the model’s default. Before choosing a file extension or overriding the format, query the Models API for the model’s current default_format and supported_formats:
Content-Type identifies the returned audio format. Requesting a format that the selected model does not support returns HTTP 400.
Production Tips
- Cache generated audio when the source text and voice are reused.
- Normalize and proofread text before synthesis. Punctuation affects pacing and intonation.
- Store output with the correct file extension for the model’s response format.