Generate an MP3
cURL
X-Request-ID and X-NinjaChat-Cost-USD.
Options
The REST API supports more audio formats than the MCP tool. Audio charges use your Developer Balance and are based on script length.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Turn text into audio through the API.
curl --fail-with-body https://www.ninjachat.ai/api/v1/audio/speech \
-H "Authorization: Bearer $NINJACHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"tts-1-hd","input":"Welcome to your next idea.","voice":"nova","response_format":"mp3"}' \
--output narration.mp3
X-Request-ID and X-NinjaChat-Cost-USD.
| Parameter | Values |
|---|---|
model | Required: tts-1 or tts-1-hd. |
input | Required: 1–4,096 characters. |
voice | Required: alloy, ash, coral, echo, fable, onyx, nova, sage or shimmer. |
response_format | mp3 (default), opus, aac, flac, wav or pcm. |
speed | 0.25–4; default 1. |