# How to Use Claude Code With a Cheaper API Key in 2026

Run Claude Code on a cheaper API key: what each route costs, a 5-minute setup with ANTHROPIC_BASE_URL, and when a Claude Max plan is the better deal.

Source: https://sidrune.ai/blog/claude-code-cheaper-api-key

> **TL;DR:** Claude Code can run on any API key that accepts the Anthropic Messages format. Set `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN`, then check the connection with `/status`. On Sidrune AI, Claude Opus 5.5 costs $0.72 / $3.60 per 1M tokens on the Claude Code route, 82% below the official $4 / $20.

## Can you run Claude Code on your own API key?

Yes. Claude Code sends every request to the address in `ANTHROPIC_BASE_URL` and authenticates with the key in `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_API_KEY`. Anthropic's documentation calls this [connecting to an LLM gateway](https://code.claude.com/docs/en/llm-gateway-connect), and any gateway that accepts the Anthropic Messages format works.

While a gateway key is set, Claude Code uses it instead of your claude.ai subscription. Requests are billed per token to the owner of the key, and the subscription's usage limits no longer apply to them.

Anthropic does not endorse third-party gateways, so pick one that serves real Claude models and publishes its prices per route.

## What does Claude Code cost?

Across enterprise deployments, Anthropic puts the average Claude Code cost at about **$13 per developer per active day** and **$150 to $250 per developer per month**, with 90% of users under $30 per active day ([Manage costs](https://code.claude.com/docs/en/costs)). The model you pick, the size of the codebase and running several sessions at once move that number a lot.

| Option | How you pay | Price |
|---|---|---|
| Claude Pro | Subscription with usage limits | $20 per month, or $17 per month billed yearly |
| Claude Max | Subscription with higher limits | From $100 per month |
| Anthropic API | Per token, list price | Opus 5.5: $4&nbsp;/&nbsp;$20 per 1M tokens |
| Sidrune AI, Claude Code route | Per token, 0.18x of list | Opus 5.5: $0.72&nbsp;/&nbsp;$3.60 per 1M tokens |

Subscription prices are from [claude.com/pricing](https://claude.com/pricing), Sidrune AI prices from [Model Plaza](https://global.sidrune.ai/model-plaza) on 15 October 2026.

As a rough guide, if your usage costs $150 to $250 a month at list price, the same tokens cost about $27 to $45 on a 0.18x route and $60 to $100 on a 0.4x route. The cost on Claude Code's `/usage` screen covers the current session and is calculated at list price, so multiply it by your route's multiplier to see what Sidrune AI charges. Fable 5.1 on Claude-Max routes has extra charges, listed below the route table.

## Claude prices per route on Sidrune AI

Sidrune AI sells Claude through several routes. Each route has its own multiplier on the official price and its own ratings for intelligence, stability and speed in Model Plaza. Prices per 1M tokens, input / output:

| Route | Opus 5.5 | Sonnet 5.5 | Fable 5.1 |
|---|---|---|---|
| **Official Anthropic price**<br>1x | $4.00&nbsp;/&nbsp;$20.00 | $2.00&nbsp;/&nbsp;$10.00 | $10.00&nbsp;/&nbsp;$50.00 |
| **Claude-Max-STANDARD INJECT-ONLY CC**<br>0.18x, Claude Code only | $0.72&nbsp;/&nbsp;$3.60 | $0.36&nbsp;/&nbsp;$1.80 | $2.16&nbsp;/&nbsp;$10.80 |
| **Claude-Max-LIMIT INJECT**<br>0.22x, any client | $0.88&nbsp;/&nbsp;$4.40 | $0.44&nbsp;/&nbsp;$2.20 | $2.64&nbsp;/&nbsp;$13.20 |
| **Claude-Anthropic-Reverse**<br>0.35x | $1.40&nbsp;/&nbsp;$7.00 | $0.70&nbsp;/&nbsp;$3.50 | $3.50&nbsp;/&nbsp;$17.50 |
| **Claude-Max-NO INJECT**<br>0.4x, any client | $1.60&nbsp;/&nbsp;$8.00 | $0.80&nbsp;/&nbsp;$4.00 | $4.80&nbsp;/&nbsp;$24.00 |
| **Claude-Anthropic-Official**<br>0.7x | $2.80&nbsp;/&nbsp;$14.00 | $1.40&nbsp;/&nbsp;$7.00 | $7.00&nbsp;/&nbsp;$35.00 |

Read these notes before you pick a route:

- **INJECT routes add a system prompt.** INJECT routes add an instruction to each request to keep the account pool running, and Model Plaza says it may lower output quality in some cases. On LIMIT INJECT the instruction is under 0.4k tokens. NO INJECT adds nothing.
- **Fable 5.1 costs more on Max routes.** Claude-Max routes bill Fable 5.1 on a base 20% above list, $12 / $60 instead of $10 / $50, and requests with reasoning effort set to max cost 3.5x on top of that.
- **Fast mode doubles the Opus price.** Opus 5.5 in fast mode is billed at 2x on every route, the same as on Anthropic's own API. When Claude Code signs in with `ANTHROPIC_AUTH_TOKEN`, it keeps `/fast` off by default.
- **Cheaper routes have lower ratings.** Model Plaza also lists Claude routes from 0.05x to 0.15x, each rated lower for intelligence or stability. Among the routes rated five stars on all three, the 0.18x Claude Code route is the cheapest.

If you also call Claude from scripts or other apps, use a key on a route that Model Plaza lists with no client limit, such as LIMIT INJECT or NO INJECT.

## How to set up Claude Code with a Sidrune AI key

The setup takes about five minutes.

### Step 1. Create a key in a Claude group

Sign up at [global.sidrune.ai](https://global.sidrune.ai/register), add balance, then open [API Keys](https://global.sidrune.ai/keys) and create a key in a Claude group, for example Claude-Max-STANDARD INJECT-ONLY CC. Each key belongs to one group, so create a separate key if you also use GPT.

### Step 2. Test the key

Run this in your terminal, with your key in place of `YOUR_SIDRUNE_API_KEY`:

```bash
export ANTHROPIC_BASE_URL=https://global.sidrune.ai
export ANTHROPIC_AUTH_TOKEN=YOUR_SIDRUNE_API_KEY

curl -sS -X POST "$ANTHROPIC_BASE_URL/v1/messages" \
  -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "max_tokens": 16,
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

A reply that starts with `{"id":"msg_` means the address and key work. A `401` means the key was rejected. The Claude Code route may refuse requests that do not come from Claude Code, so if this test fails on that route, go to step 4 and check inside Claude Code.

### Step 3. Save the settings

Add both values to the `env` block of `~/.claude/settings.json`, so every terminal and session picks them up:

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://global.sidrune.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_SIDRUNE_API_KEY"
  }
}
```

Use the file in your home folder. A project's `.claude/settings.json` is often committed to git, and its `env` block applies only after the first-run setup, so Claude Code may still ask you to log in.

### Step 4. Check inside Claude Code

Start `claude` and run `/status`. The `Anthropic base URL` line should show `https://global.sidrune.ai`, and the `Auth token` line should name `ANTHROPIC_AUTH_TOKEN`. Send a short message to confirm that replies come back.

If you switch between several providers, [CC Switch](https://github.com/farion1231/cc-switch) can keep each one as a profile.

## Troubleshooting

| Problem | Likely cause | Fix |
|---|---|---|
| `401` error | The key is wrong, revoked or in a header the gateway does not read | Copy the key again from API Keys, or move it from `ANTHROPIC_AUTH_TOKEN` to `ANTHROPIC_API_KEY` |
| `model_not_found` | The key's group does not serve that model | Copy the exact model name from Model Plaza and check that your group lists it |
| Claude Code asks you to log in | Claude Code did not see the key at startup | Put the values in `~/.claude/settings.json` or export them before you run `claude` |
| `/status` shows no base URL line | `ANTHROPIC_BASE_URL` did not reach the session | Start `claude` from the terminal where you exported it, or use the settings file |
| Remote Control or voice dictation is missing | Both rely on a claude.ai login | Unset the gateway variables and log in with claude.ai when you need them |

## When is a Claude Max plan the better deal?

A per-token key suits light, irregular or shared use, because you pay only for the tokens you use. A Claude Max plan from $100 a month can cost less if you work in Claude Code for hours every day and stay inside its limits, because its price does not grow with your usage.

To decide, use Claude Code on a key for a week of normal work, check how much balance you spent and multiply by four. If the result is well above $100, compare it with Claude Max before you top up for the month.
