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 Errors

Text 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

FieldTypeDescription
modelstringTTS model, e.g. gpt-4o-mini-tts
inputstringThe text to speak (max 4096 chars)
voicestringalloy, echo, fable, onyx, nova, shimmer
response_formatstringmp3, opus, aac, flac, wav, pcm
speednumberSpeed 0.25–4.0. Default: 1.0

The response body is the raw audio file — save it with --output or stream it directly.