How to use Claude with OpenClaw: API key or Claude CLI
By Siam Ahmed, software engineer · 5 min read · Updated
OpenClaw works with Anthropic's Claude models out of the box. You can connect Claude with an API key, or reuse a Claude Code login you already have. This guide explains both routes, which one to choose for a 24/7 agent, and how to keep an eye on cost. It follows the official OpenClaw Anthropic provider docs (checked 28 November 2026). serverserv is not affiliated with Anthropic.
Two ways to connect Claude
| Route | How it works | Billing |
|---|---|---|
| API key | OpenClaw calls the Anthropic API with your key. Models appear as anthropic/... | Pay-as-you-go API usage |
| Claude CLI | OpenClaw runs your installed Claude Code and reuses its login. Models appear as claude-cli/... | Draws from that Claude Code account's plan limits |
The two are not interchangeable: an API key chosen for the CLI route still bills as API usage, and a CLI selection does not quietly fall back to the API if Claude Code cannot run.
Which route to choose
- Always-on or shared agent: use an API key. OpenClaw's docs recommend it for shared automation and predictable production use.
- Personal use on your own machine where Claude Code is already signed in: the CLI route reuses that login.
Set it up
- Install OpenClaw (normal install or Docker).
- During onboarding, choose Anthropic and paste your API key, or pick the Claude CLI route on a machine where Claude Code is installed and signed in.
- Pick a model in the Control UI model picker or with
/modelsin Telegram. The picker shows each Claude model once per route.
Track usage and cost
Check usage with /status, openclaw status --usage or the Usage page in the Control UI. If you add an Anthropic Admin API key, the Usage page shows 30 days of real billed cost from Anthropic, separate from OpenClaw's own estimate. To budget, try the AI agent cost calculator and read how much OpenClaw costs.
Where your data goes
Running OpenClaw on your own server keeps its files, memory and settings on that server. The prompts you send to Claude are still processed by Anthropic. Compare with OpenClaw vs Claude Code.
Run Claude in OpenClaw 24/7
An agent on a laptop stops when the laptop sleeps. On a server it keeps answering on WhatsApp or Telegram and runs scheduled skills all day. Our OpenClaw hosting sets it up for you on its own server; you bring your Claude API key. First month $1.
Questions
Can OpenClaw use Claude?
Yes. Anthropic's Claude models are a built-in provider in OpenClaw, through an Anthropic API key or through an existing Claude Code (Claude CLI) login on the same machine.
API key or Claude CLI: which should I use?
An API key bills usage pay-as-you-go and suits always-on or shared automation. The Claude CLI route reuses your Claude Code login and draws from that subscription's limits. OpenClaw's docs recommend API-key auth for shared automation or predictable production use.
Does OpenClaw store my Claude login?
No. Claude Code owns its own login and subscription; OpenClaw does not save or refresh that login.
Do my messages still go to Anthropic?
Yes. OpenClaw runs on your own machine or server, but prompts sent to a Claude model are processed by Anthropic under its terms.
Can I see what Claude costs me in OpenClaw?
Yes. OpenClaw shows usage in the Control UI, and with an Anthropic Admin API key it can show your organisation's actual billed cost for the last 30 days.
More guides
$1 VPS First Month: What You Really Pay
$1 VPS hosting for the first month: who qualifies, the setup fee on monthly plans, what month two costs on each plan, and how to test a server properly.
7 min readRead →Hosting Renewal Price vs Intro Price, Explained
Why the hosting renewal price is often 2 to 6 times the intro rate, how to work out the true 3-year cost of web hosting, VPS and email, and what to ask first.
7 min readRead →VPS Hosting Cost in 2026: Prices by RAM Size
How much does VPS hosting cost in 2026? VPS prices for 2 GB to 64 GB of RAM, monthly vs 3-year billing, renewal jumps and hidden costs.
6 min readRead →Ready to deploy?
Pick a plan, choose a term and our team sets up your server for you.
See all plansTalk to salesNeed a custom server, bulk pricing or help moving from another host? Our team will build a quote for you.