How to use Claude Code with a 5abeer API key
Install Claude Code and point it at 5abeer with three settings to run Claude models at about 70% below the official price, or use your plan in 5abeer AI.
On this page
- What you get
- Before you start
- With a subscription: the 5abeer AI app
- Manual Claude Code setup
- Install Claude Code
- Add the settings
- Run it
- Pick a model
- If you get an error
- Questions
- Do I need an Anthropic account?
- I'm already signed in to Claude. What do I do?
- Do I need Node.js?
- How do I check that Claude Code goes through 5abeer?
- How is a request billed?
- Sources
To use Claude Code with 5abeer, install Claude Code, then put three settings in ~/.claude/settings.json: the 5abeer base URL, your 5abeer API key and a model. Run claude in your project and every request is paid from your 5abeer balance. With a subscription, the 5abeer AI app does this setup for you.
What you get#
- Claude Code exactly as it ships, with its commands and settings.
- The Claude models 5abeer serves, at about 70% below their official price.
- Usage and cost per key in your dashboard.
Before you start#
- A terminal on macOS, Linux or Windows.
- An API key for Claude models (create one).
Node.js22 or newer, only if you install Claude Code withnpm.
With a subscription: the 5abeer AI app#
If you have a 5abeer subscription that includes Claude Code, the 5abeer AI app sets it up on your subscription, with no API key and no files to edit. The app runs on Mac, Windows and Linux; details in What each plan runs. With an API key, follow the manual setup below.
Manual Claude Code setup#
Install Claude Code#
Anthropic recommends its native installer. Pick the tab for your system:
curl -fsSL https://claude.ai/install.sh | bashIf you use CMD on Windows instead of PowerShell, run this command. A PowerShell prompt starts with
PS; a CMD prompt doesn't.Windows (CMD)curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdYou can also install it with a package manager. Homebrew and WinGet installs don't update on their own, and the Homebrew cask below follows the stable channel, usually about a week behind the latest release.
brew install --cask claude-codeCheck the install:
Terminalclaude --versionAdd the settings#
Put these settings in
~/.claude/settings.json, or export the same variables in your shell. ReplaceYOUR_5ABEER_API_KEYwith your key.{ "env": { "ANTHROPIC_BASE_URL": "https://api.5abeer.ai", "ANTHROPIC_AUTH_TOKEN": "YOUR_5ABEER_API_KEY", "ANTHROPIC_MODEL": "claude-sonnet-5.5" } }~/.claude/settings.json
Run it#
Terminalcd your-project claudeAsk anything. If a reply comes back, you're set:
/statusshows the Anthropic base URL and which variable holds your key.
Pick a model#
These models run in Claude Code today. Switch with the ANTHROPIC_MODEL variable, or inside Claude Code with /model.
Claude Sonnet 5.5DefaultInput$0.60Output$3Context1M
Claude Opus 5.5Input$1.20Output$6Context1M
Claude Fable 5.1Input$3Output$15Context—
Claude Fable 5Input$3Output$15Context1M
Claude Opus 4.6Input$1.50Output$7.50Context1M
Claude Opus 5Input$1.50Output$7.50Context1M
Claude Sonnet 5Input$0.60Output$3Context1M
Claude Sonnet 4.6Input$0.90Output$4.50Context1M
Claude Haiku 4.5Input$0.30Output$1.50Context200K
Official price from the provider's page, checked October 19, 2026.
All models and pricesIf you get an error#
INVALID_API_KEY: the key is wrong or was copied only in part.INSUFFICIENT_BALANCE: your balance doesn't cover this request.MODEL_PLATFORM_NOT_ALLOWED: the key belongs to a provider other than Claude.RATE_LIMITED: too many requests in a short time.
Every code and what it means is in Errors and fixes.
Questions#
Do I need an Anthropic account?#
No. With ANTHROPIC_AUTH_TOKEN set to your 5abeer key, Claude Code sends that key with every request, so you don't sign in to Anthropic.
I'm already signed in to Claude. What do I do?#
Nothing, in most cases. While your 5abeer key is set, Claude Code uses it instead of your claude.ai login, which stays saved. If Claude Code warns at startup about two credential sources, run this inside Claude Code to clear the saved login:
/logoutRemote Control and voice dictation need a claude.ai login, so they don't work while your 5abeer key is set.
Do I need Node.js?#
Not with the native installer. The npm install needs Node.js 22 or newer.
How do I check that Claude Code goes through 5abeer?#
Run /status inside Claude Code. The Status tab shows the Anthropic base URL, which should be the 5abeer address, and a line naming the variable that holds your key. Each request also appears in your dashboard under the key you used.
How is a request billed?#
Each request is paid from your balance by the tokens it uses, at the model's 5abeer price. Details in Pricing and balance.
Sources#
Checked on 2026-11-01:
- Claude Code docs: Advanced setup
- Claude Code docs: Connect Claude Code to an LLM gateway
Was this page helpful?