Skip to main content
WSS
wss://api.cartesia.ai
/
tts
/
websocket
Messages
cartesia_version
type:string
required

API version. Allowed values: 2024-06-10, 2024-11-13, 2025-04-16.

You can specify this instead of the Cartesia-Version header. This is particularly useful for use in the browser, where WebSockets do not support headers. You do not need to specify this if you are passing the header.

api_key
type:string
required

API key. You can specify this instead of the X-API-Key header. This is particularly useful for use in the browser, where WebSockets do not support headers. You do not need to specify this if you are passing the header.

X-API-Key
type:httpApiKey

API key passed in header

api_key
type:httpApiKey

API key passed as query parameter (useful for browser WebSockets)

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

Done Response
type:object

Generation completion signal

Word Timestamps Response
type:object

Word-level timing information

Error Response
type:object

Error information

Phoneme Timestamps Response
type:object

Phoneme-level timing information