# Claude plan (/docs/providers/claude)

The Claude plan account answers with the visitor's Claude subscription. The wallet lists it as Claude under "With your plan", with the id `claude`. A Claude API key is a separate account, described on the [Claude API key](/docs/providers/anthropic-key) page.

## What the visitor needs [#what-the-visitor-needs]

A Claude plan that signs in to Claude Code, Anthropic's command line tool. The answers count against that plan.

## Sign in [#sign-in]

1. In the wallet, the visitor picks Claude under "With your plan".
2. The wallet opens a window on `https://claude.ai/oauth/authorize`, the sign in page of Claude Code, with a PKCE challenge.
3. The visitor signs in to claude.ai and authorizes the access.
4. Claude sends the window to `http://localhost:54545/callback`, an address that does not load. The wallet reads that address from the window as soon as it lands there and closes the window.
5. The wallet trades the code of that address for tokens at `https://platform.claude.com/v1/oauth/token`, and the account is connected.

When the wallet misses the address, the visitor copies the whole address of the window into the "Address of the window" field of the side panel. An address from another sign in is refused with "this is not the address of this sign in". The sign in stays open for ten minutes.

The wallet renews the access token with the refresh token from one minute before it expires.

## Models [#models]

The wallet lists Anthropic's catalog from `https://api.anthropic.com/v1/models`, asked with the plan's token, and keeps the list for a day. The visitor picks the account's default model in its settings, and a model per site with the buttons of the side panel. Without a choice, the account answers with `claude-sonnet-5-5`.

## Usage and limits [#usage-and-limits]

The wallet reads two headers on each answer: `anthropic-ratelimit-unified-5h-utilization` and `anthropic-ratelimit-unified-7d-utilization`, the share used of the plan's five hour and weekly windows. The room left is one minus the higher of the two.

When Claude answers `anthropic-ratelimit-unified-status: rejected`, the account reads as spent. Auto then tries it last.

## Calls [#calls]

Answers come from `https://api.anthropic.com/v1/messages?beta=true` in Anthropic's Messages protocol. Each call carries the plan's token and the betas `claude-code-20250219`, `oauth-2025-04-20` and `interleaved-thinking-2025-05-14`.

The wallet leaves `temperature` and `topP` out of these calls, since current Claude models answer them with an error. When your site sets no `maxTokens`, the call asks for 4096 tokens. Claude Opus 5.5, Claude Sonnet 5.5 and Claude Fable 5.1 refuse a forced tool choice (`required` or a named tool), and their error reaches your site with its status.

## Known issues [#known-issues]

- The sign in borrows the OAuth client of Claude Code.
- Anthropic answers a plan's request with 429 `rate_limit_error` when its first system block is anything other than Claude Code's identity string. The wallet sends "You are Claude Code, Anthropic's official CLI for Claude." as the first system block, ahead of your site's system messages.
- Anthropic answers a plan's token only on a request without an `Origin` header, and treats the request as Claude Code only when it carries Claude Code's `User-Agent`. The wallet removes `Origin` and sets `User-Agent: claude-cli/2.1.280 (external, Chrome)` on its calls to `api.anthropic.com`. Its calls to the token endpoint carry `User-Agent: axios/1.15.2`, the client Claude Code signs in with.
- Since Anthropic's validation change of 6 November, the sign in must ask for the `org:create_api_key` scope and carry a state of at least 43 characters. Anthropic answers a shorter state with "Invalid request format". The wallet sends both.
