Speech (OpenAI-compatible)
HTTP Speech
Speech (OpenAI-compatible)
Use Bland voices through the OpenAI text-to-speech request and error shapes.
POST
Speech (OpenAI-compatible)
Overview
This endpoint implements OpenAI’s/audio/speech contract. If you already use an OpenAI SDK or a compatible router such as LiteLLM, change the base URL, API key, and model to route speech through Bland.
Headers
string
required
Bearer <your API key>. OpenAI SDKs send this from their api_key or apiKey configuration.Body parameters
string
required
btts-3 or btts-2.OpenAI model IDs such as tts-1 and gpt-4o-mini-tts are not aliased. Unknown IDs return 400 with code model_not_found.The model must match the selected Bland voice. A mismatch returns 400 with code model_voice_mismatch.string
required
Non-empty text to speak. Maximum 4,096 characters.
string
required
A recognized OpenAI voice name, mapped to a Bland core voice, or a Bland voice UUID for the full catalog.
Names are case-insensitive. An unrecognized name returns
400.string
default:"mp3"
mp3, opus, aac, flac, wav, or pcm.pcm is raw 24 kHz signed 16-bit little-endian mono audio. The other formats use a 48 kHz render and include their normal file or stream framing.number
default:"1.0"
Only
1.0 is accepted. Other values return 400 because Bland does not currently expose speed control on this endpoint.string
default:"audio"
Only
audio is supported. sse returns 400.string
Accepted and ignored. This OpenAI field has no Bland equivalent.
Response
The response body contains audio bytes.Content-Type matches the requested format:
MP3, Opus, AAC, FLAC, and raw PCM can begin streaming before synthesis completes. WAV is buffered until its final RIFF header length is known.
string
Unique request ID. Include it in support requests.
Errors
Errors use OpenAI’s envelope so SDK error handling remains readable:Examples
Docs for agents: llms.txt