Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
OpenAITTS
Text-to-speech with OpenAI voices such as marin and cedar. Choose gpt-4o-mini-tts when you want to steer tone and style with plain-language instructions. Authenticates with OPENAI_API_KEY from your environment, or an explicitapi_key.
Fields
str
default:"UNSET"
Voice model, e.g. “gpt-4o-mini-tts” (supports instructions), “tts-1” (low latency) or “tts-1-hd” (higher quality). Defaults to ‘gpt-4o-mini-tts’.
str | dict[str, str]
default:"UNSET"
Built-in voice name, e.g. “marin”, “cedar”, “ash” or “coral”, or {“id”: “voice_…”} for a custom voice. “marin” and “cedar” sound best. Defaults to ‘ash’.
float
default:"UNSET"
Speaking rate multiplier, 0.25 to 4.0. Defaults to 1.0.
str | None
default:"UNSET"
Plain-language style direction, e.g. “Speak in a cheerful tone”. Only gpt-4o-mini-tts uses it. Defaults to None (not set).
str | None
default:"UNSET"
ISO language hint, e.g. “hi” or “fr”. Helps with non-English text or custom voices. Defaults to None (not set).
str | None
default:"UNSET"
Custom OpenAI API base URL, e.g. for a proxy. Defaults to None (not set).
str
default:"UNSET"
Audio format requested from OpenAI, e.g. “pcm”. Defaults to ‘pcm’.
bool
default:"UNSET"
Synthesize each sentence chunk as it arrives instead of the whole reply at once. Faster start on very long replies, but less natural prosody. Defaults to False.