Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Cartesia TTS WebSocket API

Bidirectional, multiplexed WebSocket at wss://api.cartesia.ai/tts/websocket for realtime speech generation. Clients send JSON generation requests keyed by a context_id (continuing a context preserves prosody across chunks of transcript) and receive base64-encoded audio chunks, optional word and phoneme timestamps, flush acknowledgements, and a final done message. A single connection scales to dozens of concurrent generation contexts.

Cartesia TTS WebSocket API is one of 21 APIs that Cartesia publishes on the APIs.io network, described by an AsyncAPI event-driven specification.

Tagged areas include WebSocket, Text to Speech, Realtime, and Streaming. The published artifact set on APIs.io includes API documentation and an AsyncAPI specification.

This event API exposes 4 operations across 2 channels, and defines 24 schemas. It is described by AsyncAPI 2.6.0, at version 2026-03-01.

The API connects through 2 servers: api.cartesia.ai/tts/websocket?cartesia_version=2026-03-01 (wss), api.cartesia.ai/stt/websocket?model=ink-whisper&encoding=pcm_s16le&sample_rate=16000&cartesia_version=2026-03-01 (wss).

4 operations 2 channels 24 schemas

Metadata

The identity and technical contract details declared by the specification.

Specification
AsyncAPI 2.6.0
API Version
2026-03-01
Base URL
wss://api.cartesia.ai
Resource Areas
1

Channels & Operations 4

Across 2 channels, the API surfaces 4 operations. Each is listed below with its action, channel, parameters, and response codes.

Channels 4
SUB
/tts/websocket
Receive audio chunks, timestamps, and control messages for a context.
receiveTtsStreamEvents body
PUB
/tts/websocket
Send a TTS generation (or cancel) request.
sendTtsGenerationRequest body
SUB
/stt/websocket
Receive incremental/final transcripts and control messages.
receiveSttTranscripts body
PUB
/stt/websocket
Stream binary audio frames and send finalize/close commands.
sendSttAudioAndCommands body

Messages & Schemas 24

The contract defines 24 schemas that model the data carried by its messages. The most detailed are TtsGenerationRequestPayload (13 properties), ErrorPayload (9 properties), TtsAudioChunkPayload (6 properties), FlushDonePayload (6 properties). Each schema is shown below with its type and property counts.

TtsGenerationRequest
message
TtsCancelRequest
message
TtsAudioChunk
message
TtsWordTimestamps
message
TtsPhonemeTimestamps
message
TtsFlushDone
message
TtsDone
message
TtsError
message
SttAudioFrame
message
SttFinalizeCommand
message
SttCloseCommand
message
SttTranscript
message
SttFlushDone
message
SttDone
message
SttError
message
TtsGenerationRequestPayload
object
13 properties 5 required
TtsCancelRequestPayload
object
2 properties 2 required
TtsAudioChunkPayload
object
6 properties 3 required
TtsWordTimestampsPayload
object
5 properties 2 required
TtsPhonemeTimestampsPayload
object
5 properties 2 required
FlushDonePayload
object
6 properties 2 required
DonePayload
object
4 properties 3 required
ErrorPayload
object
9 properties 3 required
SttTranscriptPayload
object
5 properties 3 required

Specification

The full machine-readable AsyncAPI contract behind this narrative.

Source

cartesia-ai-asyncapi.yml Raw ↑

Other APIs Cartesia publishes across the network.

Cartesia STT WebSocket API
Cartesia Agents API
Cartesia API Keys API
Cartesia Auth API
Cartesia Calls API
Cartesia Datasets API
Cartesia Deployments API
Cartesia Infill API
Cartesia Knowledge Base API
Cartesia Metrics API
Cartesia Phone Numbers API
Cartesia Pronunciation Dictionaries API