# Cartesia Docs - [API (214 pages)](https://docs.cartesia.ai/_llms/en/api.txt): Documentation for API. ## Models ### Get started #### Overview - [Welcome to Cartesia](https://docs.cartesia.ai/get-started/overview.md): Cartesia is an AI lab building real-time voice models and agents. #### Start building - [Realtime Text-to-Speech Quickstart](https://docs.cartesia.ai/get-started/realtime-text-to-speech-quickstart.md): Stream text to Cartesia over a WebSocket and receive audio in real time. - [Realtime Speech-to-Text Quickstart](https://docs.cartesia.ai/get-started/realtime-speech-to-text-quickstart.md): Stream audio to Ink 2 and receive transcripts in real time. - [Authenticate your applications](https://docs.cartesia.ai/get-started/authenticate-your-client-applications.md): Use access tokens in browsers and API keys on servers - [Pricing](https://docs.cartesia.ai/pricing.md): How Cartesia charges for usage #### Developers - [Client Libraries](https://docs.cartesia.ai/tools/client-libraries.md): Use the official JavaScript/TypeScript and Python SDKs to call the Cartesia API. - [AI Agent Guide](https://docs.cartesia.ai/tools/ai/agent-guide.md): Setup your agents with Cartesia skills, MCP, and docs - [Agent Skills](https://docs.cartesia.ai/tools/ai/agent-skills.md): Teach your agents how to build with Cartesia - [MCP](https://docs.cartesia.ai/tools/ai/mcp.md): Connect Cartesia MCP in Cursor or Claude Code to run TTS, STT, voices, and pronunciation dictionaries from your agent. - [LLMs documentation files](https://docs.cartesia.ai/tools/ai/llms-txt.md): Machine-readable index files for assistants and tooling that ingest Cartesia documentation. #### Integrations - [Integrations](https://docs.cartesia.ai/integrations/overview.md) - [Partner Integrations](https://docs.cartesia.ai/integrations/partners.md): Official Cartesia integrations on third-party platforms - [LiveKit](https://docs.cartesia.ai/integrations/live-kit.md): Realtime rooms and agents via the Cartesia plugin or LiveKit Inference - [Pipecat](https://docs.cartesia.ai/integrations/pipecat.md): Voice and multi-modal agents with official Cartesia TTS/STT services ##### Community - [Community Integrations](https://docs.cartesia.ai/integrations/community/index.md): Integrations built and maintained by third-party developers - [Anam + Cartesia](https://docs.cartesia.ai/integrations/community/anam-cartesia.md): Use a Cartesia Sonic TTS voice in an Anam interactive avatar session - [Genesys + Cartesia Sonic](https://docs.cartesia.ai/integrations/community/genesys-tts-connector.md): Configure the Genesys TTS Connector integration to synthesize speech with Cartesia - [LiveAvatar + Cartesia](https://docs.cartesia.ai/integrations/community/liveavatar-cartesia.md): Drive a LiveAvatar (by HeyGen) interactive avatar with a Cartesia Sonic TTS voice - [TrueFoundry + Cartesia](https://docs.cartesia.ai/integrations/community/truefoundry.md): Route Cartesia TTS and STT through TrueFoundry's AI Gateway - [Rasa](https://docs.cartesia.ai/integrations/rasa.md): Voice assistants with Cartesia as the TTS backend - [Tencent RTC](https://docs.cartesia.ai/integrations/tencent-rtc.md): Realtime media with Cartesia for conversational AI workloads - [Thoughtly](https://docs.cartesia.ai/integrations/thoughtly.md): No-code phone agents - [Twilio](https://docs.cartesia.ai/integrations/twilio.md): Call a phone with speech synthesized by Sonic - [Bandwidth + Cartesia](https://docs.cartesia.ai/integrations/community/bandwidth-cartesia.md): Run a two-way voice agent on a Bandwidth phone call with Cartesia Ink 2 speech-to-text and Sonic text-to-speech - [Vision Agents by Stream](https://docs.cartesia.ai/integrations/vision-agents-by-stream.md): Agent framework with a Cartesia TTS plugin ### Text-to-Speech #### Sonic - [Sonic 3.6](https://docs.cartesia.ai/build-with-cartesia/tts-models/latest.md) - [Build with Sonic](https://docs.cartesia.ai/build-with-cartesia/capability-guides/tts.md) #### Choose a voice - [Choosing a Voice](https://docs.cartesia.ai/build-with-cartesia/capability-guides/choosing-a-voice.md): How to pick the best voice for your Voice Agents - [Multilingual Voices](https://docs.cartesia.ai/build-with-cartesia/capability-guides/multilingual-voices.md): Reach a global audience with one voice that speaks multiple languages and accents. - [Instant Voice Clone](https://docs.cartesia.ai/build-with-cartesia/capability-guides/clone-voices.md): Create a custom voice in seconds from a short recording - [Pro Voice Clone](https://docs.cartesia.ai/build-with-cartesia/capability-guides/clone-voices-pro.md): Create a near-exact voice replica, trained on 30+ minutes of your audio #### Control the voice - [Prompting tips](https://docs.cartesia.ai/build-with-cartesia/capability-guides/prompting-tips.md): Get natural-sounding output from Sonic with minimal prompt engineering. - [Custom Pronunciations](https://docs.cartesia.ai/build-with-cartesia/capability-guides/custom-pronunciations.md): Specify custom pronunciations for words that are hard to get right, like proper nouns or domain-specific terms. - [Text Normalization](https://docs.cartesia.ai/build-with-cartesia/capability-guides/text-normalization.md): Control how written text becomes spoken text, and debugging tips. - [Volume, Speed, and Emotion](https://docs.cartesia.ai/build-with-cartesia/capability-guides/volume-speed-emotion.md): Control the speed, volume, and emotion of generated speech. - [SSML Tags](https://docs.cartesia.ai/build-with-cartesia/capability-guides/ssml-tags.md): Laughter, pauses, and mid-transcript controls - [Advanced capabilities](https://docs.cartesia.ai/build-with-cartesia/capability-guides/advanced-capabilities.md): Use Hinglish code-switching and text normalizers to control how Sonic speaks specialized content. #### Streaming - [Compare TTS Endpoints](https://docs.cartesia.ai/use-the-api/compare-tts-endpoints.md): How bytes, SSE, and WebSocket differ for text-to-speech, and when to use each. - [Stream Inputs using Continuations](https://docs.cartesia.ai/build-with-cartesia/capability-guides/stream-inputs-using-continuations.md): Learn how to stream input text to Sonic TTS - [Contexts and Continuations](https://docs.cartesia.ai/use-the-api/tts-websocket/contexts.md): Generating audio from partial transcripts - [Context Flushing and Flush IDs](https://docs.cartesia.ai/use-the-api/tts-websocket/context-flushing-and-flush-i-ds.md): Separating a continuation into multiple parts - [Buffering](https://docs.cartesia.ai/use-the-api/tts-websocket/buffering.md): Control how text is buffered before speech generation to balance prosody and latency #### Audio output - [Output Format](https://docs.cartesia.ai/build-with-cartesia/capability-guides/tts-output-audio-format.md): How to find the right parameters for output audio - [Caching Audio for Stock Responses](https://docs.cartesia.ai/build-with-cartesia/capability-guides/tts-caching.md): Pre-generate stock TTS phrases as raw PCM, then interleave them with live WebSocket audio to cut latency and credits #### Older models - [Sonic 3.5](https://docs.cartesia.ai/build-with-cartesia/tts-models/sonic-3-5.md) - [Migrating from Sonic 3 to Sonic 3.5](https://docs.cartesia.ai/build-with-cartesia/tts-models/sonic-3-to-sonic-3-5.md): What's new in Sonic 3.5 and what to know before you switch. - [Older Models](https://docs.cartesia.ai/build-with-cartesia/tts-models/older-models.md) - [Deprecated Models](https://docs.cartesia.ai/build-with-cartesia/tts-models/api-changes.md) ### Speech-to-Text - [Ink 2](https://docs.cartesia.ai/build-with-cartesia/stt/latest.md) - [Older Models](https://docs.cartesia.ai/build-with-cartesia/stt/older-models.md) #### Guides - [Build with Ink](https://docs.cartesia.ai/build-with-cartesia/stt/guides.md) - [Turn Detection](https://docs.cartesia.ai/use-the-api/stt/turns.md): Detect user turns automatically, no separate VAD required - [Keyterm Prompting](https://docs.cartesia.ai/use-the-api/stt/keyterms.md): Improve transcription accuracy for specific words and phrases - [Compare STT Endpoints](https://docs.cartesia.ai/use-the-api/stt/compare-endpoints.md): There are 3 ways to integrate with Cartesia's speech-to-text API - [Audio Input](https://docs.cartesia.ai/build-with-cartesia/stt/audio-input.md): How to find the right encoding and sample rate for realtime audio - [Migration Guides](https://docs.cartesia.ai/use-the-api/stt/migrations.md): The differences between Ink and other models ##### Troubleshooting - [Troubleshooting](https://docs.cartesia.ai/use-the-api/stt/troubleshooting/index.md): Transcription errors, high latency, server errors - [Realtime STT (Auto)](https://docs.cartesia.ai/use-the-api/stt/troubleshooting/auto.md): Transcript errors, high latency, and server errors for `/stt/turns/websocket` - [Realtime STT (Manual)](https://docs.cartesia.ai/use-the-api/stt/troubleshooting/manual.md): Transcript errors, high latency, and server errors for `/stt/websocket` ## Agents ### Get started - [Managed Agents](https://docs.cartesia.ai/agents/introduction.md): Create and run realtime voice agents with Cartesia. ### Agent management - [Agent configuration](https://docs.cartesia.ai/agents/configuration.md): Configure how an agent behaves, listens, speaks, and acts. - [Dynamic variables](https://docs.cartesia.ai/agents/dynamic-variables.md): Personalize each call with customer data and values from your tools. - [LLMs](https://docs.cartesia.ai/agents/models.md): Choose the LLM that generates agent responses. ### Tools - [Tools](https://docs.cartesia.ai/agents/tools.md): Give an agent actions it can invoke during a call. - [System tools](https://docs.cartesia.ai/agents/system-tools.md): Configure built-in actions for calls and telephony. - [Webhook tools](https://docs.cartesia.ai/agents/webhook-tools.md): Let an agent call an HTTPS endpoint on your server. - [Client tools](https://docs.cartesia.ai/agents/client-tools.md): Run functions in your application over the WebSocket API. ### Audio integration - [Audio integration](https://docs.cartesia.ai/line/integrations/overview.md): Connect an application or phone number to an agent. - [WebSocket API](https://docs.cartesia.ai/line/integrations/websocket-api.md): Stream audio and events between your application and an agent. ### Telephony - [Phone numbers](https://docs.cartesia.ai/line/integrations/telephony/phone-numbers.md): Connect phone numbers to your agents for inbound and outbound calls. - [Cartesia numbers](https://docs.cartesia.ai/line/integrations/telephony/cartesia-numbers.md): Provision and manage Cartesia phone numbers for your agents. - [Twilio integration](https://docs.cartesia.ai/line/integrations/telephony/twilio/integration.md): Import phone numbers from your Twilio account. - [Regional routing](https://docs.cartesia.ai/line/integrations/telephony/twilio/regional-routing.md): How Twilio regions affect call routing and credential scoping. - [SIP trunking](https://docs.cartesia.ai/line/integrations/telephony/sip-trunking.md): Connect a SIP trunk to use your own carrier with Cartesia agents. - [Outbound calling](https://docs.cartesia.ai/line/integrations/telephony/outbound-dialing.md) - [Batch calling](https://docs.cartesia.ai/line/integrations/telephony/batch-calling.md) ### Evaluations - [Metrics](https://docs.cartesia.ai/line/evaluations/metrics.md): Measure agent performance on completed calls. - [Results](https://docs.cartesia.ai/line/evaluations/results.md): Review and export metric results for completed calls. ### Migration - [Migrate from the Line SDK](https://docs.cartesia.ai/agents/migrate-from-line-sdk.md): Move a Line SDK agent to Managed Agents, feature by feature. ## Examples ### Text-to-Speech (WebSocket) - [WebSocket Basic](https://docs.cartesia.ai/examples/tts-websocket-basic.md): Basic WebSocket usage with websocket_connect() context manager. - [WebSocket with Input Continuations](https://docs.cartesia.ai/examples/tts-websocket-continuations.md): Streaming a transcript split into multiple parts, using continuations. - [WebSocket Flushing](https://docs.cartesia.ai/examples/tts-websocket-flushing.md): Demonstrates manual flushing to separate audio from different transcripts. - [WebSocket Emotion Control](https://docs.cartesia.ai/examples/tts-websocket-emotion.md): Demonstrates changing emotion mid-stream using generation_config. - [WebSocket Speed Control](https://docs.cartesia.ai/examples/tts-websocket-speed.md): Demonstrates changing speed mid-stream using generation_config. - [WebSocket Concurrent Contexts](https://docs.cartesia.ai/examples/tts-websocket-concurrent-contexts.md): Two contexts on one connection, each using ctx.receive() to get their own audio. - [WebSocket Response Handling](https://docs.cartesia.ai/examples/tts-websocket-response-handling.md): WebSocket response type handling. ### Text-to-Speech (SSE) - [SSE Streaming](https://docs.cartesia.ai/examples/tts-sse-basic.md): Basic SSE streaming. - [SSE with Word Timestamps](https://docs.cartesia.ai/examples/tts-sse-with-timestamps.md): SSE streaming with word timestamps. - [SSE with Phoneme Timestamps](https://docs.cartesia.ai/examples/tts-sse-with-phoneme-timestamps.md): SSE streaming with phoneme timestamps. ### Text-to-Speech (Batch) - [Generate to File](https://docs.cartesia.ai/examples/tts-generate-to-file.md): Use generate() and write_to_file() to write a wav file. - [Create Infill Audio](https://docs.cartesia.ai/examples/infill-create.md): Create infill audio between two clips. ### Speech-to-Text - [Realtime STT (Auto)](https://docs.cartesia.ai/examples/stt-auto-finalize-websocket.md): Realtime transcription with native turn detection — recommended for voice agents. - [Realtime STT (Manual)](https://docs.cartesia.ai/examples/stt-manual-finalize-websocket.md): Realtime transcription where you control the user turn. Recommended for push-to-talk apps. - [Batch STT](https://docs.cartesia.ai/examples/stt-transcribe.md): Transcribe pre-recorded audio files. ### Voices - [List Voices](https://docs.cartesia.ai/examples/voices-list.md): List voices with pagination. - [Get a Voice](https://docs.cartesia.ai/examples/voices-get.md): Get a specific voice. - [Clone a Voice](https://docs.cartesia.ai/examples/voices-clone.md): Clone a voice from an audio clip. - [Update a Voice](https://docs.cartesia.ai/examples/voices-update.md): Update a voice. - [Delete a Voice](https://docs.cartesia.ai/examples/voices-delete.md): Delete a voice. ### Browsers - [Play Audio in Browser](https://docs.cartesia.ai/examples/tts-play-audio.md): Generate a wav and play it using an