curl -X POST "https://api.bland.ai/v1/speak" \ -H "authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "voice": "Maeve", "text": "Hello, this is a test of the text-to-speech system.", "output_format": "pcm_44100" }'
Copy
Ask AI
{ "status": "error", "errors": [ { "error": "Invalid Input", "message": "Missing text in request body - must be a string" } ]}
Text to Speech
Speak
Convert text to speech using Bland Beige
POST
https://api.bland.ai
/
v1
/
speak
Copy
Ask AI
curl -X POST "https://api.bland.ai/v1/speak" \ -H "authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "voice": "Maeve", "text": "Hello, this is a test of the text-to-speech system.", "output_format": "pcm_44100" }'
Copy
Ask AI
{ "status": "error", "errors": [ { "error": "Invalid Input", "message": "Missing text in request body - must be a string" } ]}
Enable streaming audio response for real-time playback.When true, audio is streamed as it’s generated. When false, the complete audio file is returned after generation.
curl -X POST "https://api.bland.ai/v1/speak" \ -H "authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "voice": "Maeve", "text": "Hello, this is a test of the text-to-speech system.", "output_format": "pcm_44100" }'
Copy
Ask AI
curl -X POST "https://api.bland.ai/v1/speak" \ -H "authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "voice": "Maeve", "text": "This is a streaming example that will return audio chunks as they are generated.", "output_format": "pcm_24000", "stream": true }' \ --output audio_stream.wav
Copy
Ask AI
curl -X POST "https://api.bland.ai/v1/speak" \ -H "authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "voice": "Maeve", "text": "This example uses custom voice parameters for more expressive speech.", "output_format": "pcm_16000", "consistency": 0.3, "expressiveness": 0.8 }'
Copy
Ask AI
{ "status": "error", "errors": [ { "error": "Invalid Input", "message": "Missing text in request body - must be a string" } ]}