# How do you use OpenClaw with Claude?

Connect Claude to OpenClaw with an Anthropic API key, or reuse your Claude Code login through the Claude CLI route. Below: setup steps, billing and limits for each route.

Tool: OpenClaw. By Michel Lieben. Updated 2026-12-04. Source: https://coldiq.com/university/openclaw/openclaw-with-claude

## In short

- OpenClaw supports two Claude routes: an Anthropic API key with usage-based billing, or Claude CLI, which reuses an existing Claude Code login on the same computer.
- With Claude CLI, OpenClaw talks to the installed Claude Code program. It never reads, saves or forwards your Claude login tokens.
- Anthropic’s support page says Claude Agent SDK and claude -p usage still draw from your Claude plan limits when you are signed in with your plan.
- The OpenClaw docs prefer an API key for shared automation or predictable production spending.
- A 429 error means your Anthropic quota is used up for now. Set a fallback model so OpenClaw keeps replying.

## Steps

1. Pick a route: an Anthropic API key, or your existing Claude Code login.
2. Run openclaw onboard and choose Anthropic API key or Claude CLI.
3. Check the models with openclaw models list --provider anthropic.

## Why use Claude with OpenClaw?

OpenClaw is the assistant layer: it lives in your chat apps, keeps memory, runs scheduled jobs and controls tools. It still needs an AI model to think. Claude, made by Anthropic, is one of the providers it supports out of the box.

The model you choose matters for safety, not only for quality. The OpenClaw security docs say smaller models are easier to hijack with prompt injection (hidden instructions in a page or email). A strong recent model is part of a safe setup.


## Which route should you choose: API key or Claude CLI?

The two routes bill in different ways, and the OpenClaw docs say they are not interchangeable billing choices.

- Anthropic API key: you pay per use (pay as you go) through the Anthropic Console. Best for shared automation and predictable costs.
- Claude CLI: OpenClaw runs your installed Claude Code with your existing login. Usage counts against your Claude plan. Best for a personal assistant if you already pay for a plan that includes Claude Code.

Tip: Check which account each route uses. An API key you select for the Claude CLI route still uses separate API billing.


## How do you connect Claude with an API key?

Create an API key in the Anthropic Console at console.anthropic.com. An API key is a secret code that lets OpenClaw use your Anthropic account, so store it like a password.

1. Create the key in the Anthropic Console.
2. Run openclaw onboard and choose Anthropic API key, or pass the key directly with openclaw onboard --anthropic-api-key "$ANTHROPIC_API_KEY".
3. If your key is not tied to one workspace, enter the Anthropic workspace ID when asked. Leave it blank otherwise.
4. Check that the models appear: openclaw models list --provider anthropic
5. Optional: add an Anthropic Admin API key to see 30 days of real spend, tokens and top models in the Usage page of the Control UI.


## How do you reuse your Claude Code login?

This route needs Claude Code installed on the same computer as the OpenClaw Gateway, and signed in as the same user.

OpenClaw then sends normal agent turns through the Claude Code program. Claude Code keeps full control of the login and its refresh. If you sign in after the Gateway has started, you do not need to restart it: OpenClaw checks the login again on its own.

1. Check Claude Code: claude --version, then claude auth status --text.
2. If you are not signed in: claude auth login.
3. Run openclaw onboard and choose Claude CLI.
4. Or set it as default in one step: openclaw models auth login --provider anthropic --method cli --set-default


## How much does Claude cost with OpenClaw?

OpenClaw itself is free. You pay Anthropic, in one of two ways.

With the API key route, you pay per token (a token is a small piece of text). Prices depend on the model and are listed on Anthropic’s pricing pages.

With the Claude CLI route, usage counts against your Claude plan. As of November 2026, claude.com lists Pro at $20 per month ($17 per month billed yearly), Max at $100 per month and Ultra at $200 per month. The Free plan does not include Claude Code. Anthropic’s support page also says Max, Ultra and Team plans now include monthly API credits for use with an API key from your linked Console organization.


## What else can OpenClaw do with Claude Code?

OpenClaw and Claude Code can work together beyond model access. The bundled coding-agent skill, which is off until you turn it on in your skills settings, lets OpenClaw hand coding jobs to Claude Code, Codex or OpenCode.

openclaw attach starts Claude Code with a scoped connection to your Gateway, so Claude Code can use OpenClaw tools you allow.

If you are moving from Claude Code, openclaw migrate claude --dry-run shows what can be imported, such as CLAUDE.md instructions into AGENTS.md, MCP servers and skills. Run openclaw migrate apply claude --yes to do it.

> Use the coding-agent skill to ask Claude Code to fix the failing test in my project folder. Show me the change before anything is committed.


## What happens when you hit a Claude limit?

An HTTP 429 rate_limit_error means your Anthropic quota or rate limit is used up for the current window. On the Claude CLI route, wait for the window to reset or move to a larger plan. On the API key route, check usage and billing in the Anthropic Console and raise your limits.

If the message says extra usage is required for long context requests, the request tries to use Claude’s 1M-token context window, and your current account is not set up for that billing.

The OpenClaw FAQ gives one fix for all of these: set a fallback model, so OpenClaw keeps replying through another model while Claude is limited.

- See your default and fallbacks: openclaw models status
- Add a fallback model: openclaw models fallbacks add followed by the model name.


## Sources

- [OpenClaw docs: Anthropic](https://docs.openclaw.ai/providers/anthropic)
- [OpenClaw docs: CLI backends](https://docs.openclaw.ai/gateway/cli-backends)
- [OpenClaw docs: openclaw attach](https://docs.openclaw.ai/cli/attach)
- [OpenClaw docs: Migrating from Claude](https://docs.openclaw.ai/install/migrating-claude)
- [OpenClaw docs: providers and hosting FAQ](https://docs.openclaw.ai/help/faq-first-run/providers-and-hosting)
- [Anthropic: Use the Claude Agent SDK with your Claude plan](https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan)
- [Claude pricing](https://claude.com/pricing)

## Questions

**Can I use my Claude Pro subscription with OpenClaw?** Yes, through the Claude CLI route, which reuses your Claude Code login. Usage counts against your plan limits.

**Why do I get a 429 error from Anthropic?** Your Anthropic quota or rate limit is used up for the current window. Wait, upgrade, or raise limits in the Console, and set a fallback model in OpenClaw.

**Does OpenClaw store my Claude password or token?** No. On the Claude CLI route, OpenClaw never reads or saves your native login tokens. Claude Code manages them.

**Which Claude model should I use with OpenClaw?** Use a strong recent model for any agent that has tools. The docs warn that smaller models are more open to prompt injection.


## Try ColdIQ free

ColdIQ gives new accounts up to 1,450 free credits as they get started, no credit card required.
One subscription covers 40+ B2B data providers for finding, enriching and verifying
contacts and companies, through the web app, the API or the MCP server for AI agents.

1. Create an account: https://coldiq.com/marketplace/sign-up?utm_source=ai-assistant&utm_medium=markdown&utm_content=university
2. Run a first search on your own market with the free credits.
3. Connect the MCP server to Claude, ChatGPT or Cursor: https://coldiq.com/mcp
