[BUG] API Error: 400 Input is too long for requested model.
Resolved 💬 14 comments Opened Apr 10, 2025 by stepango Closed Jun 10, 2025
Environment
- Platform (select one):
- [ ] Anthropic API
- [x] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 0.2.67
- Operating System: macOs 15.3.2
- Terminal: Warp
Bug Description
<img width="1153" alt="Image" src="https://github.com/user-attachments/assets/91410083-9a0f-40a4-b6e7-5b5bea3ea5e9" />
Getting this error after an attempt of reading the large file, /compact does not help. Have to exit and open claude code again
Steps to Reproduce
- Get context to fill up to about 70%
- Make claude read file of about 100k+ tokens
- See the error, API Error: 400 Input is too long for requested model.
- try to compact, see the error Error: Error during compaction: Error: API Error: 400 Input is too long for requested model.
Expected Behavior
Compact should work regardless of volume of used context
Actual Behavior
All subsequent promts returns an error API Error: 400 Input is too long for requested model.
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
This issue has 14 comments on GitHub. Read the full discussion on GitHub ↗