API Error: 400 while using the Claude Code in my Terminal
Hi there I have been facing the same error "API Error: 400" for the last three days. ⎿ API Error: 400 I have taken every single step to solve this issue, but nothing has worked. My Anthropic billing account is totally active and I have credits in my account to use it. The current Claude version is 0.2.49 (Claude Code).
@bcherny any ideas what is going wrong here?
@bcherny any ideas what is going wrong here?
No idea till, i have try my best to solve this issue but nothing is working.
I've noticed that I get this error when writing my own MCP server which returns annotations directed to the Assistant in the content field.
I am having the same issue only with a particular repository. Works fine in other repos. I cannot fix broken context in this repo
working here just fine
I am closing this ticket as I have found the solution.
The issue was caused by the monthly credits limit settings. While the credit limit can be checked directly in the Anthropic console, that didn't work for me. Instead, I navigated to Workspace > Claude Code > Limits and adjusted or reset the monthly limit. Setting it to $100 resolved the issue, and everything started working properly. Moreover you can also delete and login again on your terminal with new API.
I am closing this ticket as I have found the solution.
The issue was caused by the monthly credits limit settings. While the credit limit can be checked directly in the Anthropic console, that didn't work for me. Instead, I navigated to Workspace > Claude Code > Limits and adjusted or reset the monthly limit. Setting it to $100 resolved the issue, and everything started working properly. Before doing this delete your old API and re-login with your new API in terminal.
still happens to me with claude max, so no limits there...
happens to me as well. Usually after an hour or so.
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.231: `tool_use`
ids were found without `tool_result` blocks immediately after: toolu_01V6qjweh9usykebYHx8HKYP. Each
`tool_use` block must have a corresponding `tool_result` block in the next message."}}
I cannot clear without starting a new session.
happens to me as well. Usually after an hour or so.
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.231:
tool_useids were found withouttool_resultblocks immediately after: toolu_01V6qjweh9usykebYHx8HKYP. Eachtool_useblock must have a correspondingtool_resultblock in the next message."}} I cannot clear without starting a new session.
Yes facing exact same issue on Claude max plan.
Same problem on max plan
Exiting claude and restarting seems to fix it, something in the session breaks it randomly.
happens to me as well. Usually after an hour or so. API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.231:
tool_useids were found withouttool_resultblocks immediately after: toolu_01V6qjweh9usykebYHx8HKYP. Eachtool_useblock must have a correspondingtool_resultblock in the next message."}} I cannot clear without starting a new session.Yes facing exact same issue on Claude max plan.
+1, also getting this every few days on Max
+1 same issue on Max
Also getting this error on Max:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.276: `tool_use` ids were found without `tool_result` blocks immediately after:
toolu_01234567890. Each `tool_use` block must have a corresponding `tool_result` block in the next message."}}
This happened multiple times, generally after some WebSearch/FetchContent calls. Claude-code then essentially becomes stuck, because it keeps retrying forever.
@MashoodAli-Official could you pls reopen this as it seems to persist for many users, independent of billing,.
This issue has multiple root causes, but we are working on driving down this error rate.
Just got this error! Anybody got any solution or I need to start a new conversation?
I started a new conversation and trying to solve the same issue I was having and seems like it got the same error when it got to the same part again, it was was checking a pretty big log of a docker container with more than 3400 lines.
Hope this helps solve the issue
Same error here, appearing randomly
Same error, also appearing randomly