Text to speech

Synthesize audio from text

POST /v1/audio/speech synthesizes audio from text. The response body is the audio (MP3 by default): no JSON wrapper, no decoding step.

$curl -X POST https://api-gateway.merge.dev/v1/audio/speech \
> -H "Authorization: Bearer $MERGE_GATEWAY_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "model": "openai/tts-1",
> "input": "Hello from Merge Gateway.",
> "voice": "alloy"
> }' \
> -o speech.mp3

Voices

OpenAI-style voice names (alloy, nova, and the rest) work across vendors: Gateway maps them to a native voice on non-OpenAI models. Minimax models also accept their own native voice ids. An unsupported voice returns a provider error.

Pricing

Speech bills per input character (unit: per_character on GET /v1/models). A higher-quality model like openai/tts-1-hd costs more per character than openai/tts-1; the exact rates are on the model’s pricing block.

Next steps