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

# Use CerasAI with Claude Code

> Connect Claude Code directly to CerasAI using the native Anthropic Messages API endpoint.

## Before you begin

Create a key on the [API Keys](https://console.cerasai.cloud/keys) page, confirm the Model ID on the [Models](https://console.cerasai.cloud/models) page, and export it in the shell where you run Claude Code.

CerasAI natively supports the Anthropic Messages API at `https://api.cerasai.cloud/v1/messages`, so Claude Code connects **directly** without a local proxy.

**1. Export CerasAI environment variables**

```bash theme={"system"}
export ANTHROPIC_BASE_URL="https://api.cerasai.cloud"
export ANTHROPIC_AUTH_TOKEN="$CERASAI_API_KEY"
export ANTHROPIC_MODEL="deepseek-ai/DeepSeek-V4.1-Flash-1017"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="zai-org/GLM-5.3-Flash"
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1048576
```

**2. Launch Claude Code**

```bash theme={"system"}
claude
```

> [!WARNING]
>
> Setting `ANTHROPIC_AUTH_TOKEN` overrides a Claude.ai login for that shell. Export these variables in a dedicated shell or profile to keep an existing subscription usable elsewhere.

> [!NOTE]
>
> `ANTHROPIC_DEFAULT_HAIKU_MODEL` handles lightweight background work such as session titles. Check the [Models](https://console.cerasai.cloud/models) page for each model's context window when configuring `CLAUDE_CODE_MAX_CONTEXT_TOKENS`.


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