serverserv serverserv

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

RouteHow it worksBilling
API keyOpenClaw calls the Anthropic API with your key. Models appear as anthropic/...Pay-as-you-go API usage
Claude CLIOpenClaw 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

  1. Install OpenClaw (normal install or Docker).
  2. 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.
  3. Pick a model in the Control UI model picker or with /models in 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.

Get OpenClaw hosting

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.

Ready to deploy?

Pick a plan, choose a term and our team sets up your server for you.

See all plansTalk to sales

Need a custom server, bulk pricing or help moving from another host? Our team will build a quote for you.

Plans from $2.99/moSee plans