Audio Speech
Synthesize speech from text (TTS) and return an audio file, compatible with the OpenAI Audio Speech API.
Basics
MethodPOST
Endpointhttps://koprouter.kopglobal.com/v1/audio/speech
AuthenticationAuthorization: Bearer sk-...
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | TTS model ID |
input |
string | Yes | Text to synthesize |
voice |
string | Yes | Voice, e.g. alloy, echo |
response_format |
string | No | Audio format, e.g. mp3, wav |
speed |
number | No | Playback speed multiplier |
Example Request
curl https://koprouter.kopglobal.com/v1/audio/speech \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID",
"input": "Hello, welcome to KOPRouter.",
"voice": "alloy"
}' \
--output speech.mp3
Response
On success the endpoint returns the raw audio binary stream — write it to a local file to play it.