Documentation Index
Fetch the complete documentation index at: https://docs.cartesia.ai/llms.txt
Use this file to discover all available pages before exploring further.
{
"model_id": "sonic-2",
"transcript": "Hello, world! I'm generating audio on Cartesia!",
"voice": {
"mode": "id",
"id": "a0e99841-438c-4a64-b679-ae501e7d6091"
},
"language": "en",
"context_id": "ab977222-f9e0-4563-a1c0-5a934ae8fdd6",
"output_format": {
"container": "raw",
"encoding": "pcm_s16le",
"sample_rate": 8000
},
"add_timestamps": true,
"continue": false
}{
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79",
"cancel": true
}{
"type": "chunk",
"data": "aSDinaTvuI8gbWludGxpZnk=",
"done": false,
"status_code": 206,
"step_time": 123,
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79"
}{
"type": "flush_done",
"done": false,
"flush_done": true,
"flush_id": 1,
"status_code": 206,
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79"
}{
"type": "done",
"done": true,
"status_code": 206,
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79"
}{
"type": "timestamps",
"done": false,
"status_code": 206,
"context_id": "872ec12d-bc63-4e1e-a241-4f58c879d105",
"word_timestamps": {
"words": [
"Hello",
"world"
],
"start": [
0,
0.5
],
"end": [
0.4,
0.9
]
}
}{
"type": "phoneme_timestamps",
"done": false,
"status_code": 206,
"context_id": "872ec12d-bc63-4e1e-a241-4f58c879d105",
"phoneme_timestamps": {
"phonemes": [
"h",
"ə",
"l",
"oʊ"
],
"start": [
0.093,
0.174,
0.255,
0.337
],
"end": [
0.174,
0.255,
0.337,
0.418
]
}
}{
"type": "error",
"done": true,
"error": "Invalid model: The model is not valid, make sure it is a valid model ID.",
"status_code": 400,
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79"
}{
"model_id": "sonic-2",
"transcript": "Hello, world! I'm generating audio on Cartesia!",
"voice": {
"mode": "id",
"id": "a0e99841-438c-4a64-b679-ae501e7d6091"
},
"language": "en",
"context_id": "ab977222-f9e0-4563-a1c0-5a934ae8fdd6",
"output_format": {
"container": "raw",
"encoding": "pcm_s16le",
"sample_rate": 8000
},
"add_timestamps": true,
"continue": false
}{
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79",
"cancel": true
}{
"type": "chunk",
"data": "aSDinaTvuI8gbWludGxpZnk=",
"done": false,
"status_code": 206,
"step_time": 123,
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79"
}{
"type": "flush_done",
"done": false,
"flush_done": true,
"flush_id": 1,
"status_code": 206,
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79"
}{
"type": "done",
"done": true,
"status_code": 206,
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79"
}{
"type": "timestamps",
"done": false,
"status_code": 206,
"context_id": "872ec12d-bc63-4e1e-a241-4f58c879d105",
"word_timestamps": {
"words": [
"Hello",
"world"
],
"start": [
0,
0.5
],
"end": [
0.4,
0.9
]
}
}{
"type": "phoneme_timestamps",
"done": false,
"status_code": 206,
"context_id": "872ec12d-bc63-4e1e-a241-4f58c879d105",
"phoneme_timestamps": {
"phonemes": [
"h",
"ə",
"l",
"oʊ"
],
"start": [
0.093,
0.174,
0.255,
0.337
],
"end": [
0.174,
0.255,
0.337,
0.418
]
}
}{
"type": "error",
"done": true,
"error": "Invalid model: The model is not valid, make sure it is a valid model ID.",
"status_code": 400,
"context_id": "50dc3b5e-5841-4aa1-9f94-60cfb9aead79"
}API version, e.g. 2024-11-13.
You can specify this instead of the Cartesia-Version header. This is particularly useful in the browser, where WebSockets do not support headers. You do not need to specify this if you are passing the header.
API key passed in a header.
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.
Use this to generate speech for a transcript.
Use this to cancel a context, so that no more messages are generated for that context.
Audio data chunk
Acknowledgment that flush command was received
Generation completion signal
Word-level timing information
Phoneme-level timing information
Error information for TTS WebSocket connections.
Documentation Index
Fetch the complete documentation index at: https://docs.cartesia.ai/llms.txt
Use this file to discover all available pages before exploring further.
Was this page helpful?