[BUG] API Error 413 Request size exceeds model context window
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: <!-- output of
claude --version--> - Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->
- Terminal: <!-- e.g. iTerm2, Terminal App -->
Claude Code v1.0.88
Login Method: Claude Max Account
opus (claude-opus-4-1-20250805)
Bug Description
<!-- A clear and concise description of the bug -->
Facing the following errors for the past 3-5 hours today. To bypass, I start a new cli instance. after 10-15 minutes, run into the same error msgs. compact/ does not help. Have to restart all over again!!
API Error: 413 {"type":"error","error":{"type":"invalid_request_error","message":"Request
size exceeds model context window"},"request_id":"req_011CSPWKXCRRY6RUpJykZ77v"}
API Error: 413 {"type":"error","error":{"type":"invalid_request_error","message":"Request
size exceeds model context window"},"request_id":"req_011CSPWRe93wTQJVC54RWBng"}
API Error: 413 {"type":"error","error":{"type":"invalid_request_error","message":"Request
size exceeds model context window"},"request_id":"req_011CSPVvvbwQiaRZPjwWv2D9"}
API Error: 413 {"type":"error","error":{"type":"invalid_request_error","message":"Request
size exceeds model context window"},"request_id":"req_011CSPW7uq7mg9hHcnbaZx7f"}
Steps to Reproduce
- <!-- First step -->
- <!-- Second step -->
- <!-- And so on... -->
Expected Behavior
<!-- What you expected to happen -->
Actual Behavior
<!-- What actually happened -->
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗