[BUG] WebSearch "Rate limit reached" occurs only with Claude subscription, works fine with API key

Resolved 💬 3 comments Opened Feb 20, 2026 by AbdelrahmanHafez Closed Mar 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

Feedback ID: 128260d3-f039-4e27-a32a-9b4e4fc0b02b

What's Wrong?

WebSearch tool consistently returns API Error: Rate limit reached for every query when using a Claude (Max) subscription. The same queries work perfectly when using an API key. This has been ongoing for the past 3 days.

Tried downgrading from 2.1.49 to 2.1.47 with no change. Also ruled out DNS filtering (switched from AdGuard DNS to Cloudflare 1.1.1.1, and tested on a different ISP with default DNS) with no change.

Key finding: Switching from my Claude subscription to an API key immediately resolves the issue. The tool calls pass without any rate limit errors. This points to a subscription-side rate limiting issue rather than anything client-side.

What Should Happen?

WebSearch should return search results when using a Claude subscription, the same way it does with an API key.

Error Messages/Logs

Web search results for query: "hello world test 2026"

API Error: Rate limit reached

Steps to Reproduce

  1. Start a Claude Code session authenticated with a Claude subscription (not an API key)
  2. Ask Claude to perform a web search (e.g., "do a web search for hello world")
  3. WebSearch tool is invoked
  4. Every invocation returns API Error: Rate limit reached
  5. Switch to an API key → same queries succeed immediately
  6. Switch back to subscription → rate limit error returns

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unsure, has been broken for the past 3 days. Tried 2.1.47 and 2.1.49, both affected.

Claude Code Version

2.1.49 (Claude Code)

Platform

Claude subscription (Max plan). Does not reproduce on Anthropic API key.

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • Using AdGuard DNS, but tested with Cloudflare DNS (1.1.1.1 / 1.0.0.1) to rule out DNS blocking. Same error on both.
  • Tested using a different ISP with their default DNS, still failing.
  • Tested with an API key instead of my Claude Max subscription: the tool calls pass. This is the key differentiator.
  • macOS Darwin 25.2.0

Update: 2026-02-24 08:10 AM UTC
I just had a successful Web Search tool call after it failing for the past few days. Will keep the issue open for a week or so just in case it breaks again.

Update: 2026-02-25 05:46 AM UTC
It's broken again.

Update 2026-03-06 11:20 AM UTC
I ran claude -d to capture debug logs when hitting this. The error message I'm getting is more specific than "Rate limit reached":

429 {"type":"error","error":{"type":"rate_limit_error","message":"Extra usage is required for long context requests."},"request_id":"req_011CYmj6di95RcPjt3MuGnVM"}

Dug into the bundled source in the binary to understand how WebSearch works internally. When WebSearch is invoked, it makes a separate API call (a "side query") using a different API client created with source:"side_query". That side query is what gets rejected with the 429.

Tried setting CLAUDE_CODE_ATTRIBUTION_HEADER=0 to strip the billing attribution header entirely from the request. Same error. So the gating is purely based on auth type (OAuth subscription vs API key), not on any client-side header or request metadata we can control.

My actual context was ~2,500 tokens at the time, so the "long context" part of the error message doesn't match reality. It seems like subscription auth just isn't allowed to make side_query requests at all, regardless of context size.

Authenticated via OAuth (subscription), not API key. Claude Code 2.1.70 on macOS.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗