Text to Speech — OneHub
Text-to-speech via OpenAI. Returns raw audio bytes.
Docs
Docs Quick Start Authentication SDK Setup Available Models Rate Limits Chat Completions Streaming List Models Embeddings Image Generation Text to Speech Speech to Text Billing & Wallet Webhooks ErrorsText to Speech
POST https://www.onehub.design/v1/audio/speech
Request
curl https://www.onehub.design/v1/audio/speech \
-H "Authorization: Bearer sk-onehub-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini-tts",
"input": "Hello from OneHub!",
"voice": "alloy",
"response_format": "mp3"
}' --output speech.mp3
Parameters
| Field | Type | Description |
|---|---|---|
model | string | TTS model, e.g. gpt-4o-mini-tts |
input | string | The text to speak (max 4096 chars) |
voice | string | alloy, echo, fable, onyx, nova, shimmer |
response_format | string | mp3, opus, aac, flac, wav, pcm |
speed | number | Speed 0.25–4.0. Default: 1.0 |
The response body is the raw audio file — save it with --output or stream it directly.