> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cartesia

> Use the Cartesia speech-to-text plugin in a Zero Runtime pipeline. Setup, options, and usage.

Cartesia is a **speech-to-text** plugin. It transcribes the caller's audio into text for the
LLM over Cartesia's streaming WebSocket API, using the `ink-whisper` model.

<Note>
  Cartesia is also available as a [text-to-speech](/plugins/tts/cartesia) plugin.
</Note>

## Setup

Set your Cartesia API key in the worker environment. Generate a key from the [Cartesia dashboard](https://play.cartesia.ai/keys):

```bash theme={null}
export CARTESIA_API_KEY=<key>
```

## Usage

Import the plugin and pass it to the pipeline's `stt` slot.

<CodeGroup>
  ```python Python theme={null}
  from zrt.plugins import CartesiaSTT

  stt = CartesiaSTT(
      model="ink-whisper",
      language="en",
  )

  # Pipeline(stt=stt, ...)
  ```
</CodeGroup>

## Parameters

*Constructor parameters for the Python SDK (`CartesiaSTT`).*

| Parameter            | Type  | Default         | Description                                                                                  |
| -------------------- | ----- | --------------- | -------------------------------------------------------------------------------------------- |
| `api_key`            | `str` | `None`          | Cartesia API key. Falls back to the `CARTESIA_API_KEY` environment variable when unset.      |
| `model`              | `str` | `"ink-whisper"` | Cartesia speech-to-text model.                                                               |
| `language`           | `str` | `"en"`          | Expected language of the caller's speech.                                                    |
| `input_sample_rate`  | `int` | `48000`         | Sample rate (Hz) of the incoming PCM audio; must match the capture rate.                     |
| `output_sample_rate` | `int` | `16000`         | Sample rate (Hz) at which Cartesia processes audio internally.                               |
| `base_url`           | `str` | `None`          | Override the Cartesia WebSocket base URL. Defaults to `None` (uses `wss://api.cartesia.ai`). |

## Import paths

| SDK        | Import                                | Constructor        |
| ---------- | ------------------------------------- | ------------------ |
| Python     | `from zrt.plugins import CartesiaSTT` | `CartesiaSTT(...)` |
| JavaScript | -                                     | Coming soon        |
| Go         | -                                     | Coming soon        |

Transcribed text passes to the [LLM](/plugins/llm/google) once
[turn detection](/plugins/turn-detection/namo) decides the caller has finished speaking.
