API Error 400 (invalid_request_error) — page 2
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 101–200
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 2,591 matches; the statistics above cover all 2,591.
- Image Dimension Exceeds Max Size in Multi-Image API Request
- Validation Failure: Tool Name Exceeds 64 Character Limit
- [BUG] Unrecoverable `400 … thinking/redacted_thinking blocks … cannot be modified` permanently bricks a session — reproduced across two independent sessions (v2.1.154)
- [BUG] "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1" does not suppress anthropic-beta "advanced-tool-use-2025-11-20"
- [BUG] Thinking mode 400 error on FIRST tool call in brand new conversation (Opus 4.5)
- [BUG] Session becomes completely unrecoverable due to thinking block API error
- [BUG] API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"},"request_id":"req_011CVaC1ZBLb4PLudLYZ6RZR"}
- [Bug] Anthropic API Error: Image Exceeds 5 MB Size Limit breaks session for subsequent text prompts. Also breaks --continue mode if exit/re-enter.
- [BUG] CC "Image cannot be empty" when pasting a copied selection of a CSV
- Invalid JSON Parsing Error Causing Unexpected API Request Failure
- [Bug] Opus 4.8 Fails to use tools and softbricks context: Cannot modify thinking blocks in assistant message
- WebSearch always fails with a 400 when effort is set to xhigh
- Claude Code v2.1.167: Agent() spawn fails with "400 thinking options type cannot be disabled when reasoning_effort is set" on DeepSeek Anthropic-compatible endpoint
- AskUserQuestion: cancelling during extended thinking poisons the whole session with 400 'thinking blocks cannot be modified' (2.1.153); concurrent prompts overwrite each other
- [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant message
- [Bug] Anthropic API Error: Image exceeds dimension limit for many-image requests (2000px)
- [BUG] Claude Code v2.1.24+ broken on macOS - cache_control.ephemeral.scope error
- [BUG] API Error 400: Invalid 'text' content - Expected 'thinking' block
- [BUG] ⏺ API Error: 400 tools.11.model: 'claude-opus-4-8' cannot be used as an advisor when the request model is 'claude-fable-5'.
- [BUG] Error 400 ""thinking.type.enabled" is not supported for this model" still exists in 2.1.113 when used with Opus 4.7 in Bedrock
- /model claude-opus-4-7 fails with "thinking.type.enabled" not supported error
- [Bug] API Error 400 - Tool Use Concurrency Issues - Widespread Regression Affecting All Platforms
- [Bug Report] Unable to compress conversation
- [BUG] Claude Code MCP tool calls fail with 'String should have at most 64 characters' error due to internal prefix addition.
- [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages
- [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant message
- Stuck retry loop: `400 thinking blocks cannot be modified` on large interleaved-thinking turns using AskUserQuestion
- [BUG] Session unrecoverable after upstream 429: every retry returns 400 previous_message_id
- [BUG] 2.1.69 sends advanced-tool-use-2025-11-20 beta flag that Bedrock/LiteLLM rejects (regression from 2.1.68)
- [BUG] 2.1.68 Sends effort parameter when using custom model
- [BUG] each tool_use must have a single result. Found multiple `tool_result` blocks
- Subagent launch fails with 'Tool names must be unique' when MCP server is configured
- [BUG] "invalid_request_error" `tool_use` ids were found without `tool_result` blocks immediately after
- Compaction Failure: Conversation Length Exceeds Processing Limit
- [BUG] Opus & Sonnet silently blocked on MaxPlan — only Haiku served, no user notification (14h+)
- [BUG] API 400: thinking block ordering error during conversation with Task/Explore agent
- [BUG] Claude Code fails with a content filtering policy error when attempting to add a Mozilla license to a GitHub repository
- [BUG] API Error: 400 `tool_use` ids were found without `tool_result` blocks immediately after: toolu_..... Each `tool_use` block must have a corresponding `tool_result` block in the next message.
- [BUG] Claude Code for VS Code API Error: 400 messages[1].role must be either 'user' or 'assistant', but got 'system'
- [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant message
- Image processing failure silently passes oversized images into context, bricking sessions
- [BUG] Messages content type tool_reference not supported, causing API 400 in v2.1.69
- [BUG] Output blocked by content filtering policy
- [Bug] Anthropic API Error: 400 Tool Concurrency Issues with Opus Model
- [Bug] Anthropic API Error: Assistant message thinking block must be first
- [BUG] Continuous "API Error: 400 due to tool use concurrency issues" in Claude Code in VS Code
- [BUG] Claude Code - Teleport Session from Web to Local Fails with: API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.
- Bug Report
- Claude Code crashes when reading large PDF files - tool_use/tool_result block mismatch
- [Bug] Anthropic API Error: Invalid Tool Use Input Dictionary
- [Bug] Anthropic API Error: Incompatible model for tool advisor when using claude-fable-5
- [BUG] Literal "HERMES.md" in git commit messages triggers 400 "out of extra usage" on Max OAuth (content filter false-positive misclassified as quota error)
- [BUG] Official Claude Code VS Code extension incorrectly blocked with "Third-party apps now draw from your extra usage" error
- [Bug] Claude hangs indefinitely on simple tasks, requires cancellation to resume
- 400 error: empty text content block when background tasks complete during user input
- [Bug] Memory leak causing performance degradation during extended runtime
- [Feature Request] Plan mode should support plan files outside ~/.claude/plans directory
- [Bug] Anthropic API Error: Duplicate Tool Names in Request
- [BUG] 400 Input is too long for requested model with `global.anthropic.claude-sonnet-4-5-20250929-v1:0`
- [BUG] API Error: 400 Failed to deserialize the JSON body into the target type
- [Bug] Anthropic API Error: 'thinking' blocks cannot be modified
- [BUG] maximum of 4 blocks with cache_control may be provided
- [BUG] input_schema does not support oneOf, allOf, or anyOf at the top level
- [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant message
- API Error 400 'Could not process image' kills entire session with no recovery
- [Bug] Anthropic API Error: Image dimensions exceed max allowed size (8000 pixels)
- Claude no reply
- messages.11.content.11: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified.
- [BUG] v2.1.121: CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 + Opus 4.7 causes 401 "OAuth authentication is currently not supported" retry-loop
- [BUG] Max 5x → Max 20x upgrade stuck in void_invoice loop — server returns same canceled PaymentIntent on every retry
- [FEATURE] Align tool_reference.tool_name character limit with tool.name (128 characters)
- Session permanently wedged on 400 "thinking blocks cannot be modified" after parallel tool_results
- [BUG] CLAUDE_CODE_EXTRA_BODY thinking config breaks WebSearch and WebFetch on Opus 4.7 [1m]
- [BUG] API Error: 400 Invalid 'user_id': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.
- [BUG] CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 bypasses model capability checks, breaks Haiku subagents
- [BUG] [1M] "Long context beta is not yet available for this subscription" error on Max plan ($200/mo)
- [Bug] Anthropic API Error: Invalid message structure with thinking blocks
- [BUG] API Error 400 "no low surrogate in string" when Bash output contains invalid Unicode
- [BUG] Error during compaction: Error: API Error: 400
- Bug Report: Custom Agent Fails with "Tool names must be unique" Error
- Suddenly Claude is not able to resume from previous...
- [BUG] /context fails on first try with thinking anabled, works on second try
- PRO account shows - Credit balance is too low
- Invalid JSON Request: Malformed Low Surrogate in API Payload
- [Bug] Anthropic API Error: Cannot Modify Thinking Blocks in Assistant Messages
- v2.1.116 fails with Bedrock: output_config.effort not permitted
- [Feature Request] Remove or make optional resume summary/compaction prompt on session resume
- [BUG] Breaking Change: Claude Code CLI Removed from Pro Plan Without Notice
- [BUG] Could not process image
- Compaction fails with 400 error when thinking blocks present in assistant message
- [BUG] API Error: 400 error
- [Bug] Anthropic API Error: Image exceeds 5 MB maximum size limit
- [Bug] Anthropic API Error: Image Upload Size Blocking All Message Attempts
- [BUG] Advisor blocks Fable 5 usage
- [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant message
- [BUG] API 400 text content blocks must be non-empty after pasting an image with Enter, contaminates session permanently
- [Bug] Anthropic API Error: Text content blocks contain only whitespace
- [Bug] Compaction fails with "Conversation too long" error, leaving session unrecoverable
- [Bug] Claude Code repeats completed plan steps due to stale state
- [Bug] Anthropic API Error: Cannot modify thinking blocks in multi-turn conversation