[← Developer docs](https://aictrlx.ru/docs)

Integration

# Claude Code with aictrlx

Claude Code, Anthropic's coding agent for the terminal, works with aictrlx through the Anthropic Messages API: the same keys, prices and payment in roubles as the OpenAI-compatible API.

Its model tiers (Opus, Sonnet, Haiku) map to aictrlx routing modes, so Claude Code can run on Claude models or on any other model from the catalog.

## Setup

### Put the key in an environment variable

Every example below reads the key from `AICTRLX_API_KEY`, so it never ends up in your code.

Shell

```
export AICTRLX_API_KEY="aictrlx_live_..."
```

Point Claude Code at this deployment and map its model tiers to routing modes (any model id from above works too):

Shell

```
export ANTHROPIC_BASE_URL="https://aictrlx.ru"
export ANTHROPIC_AUTH_TOKEN="$AICTRLX_API_KEY"
# Claude Code's model tiers -> routing modes of this platform
export ANTHROPIC_DEFAULT_OPUS_MODEL=smart
export ANTHROPIC_DEFAULT_SONNET_MODEL=coding
export ANTHROPIC_DEFAULT_HAIKU_MODEL=fast
```

Not supported on this endpoint: image and document input, server tools (web search, code execution), `mcp_servers` and extended thinking output. Unknown Claude model names are rejected unless the operator maps them with `MESSAGES_API_MODEL_ALIASES`.

## Which model to use

-   `smart` for the Opus tier: the most capable model for planning and hard changes.
-   `coding` for the Sonnet tier: models ranked by coding skill, context size and tool use.
-   `fast` for the Haiku tier: quick answers for small steps.
-   Or any model id from the models page, for example a Claude model for every tier.

[Models and prices →](https://aictrlx.ru/models)

## What it costs

You pay for the tokens the model reads and writes, at the prices per 1M tokens on the models page, in roubles: from the plan's allowance first, then from the balance.

Every request, with its model, tokens and cost, is in the request log of the dashboard.

## If something does not work

-   `401` with `invalid_api_key` or `missing_api_key`: the tool does not send the key, or it is not an active `aictrlx_live_...` key. Create a new one on the API Keys page.
-   `404` with `model_not_found`: the model name is neither a routing mode (`auto`, `fast`, `smart`, `coding`) nor an id from the models page.
-   `403` with `model_not_allowed`: the key is limited to some models; allow this one in the key's settings.
-   `429`: too many requests per minute (`rate_limit_exceeded`), or a quota or budget ran out (`monthly_quota_exceeded` and others).

[All errors and limits →](https://aictrlx.ru/docs#errors)

## Other integrations

-   [Cursor with aictrlx](https://aictrlx.ru/docs/cursor)
-   [Continue with aictrlx](https://aictrlx.ru/docs/continue)
-   [LangChain with aictrlx](https://aictrlx.ru/docs/langchain)
-   [Vercel AI SDK with aictrlx](https://aictrlx.ru/docs/vercel-ai-sdk)
-   [LiteLLM with aictrlx](https://aictrlx.ru/docs/litellm)

## Need a key?

Sign up: the key is in the dashboard a minute later.

[Create a free account →](https://aictrlx.ru/register)

## What's new

New models, routing modes and API changes.

[Changelog →](https://aictrlx.ru/docs/changelog)
