Synthesize text to speech (POST)
curl -X POST https://texttospeech.responsivevoice.org/v2/text/synthesize \ -H "X-API-Key: YOUR_API_KEY" \ -H "X-API-Secret: YOUR_API_SECRET" \ -H "Content-Type: application/json" \ -d '{"text":"Hello world","voice":"US English Female"}' \ --output speech.mp3Converts text to speech audio via JSON request body. To enable real-time streaming, set the Accept: text/event-stream header — audio is streamed progressively as it is synthesized (HTTP audio streaming). Streaming requires a premium engine (gwn, msv, or oai) with BYOK credentials configured. Without the streaming header, returns complete audio as a single binary response. POST responses are not CDN-cached (Cache-Control: public, max-age=86400 only).
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Text-to-speech synthesis request
object
Available TTS service backends
Voice gender classification
Supported audio output formats
Responses
Section titled “ Responses ”Audio binary data (non-streaming) or an HTTP audio stream (when Accept: text/event-stream is set). Includes RV-Cached header, X-Streaming header for streaming responses, and RV-Prosody-Applied listing knobs the server applied upstream.
Headers
Section titled “Headers ”Comma-separated subset of {pitch, rate, volume} the server applied upstream for this call.
Comma-separated subset of {pitch, rate, volume} the server applied upstream for this call.
Maximum requests permitted for the authenticated key per minute.
Maximum requests permitted for the authenticated key per minute.
Requests remaining in the current per-minute window; 0 once the per-minute limit is reached. Reflects the per-minute limit, not the burst check — a burst 429 may report a value above 0.
Requests remaining in the current per-minute window; 0 once the per-minute limit is reached. Reflects the per-minute limit, not the burst check — a burst 429 may report a value above 0.
No content — returned when volume=0 was requested; the server skips upstream synthesis entirely.
Headers
Section titled “Headers ”Always “volume” for 204 responses.
Always “volume” for 204 responses.
Maximum requests permitted for the authenticated key per minute.
Maximum requests permitted for the authenticated key per minute.
Requests remaining in the current per-minute window; 0 once the per-minute limit is reached. Reflects the per-minute limit, not the burst check — a burst 429 may report a value above 0.
Requests remaining in the current per-minute window; 0 once the per-minute limit is reached. Reflects the per-minute limit, not the burst check — a burst 429 may report a value above 0.
Invalid synthesis request — missing required fields, invalid JSON, or parameter validation failure
API error response
object
object
Example generated
{ "error": { "message": "example", "code": "example", "statusCode": 1, "errors": "example" }}API key required
API error response
object
object
Example generated
{ "error": { "message": "example", "code": "example", "statusCode": 1, "errors": "example" }}No provider available for the requested engine, or no streaming provider for streaming requests
API error response
object
object
Example generated
{ "error": { "message": "example", "code": "example", "statusCode": 1, "errors": "example" }}Rate limit exceeded. The body code is RATE_LIMIT_EXCEEDED (per-minute tier limit) or BURST_RATE_LIMIT_EXCEEDED (per API key + client IP burst).
API error response
object
object
Example generated
{ "error": { "message": "example", "code": "example", "statusCode": 1, "errors": "example" }}Headers
Section titled “Headers ”Maximum requests permitted for the authenticated key per minute.
Maximum requests permitted for the authenticated key per minute.
Requests remaining in the current per-minute window; 0 once the per-minute limit is reached. Reflects the per-minute limit, not the burst check — a burst 429 may report a value above 0.
Requests remaining in the current per-minute window; 0 once the per-minute limit is reached. Reflects the per-minute limit, not the burst check — a burst 429 may report a value above 0.
Seconds to wait before retrying. Dynamic — varies with how far over the limit the request went; honor this header rather than assuming a fixed delay.
Seconds to wait before retrying. Dynamic — varies with how far over the limit the request went; honor this header rather than assuming a fixed delay.
Upstream TTS provider returned an error during synthesis
API error response
object
object
Example generated
{ "error": { "message": "example", "code": "example", "statusCode": 1, "errors": "example" }}