Skip to main content
WSS
/
tts
/
websocket
Messages
cartesia_version
type:string
required

API version, e.g. 2024-11-13

X-API-Key
type:httpApiKey

API key passed in a header.

access_token
type:httpApiKey

A short-lived access token passed in a query param to make API requests from a client. This is particularly useful in the browser, where WebSockets do not support headers. See Authenticate client apps to generate an access token.

Generation Request
type:object

Use this to generate speech for a transcript.

Cancel Context Request
type:object

Use this to cancel a context, so that no more messages are generated for that context.

Audio Chunk Response
type:object

Audio data chunk

Flush Done Response
type:object

Acknowledgment that flush command was received. See Context Flushing for details.

Done Response
type:object

Generation completion signal

Word Timestamps Response
type:object

Word-level timing information

Phoneme Timestamps Response
type:object

Phoneme-level timing information

Error Response
type:object

Error information for TTS WebSocket connections.