[BUG] API Error (Request timed out.)

Status Closed — duplicate
Maintainer reply None cached
Activity 15 comments · opened Jun 21, 2025 · closed Jul 27, 2025

there's a vast chain of these. my set up is same as my auto-compiling error from just yesterday.

⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)

View original on GitHub ↗

15 Comments

Andre-Profitt · 1 year ago

uhhh so I made a different account on my computer downloaded claude code again and I'm not having ANY issues at all anymore.

this was seriously unusable

vanman2024 · 1 year ago

Its happening all day today super slow

vanman2024 · 1 year ago

Let me kill any existing backend processes and restart it properly:
⎿ Error: Error

● Let me kill any existing backend processes and restart it properly:

● Bash(pkill -f "python stable_api.py" || true)
⎿ Error: Error
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.37: tool_use ids were found without tool_result blocks immediately after: toolu_01DGP3WS5zZN1vnBKBkKmLtK. Each
tool_use block must have a corresponding tool_result block in the next message."}}
I am getting these all day persistenly

ratacat · 1 year ago

I'm getting a ton of these also...@andre-profitt you like made a new local user account? Seems crazy that that would be what it takes

vanman2024 · 1 year ago

It was an authentication issue all you have to do is logout and log back in using the terminal

________________________________
From: ratacat @.*>
Sent: Monday, June 23, 2025 1:19:08 PM
To: anthropics/claude-code
@.*>
Cc: vanman2024 @.>; Comment @.>
Subject: Re: [anthropics/claude-code] [BUG] API Error (Request timed out.) (Issue #2421)

[https://avatars.githubusercontent.com/u/3517397?s=20&v=4]ratacat left a comment (anthropics/claude-code#2421)<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997828027>

I'm getting a ton of these @.***<https://github.com/Andre-Profitt> you like made a new local user account? Seems crazy that that would be what it takes


Reply to this email directly, view it on GitHub<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997828027>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BLWU4R5BNOEIS24BJDGROGL3FBOLZAVCNFSM6AAAAAB72PKEAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJXHAZDQMBSG4>.
You are receiving this because you commented.Message ID: @.***>

ratacat · 1 year ago

Interesting, I closed my terminal and opened it again, we'll see if that helped. Seems good so far.

Nope, still getting them.

vanman2024 · 1 year ago

You must fully logout and reauthenticate

________________________________
From: ratacat @.*>
Sent: Monday, June 23, 2025 1:24:42 PM
To: anthropics/claude-code
@.*>
Cc: vanman2024 @.>; Comment @.>
Subject: Re: [anthropics/claude-code] [BUG] API Error (Request timed out.) (Issue #2421)

[https://avatars.githubusercontent.com/u/3517397?s=20&v=4]ratacat left a comment (anthropics/claude-code#2421)<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997841263>

Interesting, I closed my terminal and opened it again, we'll see if that helped. Seems good so far.


Reply to this email directly, view it on GitHub<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997841263>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BLWU4RYQKEV6QMVLAEEZPN33FBPAVAVCNFSM6AAAAAB72PKEAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJXHA2DCMRWGM>.
You are receiving this because you commented.Message ID: @.***>

ratacat · 1 year ago

hmmm logged out of claude and reauthenticated, but still an issue... are you talking about logging out of your local?

vanman2024 · 1 year ago

Yes use the claude logout /command and then restart the session using claude command

________________________________
From: ratacat @.*>
Sent: Monday, June 23, 2025 1:33 PM
To: anthropics/claude-code
@.*>
Cc: vanman2024 @.>; Comment @.>
Subject: Re: [anthropics/claude-code] [BUG] API Error (Request timed out.) (Issue #2421)

[https://avatars.githubusercontent.com/u/3517397?s=20&v=4]ratacat left a comment (anthropics/claude-code#2421)<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997862526>

hmmm logged out of claude and reauthenticated, but still an issue... are you talking about logging out of your local?


Reply to this email directly, view it on GitHub<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997862526>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BLWU4R6PH257NP2ZDYAU3DD3FBQAVAVCNFSM6AAAAAB72PKEAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJXHA3DENJSGY>.
You are receiving this because you commented.Message ID: @.***>

ratacat · 1 year ago

I did that already, didn't fix anything unfortunately.

vanman2024 · 1 year ago

Sorry to hear that I did this earlier and the reauthenticated it and don't seem to have any more issues.

________________________________
From: ratacat @.*>
Sent: Monday, June 23, 2025 1:39:04 PM
To: anthropics/claude-code
@.*>
Cc: vanman2024 @.>; Comment @.>
Subject: Re: [anthropics/claude-code] [BUG] API Error (Request timed out.) (Issue #2421)

[https://avatars.githubusercontent.com/u/3517397?s=20&v=4]ratacat left a comment (anthropics/claude-code#2421)<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997875830>

I did that already, didn't fix anything unfortunately.


Reply to this email directly, view it on GitHub<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997875830>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BLWU4R77DFBSOOI3GEZUMMT3FBQWRAVCNFSM6AAAAAB72PKEAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJXHA3TKOBTGA>.
You are receiving this because you commented.Message ID: @.***>

vanman2024 · 1 year ago

Hi Ryan,

Thanks for reaching out to Anthropic Support.
​
I've reviewed your screenshots, and I can see you're experiencing persistent errors with Claude Code. These patterns of repeated timeout errors and offline statuses are usually a sign that there's an authentication problem between your Claude Code client and your Max subscription credentials. When this happens, the system can get caught in cycles of failed connection attempts.

Based on what I'm seeing, it looks like you're dealing with two related problems:

  1. The continuous API timeout errors suggest that Claude Code is struggling to maintain a proper connection with your Max subscription services.
  2. The 400 error about missing "tool_result" blocks is likely a consequence of these connection problems. When Claude Code attempts to execute commands (like the git operations shown in your screenshots), the unstable connection interrupts the process before it can complete properly.

Here's what I recommend to resolve both issues:

  1. Reset your authentication completely: Run claude logout in your terminal Then claude login and sign in again with your credentials
  2. After re-authenticating, start a fresh conversation rather than continuing the previous one, as the current conversation state may be corrupted.
  3. Test with a simple command before attempting more complex operations to ensure your connection is stable.

These steps should address the authentication problems, which should in turn prevent the tool execution errors from occurring.

If you continue to experience issues after these steps, please let me know what happens, and we can explore additional troubleshooting options.

Best,
Spike

________________________________
From: Ryan Angel @.*>
Sent: Monday, June 23, 2025 1:42 PM
To: anthropics/claude-code
@.*>
Subject: Re: [anthropics/claude-code] [BUG] API Error (Request timed out.) (Issue #2421)

Sorry to hear that I did this earlier and the reauthenticated it and don't seem to have any more issues.

________________________________
From: ratacat @.*>
Sent: Monday, June 23, 2025 1:39:04 PM
To: anthropics/claude-code
@.*>
Cc: vanman2024 @.>; Comment @.>
Subject: Re: [anthropics/claude-code] [BUG] API Error (Request timed out.) (Issue #2421)

[https://avatars.githubusercontent.com/u/3517397?s=20&v=4]ratacat left a comment (anthropics/claude-code#2421)<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997875830>

I did that already, didn't fix anything unfortunately.


Reply to this email directly, view it on GitHub<https://github.com/anthropics/claude-code/issues/2421#issuecomment-2997875830>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BLWU4R77DFBSOOI3GEZUMMT3FBQWRAVCNFSM6AAAAAB72PKEAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJXHA3TKOBTGA>.
You are receiving this because you commented.Message ID: @.***>

seflue · 1 year ago

Since yesterday I have the very same problem. Logout and login didn't help. Is there anything else, I can do, any internal cache I need to delete?

I constantly see this pattern:

!Image

At the same time sst/opencode works without any issues.

NellInc · 1 year ago

From Anthropic Support to me:

"The timeout issues with long todo lists appear to be related to the extended processing time required for complex multi-step tasks, which can exceed the default API timeout limits. As a workaround, you can increase the API timeout by setting the API_TIMEOUT_MS environment variable before launching Claude Code. For example, you can use the export API_TIMEOUT_MS=600000 command to set it for 10 minutes. The default appears to be 30 seconds (30000ms), but you can increase it significantly for complex tasks like long todo lists."

This worked for me personally.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.