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

# Claude Code

> Route the Claude Code CLI to Prism with Anthropic-compatible environment variables.

Claude Code sends Anthropic Messages requests, and Prism exposes an
Anthropic-compatible `/v1/messages` endpoint, so you can point the CLI at Prism
with environment variables. No gateway is required.

## Copy for your agent

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Follow https://docs.prisminference.com/guides/claude-code to configure Prism for
my Claude Code CLI. Preserve unrelated settings and never repeat my API key to me
or include it in your response.
```

If no key exists, create one at
[prisminference.com/signup](https://prisminference.com/signup) first.

## Configure

Set these variables in the environment that launches `claude`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export ANTHROPIC_BASE_URL=https://api.prisminference.com
export ANTHROPIC_AUTH_TOKEN=prism_sk_...
export ANTHROPIC_MODEL=deepseek-v4.1-flash
export ANTHROPIC_SMALL_FAST_MODEL=deepseek-v4-flash
```

Use the host **without** a `/v1` suffix. Claude Code appends `/v1/messages`
itself, so a `/v1` in `ANTHROPIC_BASE_URL` produces `/v1/v1/messages` and a 404.

`ANTHROPIC_MODEL` overrides Claude Code's built-in Claude model IDs, which Prism
does not serve. `ANTHROPIC_SMALL_FAST_MODEL` covers background requests such as
title generation; set it to a Prism model so those requests succeed too.

## Verify

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
claude -p "Reply with exactly: PRISM OK"
```

You should see `PRISM OK`. The request appears in your Prism usage once it
completes.

## Notes

* Prism accepts both `ANTHROPIC_AUTH_TOKEN` (Bearer) and `ANTHROPIC_API_KEY`
  (`x-api-key`). Prefer `ANTHROPIC_API_KEY` if you want to leave your claude.ai
  login untouched.
* Messages, streaming, thinking blocks, tool use, structured output, and
  `count_tokens` are supported. Prompt-cache hints such as
  `context_management` are accepted and ignored.
* Prism discards request inputs and outputs after processing. See
  [Zero data retention](/zero-data-retention).
