Skip to content

Text to Speech (OpenAI Native Format)

Synthesize text into speech and return a binary audio stream. See also Transcriptions, Translations, and the Gemini native format.

Endpoint

POST /v1/audio/speech

Request parameters

ParameterTypeRequiredDescription
modelstringYesTTS model, e.g. tts-1
inputstringYesText to synthesize
voicestringYesVoice, e.g. alloy
response_formatstringNomp3 (default) / opus / aac / flac / wav
speednumberNoSpeed, 0.254.0, default 1.0

Request example

bash
curl https://ai.youqi.tech/v1/audio/speech \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Hello, welcome to YouQi AI.",
    "voice": "alloy"
  }' \
  --output speech.mp3

TIP

Availability depends on the selected model. The response is a raw binary audio stream — save or play the response body directly.