Skip to main content

Cartesia

Cartesia is a service that provides Speech-to-Text (STT) and Text-to-Speech (TTS) capabilities. It's designed for real-time voice applications, making it ideal for voice AI agents, transcription pipelines, and conversational interfaces.

The Cartesia plugin for the Stream Python AI SDK allows you to add STT and TTS functionality to your project.

Installation

Install the Stream Cartesia plugin with

uv add "vision-agents[cartesia]"
# or directly
uv add vision-agents-plugins-cartesia

Examples

Read on for some key details and check out our Cartesia examples to see working code samples:

  • in main.py we see a voice bot that uses Cartesia STT and TTS in a Stream call
  • in narrator-example.py we see a well-prompted combination of an STT -> LLM -> TTS flow that leverages Cartesia's Ink and Sonic models to narrate a creative story from the user's input

Initialisation

The Cartesia plugin for Stream exposes STT and TTS classes:

from vision_agents.plugins import cartesia

stt = cartesia.STT()
tts = cartesia.TTS()
To initialise without passing in the API key, make sure the `CARTESIA_API_KEY` is available as an environment variable. You can do this either by defining it in a `.env` file or exporting it directly in your terminal.

Parameters

These are the parameters available in the Cartesia STT plugin for you to customise:

Name Type Default Description
api_key str or None None Your Cartesia API key. If not provided, the plugin will look for the CARTESIA_API_KEY environment variable.
model str "ink-2" ID of the Cartesia STT model to use.
sample_rate int 16000 Sample rate (in Hz) sent to Cartesia.
encoding str "pcm_s16le" PCM encoding sent to Cartesia.
cartesia_version str "2026-03-01" Cartesia API version used for the turn-detection websocket.

These are the parameters available in the Cartesia TTS plugin for you to customise:

Name Type Default Description
api_key str or None None Your Cartesia API key. If not provided, the plugin will look for the CARTESIA_API_KEY environment variable.
model_id str "sonic-3.5" ID of the Cartesia TTS model to use.
voice_id str or None "f9836c6e-a0bd-460e-9d3c-f7299fa60f94" ID of the voice to use for TTS responses.
sample_rate int 16000 Sample rate (in Hz) used for audio processing.

Functionality

Send audio to transcribe speech

STT streams PCM audio to Cartesia Ink and emits transcript and turn events that Vision Agents can use for interruption and eager turn handling.

agent = Agent(
    ...,
    stt=cartesia.STT(),
    tts=cartesia.TTS(),
)

Send text to convert to speech

The send_iter() method sends the text passed in for the service to synthesize and yields TTSOutputChunks containing the produced PCM audio.

async for chunk in tts.send_iter("Demo text you want AI voice to say"):
    pass

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vision_agents_plugins_cartesia-0.6.9.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file vision_agents_plugins_cartesia-0.6.9.tar.gz.

File metadata

  • Download URL: vision_agents_plugins_cartesia-0.6.9.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vision_agents_plugins_cartesia-0.6.9.tar.gz
Algorithm Hash digest
SHA256 06d71f4eeacd19f04754b57ede95d13b52adeb9eb13facadca7097cbf619ebcc
MD5 747da26545840b8dc70e994c925d8f58
BLAKE2b-256 7b9cceefebaa676d1e1c5a9a0dcf2403d0bb64d4eb268b2e42ebc4d395e62885

See more details on using hashes here.

File details

Details for the file vision_agents_plugins_cartesia-0.6.9-py3-none-any.whl.

File metadata

  • Download URL: vision_agents_plugins_cartesia-0.6.9-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vision_agents_plugins_cartesia-0.6.9-py3-none-any.whl
Algorithm Hash digest
SHA256 74b2b80e24e5fd1165181073f6fffb6d848458fd666a5bac402fe16cef242d75
MD5 e292d53c1d0360761a8a65e55f84f3ef
BLAKE2b-256 52f86f7d3abdb9d6e62f32d52fe104fd221eb7d7cca1b56aa199dbd51f7f02ea

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.9 This release

2 files

0.6.8

2 files

0.6.7

2 files

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.3

2 files

0.1.0

2 files

0.0.18

2 files

0.0.17

2 files

0.0.12

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page