Audio
Synthesize speech.
Synthesize up to 5000 characters and return the full audio as base64 with sentence-level speech marks. When language is omitted it is detected from the input, the same way as document creation. Supports Idempotency-Key for safe retries. A client disconnect mid-generation settles delivered audio and answers 204.
Authorization
ApiKeyAuth API key from Settings > API, prefixed with sh_live_.
In: header
Header Parameters
Optional retry key. Replaying the same key with the same body returns the first successful response for 24 hours. Oversized speech responses cannot be replayed and answer 409 instead of regenerating. Not supported on streaming audio endpoints.
1 <= length <= 256Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/audio/speech" \ -H "Content-Type: application/json" \ -d '{ "input": "string", "voice_id": "string" }'{ "audio_data": "string", "audio_format": "wav", "billable_characters_count": 0, "billed_credits": 0, "duration_ms": 0, "language": "string", "voice_id": "string", "speech_marks": [ { "type": "sentence", "value": "string", "start": 0, "end": 0, "start_time": 0, "end_time": 0 } ]}Stream a single WAV body: a streaming header followed by the PCM of each sentence as it is generated. Audio already delivered is billed if the client disconnects mid-stream. A WAV body cannot carry an error payload, so a mid-stream failure simply closes the connection.
Authorization
ApiKeyAuth API key from Settings > API, prefixed with sh_live_.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
audio/wav
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/audio/stream" \ -H "Content-Type: application/json" \ -d '{ "input": "string", "voice_id": "string" }'"string"Server-sent events. Each speech.chunk carries one sentence as base64 WAV with its speech mark; speech.done closes a successful run and is only sent after usage was recorded. speech.error reports a mid-stream generation or billing failure. Audio already delivered is billed if the client disconnects.
Authorization
ApiKeyAuth API key from Settings > API, prefixed with sh_live_.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
text/event-stream
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/audio/stream/with-timestamps" \ -H "Content-Type: application/json" \ -d '{ "input": "string", "voice_id": "string" }'null