Anthropic's undocumented OAuth rate limit pool requires Claude Code system prompt

✍️ OpenClawRadar📅 Published: April 13, 2026🔗 Source
Anthropic's undocumented OAuth rate limit pool requires Claude Code system prompt
Ad

A developer building an LLM proxy discovered that Anthropic's rate limit handling for OAuth tokens depends on system prompt content, not headers or token type.

The problem

The developer had a working setup with:

  • Anthropic SDK with authToken
  • Beta headers (claude-code-20250219, oauth-2025-04-20)
  • user-agent: claude-cli/2.1.75
  • x-app: cli

Haiku worked fine, but Sonnet returned persistent 429 rate limit errors with no retry-after header, no rate limit headers, just "message": "Error". Meanwhile, an AI agent (running OpenClaw) on the same server with the same OAuth token had no issues with Sonnet 4.6.

The solution

After examining OpenClaw's Anthropic provider source (@mariozechner/pi-ai), the developer found this code:

// For OAuth tokens, we MUST include Claude Code identity
if (isOAuthToken) {
    params.system = [{
        type: "text",
        text: "You are Claude Code, Anthropic's official CLI for Claude.",
    }];
}

Adding this one line to the proxy fixed the Sonnet rate limit errors immediately.

Ad

How it works

The API routes requests to the Claude Code rate limit pool (which is separate and higher than the regular API pool) based on whether your system prompt identifies as Claude Code. This behavior isn't documented in the SDK docs or API docs.

Practical fix

If you're using Anthropic OAuth tokens and getting mysterious 429s, add "You are Claude Code, Anthropic's official CLI for Claude." to your system prompt.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also