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

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.
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
👀 See Also

Fix Ollama Cloud Model maxTokens: Cap is 16K, Not Config Value
Ollama cloud caps output at 16,384 tokens regardless of maxTokens config. Set to 14,000 to avoid EOF errors. Restructure long outputs or route to direct provider.

Getting Claude to Adversarially Debate Without Caving: 5 Prompt Tweaks That Work
Five concrete prompt engineering techniques to prevent Claude from hedging, sycophancy, and fabrication when acting as a debate opponent, based on building sparwithai.com.

OpenClaw Cost Optimization: From $200 to $1/Month

OpenClaw Installation Tips: Skip Onboarding and Use Diagnostic Commands
A Reddit user shares practical OpenClaw installation advice: skip the onboarding process to avoid common issues, especially on VPS setups, and use the openclaw doctor and openclaw status commands to diagnose configuration problems.