cartesia
The official Python library for the cartesia API
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has low install friction, carries a permissive license, and provides a straightforward typed interface to a modern TTS API. Install it if you need to integrate Cartesia's speech synthesis into a Python application. No known security vulnerabilities and supports Python 3.9 through 3.14.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a valid Cartesia API key set in the CARTESIA_API_KEY environment variable.
- Low install friction with a pure-Python wheel and six common runtime dependencies.
- The package is actively maintained with a recent release and 128 repository stars.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2026-08-14 (0 days) · last repo commit 2026-08-14 · 128 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 835,744 downloads/mo, #4,934 on PyPI
Alternatives
Verify before relying
pip install cartesia
import os
from cartesia import Cartesia
client = Cartesia(api_key=os.getenv("CARTESIA_API_KEY"))
response = client.tts.generate(
model_id="sonic-latest",
output_format={"container": "wav", "encoding": "pcm_f32le", "sample_rate": 44100},
transcript="Hello world",
voice="e07c00bc-4134-4eae-9ea4-1a55fb45746b",
)
response.write_to_file("output.wav")- Whether the websockets extra dependency (mentioned in install docs) is included in the runtime dependency list or must be installed separately.
- Performance characteristics and latency for real-time streaming use cases.
- Rate limits and quota behavior when generating multiple concurrent audio streams.
What it is and what it does
Cartesia is a Python client library that wraps the Cartesia REST API, enabling developers to generate speech from text using the Sonic real-time text-to-speech model. It provides both synchronous and asynchronous clients powered by httpx, with full type hints for request and response objects. The library supports streaming inputs via websockets, allowing text fragments to be pushed incrementally—useful for latency-sensitive applications like voice agents that need to synthesize LLM output as it streams.
The package handles common API patterns including error handling, retries, timeouts, and file uploads. It supports multiple output formats (container types, encodings, sample rates) and voice selection. Developers can use either the blocking Cartesia client or AsyncCartesia for concurrent operations, with identical functionality between the two.
Use it for
- Generate speech audio from text and save to file for playback or distribution.
- Stream text fragments from an LLM to Cartesia over websockets for low-latency voice agent responses.
- Build concurrent text-to-speech pipelines using AsyncCartesia for batch audio generation.
- Integrate real-time speech synthesis into interactive applications with custom voice selection and audio format control.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has low install friction, carries a permissive license, and provides a straightforward typed interface to a modern TTS API. Install it if you need to integrate Cartesia's speech synthesis into a Python application. No known security vulnerabilities and supports Python 3.9 through 3.14.
Install
cartesia on PyPI
Before you install
Low install friction with a pure-Python wheel and six common runtime dependencies. The package is actively maintained with a recent release and 128 repository stars.
Requires a valid Cartesia API key set in the CARTESIA_API_KEY environment variable.
License in practice
Licensed under Apache-2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install cartesia
import os
from cartesia import Cartesia
client = Cartesia(api_key=os.getenv("CARTESIA_API_KEY"))
response = client.tts.generate(
model_id="sonic-latest",
output_format={"container": "wav", "encoding": "pcm_f32le", "sample_rate": 44100},
transcript="Hello world",
voice="e07c00bc-4134-4eae-9ea4-1a55fb45746b",
)
response.write_to_file("output.wav")
Verify before relying
- Whether the websockets extra dependency (mentioned in install docs) is included in the runtime dependency list or must be installed separately.
- Performance characteristics and latency for real-time streaming use cases.
- Rate limits and quota behavior when generating multiple concurrent audio streams.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesanyiodistrohttpxpydanticsniffiotyping-extensions |
| Maintenance | Actively maintained 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 835,744 / month, #4,934 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: cartesia-4.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “cartesia text-to-speech api client”
- cartesiaCartesia is the official Python client library for the Cartesia REST…
- livekit-plugins-cartesiaIntegrates Cartesia's voice AI services (speech-to-text and…
- google-cloud-texttospeechProvides a Python client to Google Cloud Text-to-Speech, which…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also livekit-plugins-cartesia · kugelaudio · livekit-plugins-soniox · deepgram-sdk · gladiaio-sdk · fish-audio-sdk · elevenlabs · gTTS · speechmatics-rt · miniaudio