API Error 400 (invalid_request_error)
The request itself was malformed or violated a schema constraint.
2,591 issues · 129 open · 2,462 resolved (95%) · first seen Feb 24, 2025
First response · api
What to do now
Most likely: The API rejected or could not complete the request.
- Identify the HTTP status and error type before changing local configuration.
- Retry once with a short backoff; repeated failures should be compared with the official status page.
- If only one project fails, reproduce in a new short session to separate service trouble from request state.
These are conservative triage steps, not an official Anthropic fix. Use the issue and workaround evidence below before making a destructive configuration change.
Is this getting better or worse?
This class of problem is converging. 226 new reports in the last 90 days vs 769 in the 90 before — -71%. The open backlog peaked at 313 in 2026-05 and sits at 129 today.
Derived by counting each matching issue from its creation date until it closed. First-party
computation over the anthropics/claude-code tracker — the trend is not published
anywhere upstream.
Which builds report this
1,099 of these reports name the Claude Code build they were running, spanning 169 releases. Heaviest reporters:
- Claude Code v2.1.154
- Claude Code v2.1.19
- Claude Code v2.0.76
- Claude Code v2.1.153
- Claude Code v2.1.114
- Claude Code v2.1.119
- Claude Code v2.1.126
- Claude Code v2.1.156
Report volume, not a defect count: an issue can mention a build without that build having caused the failure. Versions come from the version string in the bug-report template, matched against real published tags.
Do these get fixed?
Median time to close is 4 days across 2,462 closures. Of the 2,462 closures with a recorded reason, 18% were closed as completed and 2,008 as not-planned or duplicate. The most recent completed fix landed in 2026-08.
Workarounds reported by the community
447 of these issues post a workaround someone says worked. The highest-engagement ones:
- API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation. - [Bug] Anthropic API Error: Unexpected 400 Bad Request Response
- …67 (my report) 8887 8893 8894 8895 8897 8903 EDIT (Oct 14): Workaround for tool use/tool result 400 errors: A research-backed solution was posted on Oct 10: Add the provided instructions to your global CLAUDE.md (~/.clau…
Found in the thread of #8763 · resolved - [Bug] VS Code extension: Tool use concurrency error after Jan 23-24 update
- ✅ WORKAROUND FOUND The fix: Install VS Code extension version 2.1.17 while keeping CLI at 2.1.19 Steps: 1. In VS Code, go to Extensions 2. Find "Claude Code for VS Code" 3. Click the dropdown arrow next to Uninstall → "I…
Found in the thread of #20571 · still open - [Bug] Anthropic API Error: Tool Use Concurrency Limitation
- I tried many workaround without success. In my case, it was a specific PDF file causing the issue. Once unreferenced, it works.
Found in the thread of #9002 · resolved - [BUG] Oversized image breaks conversation permanently - no way to recover without starting new chat
- …retry without failed images, or client-side image resizing Workaround Currently, users must start a new conversation and manually reconstruct any important context.
Found in the description of #13480 · resolved - [BUG] Opus 4.7 doesn't work with bedrock
- …pting both shapes) and what Bedrock requires (header only). Workaround for anyone blocked today A ~100 line local HTTP shim that moves → header and forwards to makes Claude Code 2.1.111 + Opus 4.7 work end-to-end. Point…
Found in the thread of #49238 · resolved
Excerpts are quoted from the linked issue so you can judge relevance before opening it. Threads that only ask for a workaround, or report that there is none, are excluded. These are community suggestions, not official guidance from Anthropic — read the full thread before applying one.
Matching issues 1–100
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 2,591 matches; the statistics above cover all 2,591.
- HERMES.md in git commit messages causes requests to route to extra usage billing instead of plan quota
- API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation. - [Bug] Anthropic API Error: Unexpected 400 Bad Request Response
- [Bug] VS Code extension: Tool use concurrency error after Jan 23-24 update
- [Bug] Anthropic API Error: Tool Use Concurrency Limitation
- [BUG] Oversized image breaks conversation permanently - no way to recover without starting new chat
- [BUG] Opus 4.7 doesn't work with bedrock
- [BUG] API Error 400 - Thinking Block Modification Error
- [Bug] Anthropic API Credential Restriction Preventing API Requests
- Missing Tool Result Block After Tool Use This error suggests that after a tool use block in the conversation, you did not include the corresponding tool result block, which is required by the API. To resolve this: 1. Ensure that any `tool_use` block is i
- Image Upload Exceeds Size Limit Causing Persistent API Request Failure
- Resuming an extended-thinking session fails permanently with 400 "thinking blocks cannot be modified" (transcript stores thinking text as empty but keeps signature)
- Bug Report API Error: 400 `tool_use` ids were found without `tool_result` blocks immediately after...
- [Bug/Documentation] 'Organization has been disabled' error when ANTHROPIC_API_KEY overrides Max/Pro subscription
- [BUG] claude -p fails with "tools.3.custom.input_examples: Extra inputs are not permitted"
- [BUG] Plan upgrade payment fails — PaymentIntent voided immediately with `void_invoice` before confirm can complete
- [BUG] API 400
- [BUG] max_tokens must be greater than thinking.budget_tokens
- Task agent fails with 'tools: Tool names must be unique' when parent has many MCP tools
- API Error 400: thinking blocks order error on first tool use after clean install
- [Bug] Anthropic API Error: Credential Authorization Restriction
- Corrupted image in context causes persistent API 400 errors, breaking the entire chat session
- [BUG] Session broken -> API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The request body is not valid JSON: no low surrogate in string: line 1 column 410559 (char 410558)"}}
- /compact fails with 'Conversation too long' when context limit is reached
- [BUG] API Error: "invalid_request_error" "The request body is not valid JSON"
- [BUG] API Error 400: context_management: Extra inputs are not permitted
- Long Context Beta Not Available for Current Subscription
- Subagents fail with 'prompt is too long' when user has many MCP servers (tool definitions exceed 200k)
- [Bug] Anthropic API Error: Image does not match provided media type
- Cancelling a parallel tool-call batch corrupts thinking blocks -> 400 "thinking blocks cannot be modified" permanently wedges the session
- JSON Parsing Error: Invalid Low Surrogate in Request Body
- Bug Report
- [BUG] claude code is setting anthropic-beta header on requests to vertexai count-tokens
- [BUG] Keep hitting "Request size exceeds model context window"
- [BUG] Opus 4.6 with [1m] context window returns "long context beta not available" on Max subscription
- [Bug] Anthropic API Error: Image media type mismatch with base64 data
- Invalid API Model Name in Request
- [Bug] Anthropic API Error: Tool Use Concurrency Failure
- [BUG] Claude Code with Vertex AI (Unexpected value(s) `prompt-caching-scope-2026-01-05`)
- [Bug] Anthropic API Error: Duplicate tool names when using sub-agents
- [BUG] API Error 400: data retention mode 'default' is not available for this model via AWS Bedrock
- Bug: API Error 400 - tool use concurrency issues
- [Bug] /compact and auto-compact fail with 'Tool names must be unique' when MCP servers are configured
- [Bug] Anthropic API Error: Credential Restricted to Claude Code
- Bug Report :: When Update keeps giving me please wait and try again later
- [BUG] Long Context Beta API Error mid-long-context-session
- [BUG] API Error 400: MCP tool names exceeding 64 character limit
- [BUG] Frequent "API Error: 400 due to tool use concurrency issues" in VSCode extension
- [Bug] Anthropic API Error: Long context beta unavailable for Max plan with Claude Opus 4.6 1M
- Extended thinking: signed thinking block 'cannot be modified' (400) permanently wedges session
- [Bug] Anthropic API Error: Cannot Modify Thinking Blocks in Assistant Messages
- Multiple bugs: thinking block ordering, settings schema validation, agent frontmatter
- [BUG] API Error: 400. Each `tool_use` block must have a corresponding `tool_result` block in the next
- Image Processing Failure: API Rejects Unrelated Context Image
- [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages
- Corrupted image in context permanently breaks session — workaround and suggested fix
- Web Search Failure: Persistent API Timeout During Search Request
- [BUG] API Error 400: "tool_use ids must be unique" when using -p flag with tool-requiring prompts
- [BUG] Unable to generate a AGPLv3 license due to content filtering policy
- [BUG] API Error 400: Thinking Block Modification Error (Not a Duplicate)
- API Error 400: eager_input_streaming parameter not permitted in Claude Code VS Code Extension v2.1.72
- [BUG] Getting "invalid beta flag" error despite CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
- Compaction Failure: Conversation Length Exceeds Limit
- Auto-compact fails with Opus 4.5 extended thinking blocks
- API Error: 400 with "messages.31.content.4.image.source.base64.data: Image does not match the provided media type image/jpeg"
- Bug: Task tool fails with "tools: Tool names must be unique" error
- [BUG] API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.16...
- [BUG] API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.
- Image Upload Exceeds 5 MB Size Limit in API Request
- [BUG] 400 "output_config.effort 'xhigh' is not supported when thinking is disabled" on Opus 4.8 despite alwaysThinkingEnabled: true (VS Code, 2.1.205–2.1.207)
- [Bug] Anthropic API Error: Invalid message format with thinking blocks
- Task tool fails with 'Tool names must be unique' error when MCP servers are enabled
- [BUG] API Error 400 - The request body is not valid JSON: str is not valid UTF-8: surrogates not allowed - mid-conversation error
- [BUG] API 400 "messages[1].role must be either 'user' or 'assistant', but got 'system'" (v2.1.156)
- [Bug] Anthropic API Error: PNG screenshots sent with incorrect image/jpeg MIME type
- [Bug] Anthropic API Error: Long context beta access revoked for eligible subscription
- [BUG] prompt-caching-scope-2026-01-05 beta header sent even when enablePromptCaching and useAnthropicBetaHeaders are set to false
- [Feature Request] Increase API image size limit from 5MB to 10MB to match claude.ai
- Bash Command Redirection Fails with `2>&1` is treated as if the `2` was a separate parameter
- [BUG] Claude Desktop blank screen on Windows + Cowork unusable + sandbox API errors — Max subscriber, 9-day outage
- [BUG] Output blocked by content filtering policy
- [BUG] 2.1.129 sends unsupported anthropic_beta flags in request body that Bedrock rejects with 400
- [BUG] Claude Code all prompts are rejected with 400 invalid_request_error and a strange message
- [BUG] API Error: 400 due to tool use concurrency issues.
- [BUG] API Error: invalid_request_error When Sending A Image
- [BUG] API Error: 400 Input is too long for requested model.
- [BUG] Claude Max $200/month CLI blocked — official CLI falsely flagged as "third-party app"
- [BUG] CLI completely blocked by "out of extra usage" error despite Max 20x plan at only 10% usage
- [Bug] /compact fails with "Tool names must be unique" even after disabling all MCP servers (v2.0.70)
- [BUG] Interrupting session during tool calls permanently corrupts conversation with tool_use/tool_result API errors
- API Error: 400 while using the Claude Code in my Terminal
- Auto-compact to avoid "input length and max_tokens exceed context limit" errors
- [BUG] API Error 400 "tool use concurrency issues" occurs only in print mode (-p), not in interactive mode
- [Bug] Anthropic API Error: Invalid tool_result block without corresponding tool_use
- Bug Report all messages must have non-empty content except for the optional final assistant message
- [Bug] Anthropic API Error: System role not supported on model
- API Error 400: tool_use ids must be unique - occurs consistently
- [Bug] Opus 4.5 can't send bug report when Opus 4.5 select at Pro subscription
- [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages
- [BUG] Auto Mode sends unsupported "afk-mode-2026-01-31" beta header causing API 400 error
- User interrupt during streaming can freeze whitespace-only text block into history, causing persistent 400 errors