Skip to main content

Usage guide

Setup, environment variables, and Python/JavaScript/Go usage examples.

CartesiaTTS

Low-latency streaming text-to-speech with Cartesia’s Sonic models. Choose it for fast, natural voices in many languages, with voice controls on Sonic 3 and newer. Authenticates with CARTESIA_API_KEY from your environment, or an explicit api_key.

Fields

str
default:"UNSET"
Voice model to synthesize with, e.g. “sonic-3.5” or a dated snapshot like “sonic-3.5-2026-05-04” to pin a version. Defaults to ‘sonic-3.5’.
Union[str, List[float]]
default:"UNSET"
Cartesia voice ID (a UUID) from the Cartesia voice library or your own cloned voices. Defaults to ‘f8f5f1b2-f02d-4d8e-a40d-fd850a487b3d’.
str
default:"UNSET"
Language code of the text, e.g. “en”, “hi”, “es” or “ja”. Sonic 3.5 supports 42 languages. Defaults to ‘en’.
str
default:"UNSET"
Base URL of the Cartesia API. Change only for a proxy or private deployment. Defaults to ‘https://api.cartesia.ai’.
Mapping[str, Any] | None
default:"UNSET"
Voice controls such as {“speed”: 1.1, “volume”: 1.0, “emotion”: “excited”}. Sonic 3 and newer only; only the keys you set are sent. Defaults to None (not set).
str | None
default:"UNSET"
ID of a custom pronunciation dictionary created in your Cartesia account. Defaults to None (not set).
int | None
default:"UNSET"
Deprecated and ignored; buffering is now paced by sentence. Defaults to None (not set).
bool
default:"UNSET"
Set to True to receive per-word timestamps for syncing transcripts with audio. Defaults to False.
float
default:"UNSET"
Seconds after which the WebSocket connection is refreshed to stay within Cartesia’s session limits. Defaults to 300.0.