> ## 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.

# Anthropic

> Use the Anthropic Claude LLM plugin in a Zero Runtime pipeline. Setup, options, and usage in Python and JavaScript.

Anthropic Claude is an **LLM** plugin. It takes the transcribed conversation and generates
the reply, with support for tool calling, prompt caching, and extended thinking.

## Setup

Set your Anthropic API key in the worker environment. Generate a key from the [Anthropic console](https://console.anthropic.com/dashboard):

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

## Usage

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

<CodeGroup>
  ```python Python theme={null}
  from zeroruntime.plugins import AnthropicLLM

  llm = AnthropicLLM(
      model="claude-sonnet-4-20250514",
      temperature=0.7,
  )

  # Pipeline(llm=llm, ...)
  ```

  ```typescript Node JS theme={null}
  import { AnthropicLLM } from '@zeroruntime/js-sdk/plugins';

  const llm = AnthropicLLM({
    model: 'claude-sonnet-4-20250514',
    temperature: 0.7,
  });

  // Pipeline({ llm, ... })
  ```
</CodeGroup>

## Configuration Options

*Constructor parameters for `AnthropicLLM`. The Python and Node JS SDKs share these field names.*

### Core

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str` | `None` | Anthropic API key. Falls back to the `ANTHROPIC_API_KEY` environment variable when unset. |
| `model` | `str` | `"claude-sonnet-4-20250514"` | Claude model used to generate replies. |
| `temperature` | `float` | `0.7` | Sampling randomness; lower is more deterministic. |
| `max_output_tokens` | `int` | `1024` | Maximum number of tokens the model may generate per response. The legacy `max_tokens` kwarg is accepted as a deprecated alias. |

### Sampling

| Parameter | Type | Default | Description |
| - | - | - | - |
| `top_k` | `int` | `None` | Top-k sampling cutoff. |
| `top_p` | `float` | `None` | Nucleus-sampling probability cutoff. |
| `stop_sequences` | `str` or `list[str]` | `None` | One or more strings at which the model stops generating. Accepts a single string or a list of strings. |

### Advanced

| Parameter | Type | Default | Description |
| - | - | - | - |
| `thinking_budget` | `int` | `None` | Token budget for Claude's extended thinking (chain-of-thought reasoning). A positive value (e.g. `1024`) enables thinking; `None` disables it. The legacy `thinking={"budget_tokens": N}` dict form is also accepted. |

<Tip>
  For voice, short replies feel best. Keep `max_output_tokens` modest and the system instruction
  concise to keep latency down.
</Tip>

## Import paths

| SDK | Import | Constructor |
| - | - | - |
| Python | `from zeroruntime.plugins import AnthropicLLM` | `AnthropicLLM(...)` |
| Node JS | `import { AnthropicLLM } from '@zeroruntime/js-sdk/plugins'` | `AnthropicLLM({ ... })` |

The reply is streamed to the [text-to-speech](/runtime-sdk/plugins/tts/cartesia) plugin, which
synthesizes the agent's voice.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.