canonical: https://jentic.com/apis/cartesia.ai/cartesia

# Cartesia API

Jentic publishes the only available OpenAPI specification for Cartesia API, keeping it validated and agent-ready. Cartesia provides ultra-fast, realistic voice AI for text-to-speech and speech-to-text using the Sonic model family for synthesis and the Ink model family for transcription. The API supports both raw byte responses and server-sent event streaming for low-latency TTS, plus file-based audio upload for STT. It is designed for real-time agent voices, conversational interfaces, and audio content production where sub-second first-token latency matters.

## For AI agents

Synthesize speech from text and transcribe audio files using Cartesia's Sonic and Ink voice models, with streaming output for low-latency agent voice.

## Scope

Does not handle voice cloning, real-time STT streaming, or audio editing - use for Sonic text-to-speech and Ink file transcription only.

## Capabilities

- Synthesize text into raw audio bytes via Sonic TTS for batch playback
- Stream synthesized speech as server-sent events for sub-second voice agent responses
- Transcribe uploaded audio files into text using the Ink speech-to-text model
- Select voice, language, and output sample rate per text-to-speech request
- Authenticate with a Cartesia bearer API key for both TTS and STT calls

## Use cases

### Real-time voice agent responses

Stream synthesized speech to a voice agent or phone assistant via the `/tts/sse` endpoint so the user hears the first audio chunk in well under a second. Sonic generates audio incrementally as the LLM produces tokens, keeping conversation natural without long silences. Suited to support bots, IVR replacements, and interactive voice experiences.

Example prompt: POST to `/tts/sse` with the assistant's reply text, voice id, and language=en, then forward the streaming audio chunks to the caller as they arrive.

### Batch audio narration

Use POST `/tts/bytes` to render scripted text into a complete audio file in a single response, suitable for podcasts, e-learning narration, audiobook chapters, or pre-recorded prompts. The byte endpoint returns the full clip once synthesis completes, which is simpler to handle than streaming for offline rendering.

Example prompt: Call POST `/tts/bytes` with a 500-word script, voice id, and 24000 Hz output, then save the returned audio bytes as narration.mp3.

### Call recording transcription

Upload recorded audio files to /stt to obtain text transcripts using the Ink model. Useful for call summarization, meeting notes, voice note search, and feeding spoken content back into LLM workflows.

Example prompt: POST a meeting.wav file to /stt and store the returned transcript text against the meeting record.

### AI voice agent integration via Jentic

Agents using Jentic search by intent ('synthesize speech') and load the Cartesia `/tts/sse` schema, then execute the call with the bearer token managed inside your Jentic One instance. This avoids hand-coding streaming SSE clients and keeps Cartesia credentials out of the agent's prompt.

Example prompt: Search Jentic for 'synthesize speech with cartesia', load the `/tts/sse` operation, and execute it with the supplied script to return streaming audio.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/tts/bytes` | Synthesize text to a complete audio byte payload |
| POST | `/tts/sse` | Stream synthesized speech as server-sent events |
| POST | `/stt` | Transcribe an uploaded audio file into text |

## Key resources

- **Text to Speech** — Synthesize spoken audio from text using Sonic, returning either bytes or a streaming SSE response.
- **Speech to Text** — Transcribe uploaded audio files into text using the Ink model.

## Why Jentic

- **Setup:** Wiring the Cartesia API by hand means passing your key as a bearer token on every call and handling the streaming byte and SSE responses from the Sonic text-to-speech routes on the api.cartesia.ai host yourself. Through Jentic you install once, import the Cartesia API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Cartesia takes the text and audio in the request body, not the URL path, so you scope by operation: limit the agent to the ones it needs, such as synthesizing speech to bytes, and leave streaming SSE or transcription out of the allowed set until you want them.
- **Credential handling:** Your Cartesia API key is stored once, encrypted, by your own Jentic One instance and injected as the bearer token at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'synthesize speech' or 'transcribe audio', and Jentic returns the matching Cartesia operation with its input schema so the agent calls the right TTS or STT endpoint without browsing the reference docs.

## Related APIs

- **ElevenLabs API** — ElevenLabs offers similar realistic TTS and voice cloning with a larger voice library.
- **OpenAI API** — Pair OpenAI's chat models with Cartesia to convert generated replies into streamed speech.
- **Deepgram API** — Deepgram is a competing speech-to-text provider with real-time streaming transcription.

## FAQ

### Why is there no official OpenAPI spec for Cartesia API?

Cartesia does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Cartesia API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Cartesia API use?

The Cartesia API uses HTTP bearer token authentication. You pass your Cartesia API key as a Bearer token in the Authorization header. Through Jentic, the key is stored encrypted in your Jentic One instance and never exposed to the agent's prompt context.

### Can I stream text-to-speech output instead of waiting for the full file?

Yes. POST to `/tts/sse` to receive synthesized audio as server-sent events, with the first chunk arriving in well under a second. Use `/tts/bytes` when you want the complete audio payload returned in a single response.

### What audio inputs does the Cartesia speech-to-text endpoint accept?

The /stt endpoint accepts uploaded audio files for transcription using the Ink model family. You send the file as a multipart form upload and receive transcript text in the response.

### What are the rate limits for the Cartesia API?

Cartesia does not publish rate limits in this OpenAPI spec; quotas depend on your account plan. Check your Cartesia dashboard at https://docs.cartesia.ai for current limits and upgrade options.

### How do I synthesize speech with Cartesia through Jentic?

Run pip install jentic, then search Jentic with the query 'synthesize speech with cartesia', load the `/tts/sse` or `/tts/bytes` operation schema, and execute it with your text and voice id. Jentic injects the Cartesia bearer token from the vault at execution time.

### Can I limit what my agent is allowed to do with the Cartesia API?

Yes. Because Jentic One is self-hosted, your own rules decide which Cartesia operations the agent may call and which credentials it may use. Cartesia takes its text and audio in the request body rather than the URL path, so you scope by operation: allow only the ones the agent needs, such as synthesizing speech to bytes via `/tts/bytes`, and leave streaming SSE synthesis (`/tts/sse`) or file transcription (/stt) out of the allowed set. The Cartesia bearer key is injected only for the operations you permit, so the agent cannot reach endpoints you have not granted.
