> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.joytokens.ai/llms.txt.

# Claude Code

> Use Claude Code with JoyToken

## Prerequisites

| Item              | Value                                |
| ----------------- | ------------------------------------ |
| Command           | `claude`                             |
| Model             | `auto` (not configurable)            |
| JoyToken Base URL | `https://api.joytokens.ai/anthropic` |
| API key env       | `ANTHROPIC_API_KEY`                  |

## Configure

Replace `sk-xxx` with your JoyToken API key:

```bash
export ANTHROPIC_BASE_URL="https://api.joytokens.ai/anthropic"
export ANTHROPIC_API_KEY="sk-xxx"
```

## Start

```bash
cd /path/to/your/project
claude --model auto
```

## Verify

```bash
claude --model auto -p "Reply with exactly: pong"
```

A successful response includes `pong`.

## Common Errors

| Error                             | Fix                                                              |
| --------------------------------- | ---------------------------------------------------------------- |
| `401 Unauthorized`                | Check that `ANTHROPIC_API_KEY` contains a valid JoyToken API key |
| Claude Code uses another endpoint | Check that `ANTHROPIC_BASE_URL` is set in the current shell      |
| Model not found                   | Start Claude Code with `--model auto`                            |

## Resources

* [Claude Code LLM gateway configuration](https://code.claude.com/docs/en/llm-gateway)
* [JoyToken Environments](/user-guide/environments)