Skip to main content
POST
Synthesize speech from text

Authorizations

Authorization
string
header
required

Gateway API key (imp-rt-...) from POST /v1/accounts or /v1/keys.

Body

application/json
model
enum<string>
required
Available options:
xai/grok-voice-tts-1.0,
google/gemini-3.1-flash-tts-preview
input
string
required

Text to speak. Both models accept inline expressive tags.

voice
string
required

A voice id the chosen model supports (see GET /v1/models).

Example:

"eve"

response_format
enum<string>

Defaults to the model's native format: mp3 for xai, wav for google. A format the model cannot produce is a 400, never a substitution.

Available options:
mp3,
wav,
pcm
speed
number
default:1

Playback rate, xai/grok-voice-tts-1.0 only. Gemini has no rate control, so any value other than 1 is a 400 there rather than a silently ignored parameter.

Required range: 0.7 <= x <= 1.5

Response

The synthesized audio.

The response is of type file.