Documentation
Text-to-Speech
POST /v1/audio/speech converts text into spoken audio.
Use it when
- You need voice playback in an app
- You want narration, announcements, or assistant voice output
Code examples
1curl -X POST https://api.navy/v1/audio/speech \
2 -H "Authorization: Bearer sk-navy-YOUR_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "gpt-4o-mini-tts",
6 "voice": "alloy",
7 "input": "Welcome to the NavyAI platform."
8 }' \
9 --output speech.mp3Parameters
model(string, required) —tts-1,tts-1-hd,eleven_v3,gpt-4o-mini-tts,gemini-2.5-flash-preview-ttsinput(string, required) — Text to convert (max 4096 chars for ElevenLabs)voice(string, required) — Voice ID. OpenAI:alloy,ash,coral,echo,fable,nova,onyx,sage,shimmer. ElevenLabs:alice,aria,brian,charlie,jessica, etc. Gemini:Puck,Charon,Kore,Fenrir,Aoedespeed(number, optional) — 0.25–4.0 (OpenAI only)response_format(string, optional) —mp3,opus,aac,flac
Notes
- Response formats depend on model capabilities
- Keep text chunks moderate if you need responsive playback