1. Docs
  2. Coding tools
  3. Claude Code

Use Claude Code with Airoutly

Set two environment variables and Claude Code sends its requests through Airoutly. Your commands and workflow stay the same; usage is billed to your Airoutly balance.

Base URL
https://api.airoutly.comno /v1
Key variable
ANTHROPIC_AUTH_TOKEN
Models
Claude models on the models page
You need
An Airoutly API key and a positive balance

1. Install Claude Code

Skip this step if claude --version already prints a version.

curl -fsSL https://claude.ai/install.sh | bash

2. Connect it to Airoutly

The settings file works on every system and in every terminal, so we recommend it. Replace sk-your-key with your key.

// ~/.claude/settings.json  (Windows: %USERPROFILE%\.claude\settings.json)
{
"env": {
  "ANTHROPIC_BASE_URL": "https://api.airoutly.com",
  "ANTHROPIC_AUTH_TOKEN": "sk-your-key"
}
}
Leave /v1 off the Base URLClaude Code appends /v1/messages itself. A Base URL that already ends in /v1 makes every request fail.

3. Choose models

Claude Code uses one model for your conversation and a smaller one for background tasks. Pin both to model IDs listed on Airoutly, in the same env block:

settings.json
"ANTHROPIC_MODEL": "claude-sonnet-4-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5"

To switch during a session, run /model.

4. Check that it works

  1. Open a new terminal and run claude.
  2. Run /status. The base URL line should read https://api.airoutly.com.
  3. Send a short prompt. Within a few seconds the request appears in the console under Usage logs, with its tokens and cost.

Troubleshooting

“Unable to connect to Anthropic services” on first launch

Claude Code’s first-run check contacts Anthropic directly. Open ~/.claude.json, add “hasCompletedOnboarding”: true at the top level, save, and start claude again.

401: invalid token

The key was copied with extra spaces, or it is disabled, expired or out of its spending limit. Check it on the API keys page in the console.

503: model_not_found

The model ID isn’t available on Airoutly. Check ANTHROPIC_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL and your /model choice against the models page. IDs are case-sensitive.

403: insufficient_user_quota

Your balance can’t cover the request. Top up in the console and try again.

Claude Code asks whether to use a custom API key

You set ANTHROPIC_API_KEY instead of ANTHROPIC_AUTH_TOKEN. Either works with Airoutly; approve the prompt, or rename the variable to skip it.