Choose a TTS model
| Model | Best for | Input limit | Verified price |
|---|---|---|---|
gpt-4o-mini-tts | Controllable delivery with instructions | 4,096 characters; 2,000 model tokens | $0.60 / 1M text tokens + $12 / 1M audio tokens |
tts-1-hd | Legacy HD TTS compatibility | 4,096 characters | $30 / 1M characters |
Audio created by these models is AI-generated. Tell end users that the voice is synthetic when you publish or play it.
gpt-4o-mini-tts
Use instructions to describe tone, pace, accent or emotion. The request below returns MP3 bytes; --output prevents curl from printing binary data to your terminal.
curl https://api-models.com/v1/audio/speech \
-H "Authorization: Bearer $API_MODELS_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini-tts",
"input": "Your order is ready for pickup.",
"voice": "marin",
"instructions": "Speak warmly, clearly, and at a relaxed pace.",
"response_format": "mp3",
"speed": 1.0
}' \
--output speech.mp3import os
import requests
response = requests.post(
"https://api-models.com/v1/audio/speech",
headers={"Authorization": f"Bearer {os.environ['API_MODELS_KEY']}"},
json={
"model": "gpt-4o-mini-tts",
"input": "Your order is ready for pickup.",
"voice": "marin",
"instructions": "Speak warmly, clearly, and at a relaxed pace.",
"response_format": "mp3",
},
timeout=120,
)
response.raise_for_status()
with open("speech.mp3", "wb") as output:
output.write(response.content)import { writeFile } from "node:fs/promises";
const response = await fetch("https://api-models.com/v1/audio/speech", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_MODELS_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-4o-mini-tts",
input: "Your order is ready for pickup.",
voice: "marin",
instructions: "Speak warmly, clearly, and at a relaxed pace.",
response_format: "mp3",
}),
});
if (!response.ok) throw new Error(await response.text());
await writeFile("speech.mp3", Buffer.from(await response.arrayBuffer()));tts-1-hd
Use the same endpoint without instructions. Compatibility voices alloy, echo, fable, onyx, nova and shimmer are the safe choice for this upstream; nova and alloy were exercised in live requests.
curl https://api-models.com/v1/audio/speech \
-H "Authorization: Bearer $API_MODELS_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1-hd",
"input": "A high-quality compatibility voice sample.",
"voice": "nova",
"response_format": "wav",
"speed": 0.9
}' \
--output speech.wavParameters and output formats
| Field | Requirement | Notes |
|---|---|---|
model | Required | gpt-4o-mini-tts or tts-1-hd |
input | Required | Maximum 4,096 characters |
voice | Required | Use a voice compatible with the selected model |
instructions | gpt-4o-mini-tts only | Controls delivery; not supported by tts-1-hd |
response_format | Optional | mp3, opus, aac, flac, wav, pcm; default mp3 |
speed | Optional | 0.25 to 4.0; default 1.0 |
The gateway currently documents normal binary responses only. Do not add stream_format=sse; it is not part of the verified compatibility surface.
Common errors
| Symptom | Fix |
|---|---|
| Chat completion error | Use /v1/audio/speech, not /v1/chat/completions |
| Empty or corrupt file | Save the binary response and check response.ok before writing |
| Unsupported voice behavior | Use the compatibility voices listed for tts-1-hd |
| instructions rejected | Remove it from tts-1-hd requests |