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/speechRequest parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | TTS model, e.g. tts-1 |
input | string | Yes | Text to synthesize |
voice | string | Yes | Voice, e.g. alloy |
response_format | string | No | mp3 (default) / opus / aac / flac / wav |
speed | number | No | Speed, 0.25–4.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.mp3TIP
Availability depends on the selected model. The response is a raw binary audio stream — save or play the response body directly.