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

# Claude Code

> Connect Claude Code or Claude CLI-style tools to Moxus AI with the Anthropic-compatible endpoint.

Claude Code and Claude CLI-style tools usually use the Anthropic Messages protocol. To connect them to Moxus AI, use the Anthropic-compatible endpoint and a compatible Claude-style model.

## Values

| Field              | Value                                                          |
| ------------------ | -------------------------------------------------------------- |
| API Key            | `sk-your-key`                                                  |
| Anthropic Base URL | `https://moxus.ai`                                             |
| Model              | A Claude or Anthropic-compatible model from Models and pricing |

## Environment variables

If your tool supports environment variables, set:

```bash theme={null}
export ANTHROPIC_API_KEY="sk-your-key"
export ANTHROPIC_BASE_URL="https://moxus.ai"
```

Then start Claude Code or the corresponding CLI.

<Info>
  Custom Base URL support depends on the Claude Code version. If your tool has no Base URL setting, it may not be able to connect directly to Moxus AI.
</Info>

## Request format

Anthropic-compatible requests usually use `/v1/messages` and the `x-api-key` header. Test with cURL first:

```bash theme={null}
curl https://moxus.ai/v1/messages \
  -H "x-api-key: sk-your-key" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-3-5-sonnet",
    "max_tokens": 512,
    "messages": [
      {"role": "user", "content": "Introduce Moxus AI in one sentence"}
    ]
  }'
```

## When to use this path

* Your project already uses Claude Messages prompts or tool calls.
* You want Claude-style long-context code analysis.
* Your team already has Claude CLI workflows and only needs to replace endpoint and key.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Can I use the OpenAI Base URL for Claude Code?">
    Usually no. Claude Code-style tools use Anthropic protocol, so use `https://moxus.ai`, not `https://moxus.ai/v1`.
  </Accordion>

  <Accordion title="Which model name should I use?">
    Use the exact model name shown in Models and pricing. If the model does not support Anthropic Messages, use an OpenAI-compatible client or choose another model.
  </Accordion>

  <Accordion title="There is no Base URL setting">
    The current tool version may only support Anthropic's official service. Use Cursor, Codex, Roo Code, or a proxy you maintain.
  </Accordion>
</AccordionGroup>

## Next steps

* [Quickstart](/en/overview/quickstart)
* [Models and pricing](/en/overview/models-and-pricing)
