Claude Code: constantly seeing 'API Error (Request timed out...)' - Retrying in .. seconds.. (attempt x/10)'
roughly in the past 48 hours, since about my update to claude code 0.3.5, I'm getting these error messages most of the time I make requests. Pressing escape often doesn't keep the error messages from continuing to appear, counting to attempt 10/10 after which it stops trying to do anything. Logging out and back in didn't help, rebooting server didn't help. there are no connectivity issues of which I'm aware.
I was mostly using Opus lately, but Sonnet seems to have the same issues.
● Read(tests/utils/factories.py)
⎿ Read 459 lines (ctrl+r to expand)
⎿ API Error: Request timed out.
/model sonnet
⎿ Set model to sonnet (claude-sonnet-4-20250514)
please continue
⎿ API Error: Request timed out.
(running on ubuntu 24.04 x64)
Claude Code Status v1.0.35
L Session ID: 3824b60a-912c-4fad-8492-ad4c76098456
Account • /login
L Login Method: Claude Max Account
L Organization:
Memory • /memory
L project: CLAUDE.md
Model • /model
L sonnet (claude-sonnet-4-20250514)
Currently running: npm-local (1.0.35)
Invoked: /home/user/.claude/local/node_modules/.bin/claude
Auto-updates: Yes
Config install method: local
Config auto-updates: true
119 Comments
I also am fighting with this issue, only happening on Linux dev machine, MacOS not affected or WSL.
`
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 5 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 17 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 36 seconds… (attempt 7/10)
⎿ API Error (Request timed out.) · Retrying in 40 seconds… (attempt 8/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 40 seconds… (attempt 9/10)
⎿ API Error (Request timed out.) · Retrying in 8 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 20 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 34 seconds… (attempt 10/10)
⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 7/10)
⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 8/10)
⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 9/10)
⎿ API Error (Request timed out.) · Retrying in 35 seconds… (attempt 10/10)
`
I just tossed the whole local config and install in ~/.claude/, npm uninstalled and reinstalled everything and the problem is gone, so I guess the issue is local profile corruption.
I've got the same problem, I'm using Mac OS.
oh, we're 24h later and I'm seeing this again with my new install:
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 9 seconds… (attempt 5/10)
I don't think it's bugged install, it's something on their side, as I just left it and it continued after some time, so probably backend related.
I'm experiencing the same issue. Working with Claude Code is often unworkable because of it. I haven’t found a solution yet, other than repeatedly trying again.
I just leave it retrying and if usually continues after some time which tell me it's backend/server related.
After deleting WSL ubuntu and reinstalling claude, it didn't work, but after rebooting Windows, it worked.
I don't know the cause at all. I think I'll try rebooting next time.
anyone solved the problem?? I use macOS and having the same problem...tried restarting and uninstalling and reinstalling. Nothing changed, still the error persists.
Using Ubuntu WSL on Windows. Confirming same issue.
After extensive debugging throughout the day, I've identified what appears to be the root cause of my API errors. The issue rendered Claude Code essentially non-functional for my workflow. My investigation led me to implement Cloudflare AI Gateway as a proxy layer to gain better observability into the API request/response cycle. While this didn't directly resolve the issue, it provided crucial diagnostic data. Note that Cloudflare AI Gateway works with Claude Code subscriptions as well - I'm mentioning this purely as a debugging tool, not endorsing any particular service. My sole focus was resolving the issue.
Analysis of the request logs revealed that ~40% of API calls were failing with the following error:
json{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "max_tokens: 150000 > 32000, which is the maximum allowed number of output tokens for claude-opus-4-20250514"
}
}
This revealed the issue: I had previously modified the max_tokens parameter to 150000 while troubleshooting the API issues. This value exceeds the model's maximum output token limit of 32000. After reverting to max_tokens: 32000, the API errors ceased immediately. The same operations that previously triggered consistent failures have now been running stable for 60+ minutes.
I'm sharing this in hopes it provides a concrete troubleshooting vector for others experiencing similar issues. I recommend either:
Since making this adjustment, I haven't encountered a single API error in my logs.
right, in my case as well, i have solved it with this method.
Nice. Does anyone know how to change this for the WSL Ubuntu CLI?
Don't see anything like max_tokens within the /config .
I use the same WSL Ubuntu setup and had trouble finding this too. The max_tokens setting is actually configured through an environment variable in your .bashrc file, not in the config directory.
Check your .bashrc file for this line: bashexport CLAUDE_CODE_MAX_OUTPUT_TOKENS=
okay, thank you. would be nice if claude respected this setting itself as well though, I've had a few occurrences of claude chewing on answers for a very long time and then erroring by saying "oh I can't tell you now" rather than chunking better.
I'm having the same issue, but doens't matter the size of my requisition (1k or 50k tokens), the problem keeps happening
same problem here at MacOS. My solution is to escape the running process and switch /model to sonnet. After that tell Claude to continue.
Thanks for sharing. I tried it as I had the same issue:
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 17 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 34 seconds… (attempt 7/10)
⎿ API Error (Request timed out.) · Retrying in 33 seconds… (attempt 8/10)
I tried that, ESC, switched model to sonnet (even though pro only has access to it) and asked to continue., On my end, it stayed stuck on:
Progressing… (18s · 5 tokens · esc to interrupt · offline)
And eventually, out of nowhere, it started to work
Progressing… (357s · ↓ 5.8k tokens · esc to interrupt · offline)
But then, I got it again:
API Error (Request timed out.) · Retrying in 40 seconds… (attempt 10/10)
So, I guess that sort of worked for me so it finished it task, 🙏🥳
Theory: I had Claude Code opened for a few days now working on the same project. Perhaps it's because I don't close it? I'll try that to see if I get time out again.
removing the increased limit definitely seems to have helped, but Opus is still unstable as hell atm generally, so idk if this solves all.
Same issue here, specifically it works fine in WSL, but in my linux dev vm it times out...
I have exactly the same thing....
but performance with wsl is hell - not claudes fault. So i tried a ubuntu VM
Funny thing is if I reboot my machine and thus Hyper-V, it works for a brief moment, I can see token begin to move and then it disconnects again...
While in WSL, it works just fine...
What Node.js versions are you running? I'm on 20.11.0....tried 18, same story
I found a fix for the above issue, at least for me it started working flawlessly after this.
This issue was with my
/etc/resolv.confentry for one of the nameservers. I hadnameserver 192.168.0.2andnameserver 8.8.8.8as the 2nd. The first entry leads nowhere and was causing the issue. What I did was (i'm running RedHat, might be different for other distros):/etc/resolv.conf8.8.8.8or8.8.4.4you need to change it. to one of these two and get rid of the other line or have two entries from Google.NetworkManager, so we need to configure that, too.sudo nano /etc/NetworkManager/NetworkManager.confand in the[main]section adddns=none. Save the file.sudo systemctl restart NetworkManager.Constantly hitting
API Error (Request timed out.)on MacOS.Thanks so much, It works
You naild it man, it's working for my right now. Thanks!
oddly changing dns fixed it for me as well. I was running a simple forwarder on my router with adguard, nothing was getting blocked though so not really sure why dns would be a problem.
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.
Thanks everyone! All the talk of DNS lead me to my own fix. I run pi-hole with Cloudflared for DoH. However, my fallback if the pi-hole is offline is to use
1.1.1.2. It seems claude code does not play nicely with1.1.1.2. Once I fixed my pi-hole, the Request timeouts in claude code went away.The fix was to check your DNS settings.
In my case, I had set Pi-hole as the DNS server. After removing it and reverting to the default DNS, the issue was resolved.
For those using adguard, it looks like they've added a subdomain of anthropics, (specifically, ||statsig.anthropic.com^) to a block list. I'm guessing pihole and other dns level ad/tracker blockers have done the same. I whitelisted that domain and it seems to have fixed it on my end.
https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt
For me the issue was encrypted DNS settings on the Windows side which I had manually set to 1.1.1.1 and 9.9.9.9.
On Win11 got to Settings-->Network & internet-->Ethernet/WiFi and edit the IPv4 settings to be Unencrypted.
I have yet to mess around with different providers/settings to see if it is all encrypted DNS or certain ones.
The fact that it is now working while still using the same providers rules out that there was some DNS filtering being applied by the DNS providers, although this may be different for others.
EDIT: I believe I misspoke, I did indeed switch to 8.8.8.8 in Windows DNS from 1.1.1.1 so provider DNS filtering from cloudflare is still a possibility
Other things I adjusted was the resolv.conf file in WSL and changed WSL networking mode to mirrored but I do not think those made a difference.
Hope this helps someone!
For me, this problems suddenly started on Ubuntu WSL and they have nothing to do with length, as the most basic tasks without any context are failing after one or two messages.
In my case, I kept getting timeouts until I switched to using the paid API instead of the subscription through /login. And voilà! No more timeouts. Anthropic is just gently pushing everyone to use the API (which can burn through more money in a day of active coding than a monthly subscription costs). Pretty shady practice.
same issue here since a week
Same problem for the last 4 days, making Claude code absolutely useless
Same here. I usually do have to manually reset the model, and it might not work if the conversation was set on another model (or downgraded to it)
This worked for me, thanks! Changed my DNS IPV4 to 8.8.8.8
Same problem here. Not sure exactly what is happens, status page on anthropic shows green for claude code, but...
I increased the max_tokens as advised above to no improvement . The weird thing I noticed is that after making a plan, not a huge one, just porting a couple of files from one project to another, and reading the first file, which is a 500-line python script, code says 3% context left until auto-compact. Which is a little bit weird, I've been doing way longer sessions. I also noticed something different in some prompts, maybe it's an update that was pushed?
Or maybe it's the fact the the lead dev and PM have moved to Cursor ? :D
Anyway, pretty bad experiences in the last days.
Edit:
Second observation: now it compacts after EACH file edit. As if after compaction the context is not release, because immediately it says 'Context left until auto-compact: 0%'. It's stuck in a continuous compaction loop.
I've been having the same issue for the past three days. Interestingly, I've been using Claude Code the same way for the past 2 months, without changing my network settings, setup, config, etc... Never had the issue. Then randomly it started popping up 3 days ago and now it's very frequent. Today I can't use CC at all, because the API error keeps showing up.
I now always use —model, splicing the API… except at some point yesterday
when there was a straight up outage
On 16 July 2025 at 15:31:57, alessandro-latenta @.***)
wrote:
Same here, I used to run 2 or 3 claude code instance and didn't see any issue. last 2 days, with even one instance, I get overloaded or request timeout errors. 20x Max subscription, UK.
Same here, I've been down for the past 12 hours.
It's entirely not usable now, it had been persistently showing API Error (Request timed out) for the past 24 hours. I am on 20x Max.
I wonder why claude code fails, but cursor's claude API calls do not?
I noticed that. It seems very inconsistent. I use Trae as an alternative to Cursor with the Claude model. It worked for about 30 minutes before it stopped. Not sure what to deduce from that...perhaps a limit being put on the number of api calls based source.
A theory that I'm sure is most likely wrong but just thought I'd share it: When using Cursor and the like, it might be routing everything through their own servers first, doing the back and forth communication with Anthropic and then send it back to you? This might explain why some have DNS issues that is not visible through Cursor (or any other Anthropic resellers like windsurf, copilot, augment code, trae, kiro, etc.) while Claude Code is calling Anthropic's API directly (no middleman)?
Good thought. I noticed they're saying they completed their troubleshooting but im still getting api errors. Hopefully the issue gets reopened. https://status.anthropic.com/
I thought myself run into this issue but a quick search took me here :-). Hope this fixed soon.
<img width="994" height="309" alt="Image" src="https://github.com/user-attachments/assets/effbfcff-094f-4203-a21d-5146c2e4fc50" />
<img width="723" height="265" alt="Image" src="https://github.com/user-attachments/assets/aec8f033-8d15-4f98-ab7c-e9f38fb9a847" />
Same here, can't compact the conversation.
Still happening for me even though anthropic status says green for claude code
Also having this problem
it is basically unusable now
Removing
MAX_THINKING_TOKENSfrom my environment fixed the API issues for meAlso having the same issue. Getting lots of
API Error (Request timed out.)and the status page shows no problems.+1 un France.
A bit early, but testing might bee going on, so it might be related to this:
Personally, I solved the api error issue by updating the DNS settings as suggested in this thread as there seems to be an issue with Cloudflare's DNS and Claude Code recently.
Error 429 is on Anthropic's end and is often updated on relating to an issue tracked by their dashboard: https://status.anthropic.com/.
--
If you think the issue you're experiencing the api error (and not 429), try this:
If it doesn't resolve the IP and you get an error, my assumption is Claude Code will have the same issue internally.
Changing your DNS to something other than 1.1.1.1/1.0.0.1 seemed to be the solution for me. You can use any, I personally used Google's as my first attempt and it worked:
Google Public DNS
Other options:
-- Primary: 9.9.9.9
-- Secondary: 149.112.112.112
-- Primary: 208.67.222.222
-- Secondary: 208.67.220.220
-- Primary: 45.90.28.190
-- Secondary: 45.90.30.190
nslookup api.anthropic.com solves properly, I am not using cloudflare dns.
claude code... when I start getting those errors, simply closing it and then hit /resume works again, so either claude code is corrupting something, or the api is angry, or something else. I'm on max plan, though I am still testing if it's worth keeping.
Now I got another error:
And agai I have the API Error (Request timed out...).
clear context make it work :D
same issue here. Seem like they still working on this issue [https://status.anthropic.com/](url)
These problems could be related to the CC default settings for max tokens.
According to this article, the default CLAUDE_CODE_MAX_OUTPUT_TOKENS is too high.
I changed these env vars and my api errors went away 🎉🎉🎉:
I had the same issue.
Try this in your wsl terminal:
sudo resolvectl dns eth0 8.8.8.8
then restart your dns server
sudo systemctl restart systemd-resolved
If this works, you need to change your DNS settings to this Because this will only work for the Windows session.
I had the same issue.
Try this in your wsl terminal:
sudo resolvectl dns eth0 8.8.8.8
then restart your dns server
sudo systemctl restart systemd-resolved
If this works, you need to change your DNS settings to this Because this will only work for the Windows session.
Thanks @JaguarsMark, works well now!
I edited the /etc/resolve.conf file with 8.8.8.8 then restarted the dns service with :
sudo systemctl restart systemd-resolvedVarious DNS fixes did not work for me.
nslookupresolves properly and I'm still getting this issue.Setting
CLAUDE_CODE_MAX_OUTPUT_TOKENS,MAX_THINKING_TOKENSalso didn't work for me.Sometimes claude code works. Most of the time claude code does not work for me :-(. Support did not answer my request (I requested a human and they said they would email me. Will update if they reach out).
Update, I tried on windows and it works. So it's a linux/wsl issue...
I'm not on any special enterprise machine. Just normal internet and a pretty new wsl installation with no customizations, so this is strange to me.
Edit:
https://github.com/anthropics/claude-code/issues/532#issuecomment-2859143133
Solved it for me.
I finally gave up and created a new anthropic account and started over.
Extensive and detailed analysis culminating in comment here https://github.com/anthropics/claude-code/issues/1536#issuecomment-2956863087 indicates this is network-specific. Main points:
My conclusion? Some server/network/routing issue.
Must be ramping up utilization on the West Coast because right on time, we're back to timeouts...
``
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)``⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 18 seconds… (attempt 6/10)
East coast here, been doing this all day.
API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 5 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 10 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 17 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 40 seconds… (attempt 7/10)
⎿ API Error (Request timed out.) · Retrying in 34 seconds… (attempt 8/10)
⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 9/10)
I'm on the westcoast and just started experiencing the same.
Brazil:
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 10 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 17 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 7/10)
⎿ API Error (Request timed out.) · Retrying in 33 seconds… (attempt 8/10)
⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 9/10)
⎿ API Error (Request timed out.) · Retrying in 34 seconds… (attempt 10/10)
⎿ API Error: Request timed out.
their status shows everything is fine:
https://status.anthropic.com/
<img width="886" height="753" alt="Image" src="https://github.com/user-attachments/assets/c6f0af2c-0e00-44eb-afa4-b75f7b01db7f" />
<img width="220" height="123" alt="Image" src="https://github.com/user-attachments/assets/d8a5e86a-2215-4f91-ab0e-5541d4b872a0" />
I encountered the same issue.
Re-authentication didn't resolve it, but after investigation, I found it was an MTU problem.
I've documented the details below.
Hope this helps others.
Claude Code WSL2 Connection Error Fix
Issue Symptoms
API Error (Connection error.) · Retrying in X seconds… (attempt X/10)when running Claude Code in WSL2TypeError (fetch failed)errorsRoot Cause
MTU (Maximum Transmission Unit) Size Issue
WSL2's default MTU setting (typically 1500 bytes) is too large, causing:
Solution
Ineffective Solutions (Tested)
The following approaches did NOT resolve the issue:
Diagnostic Method
Monitor network packets to confirm:
If you observe repeated packet retransmissions, MTU issues are likely the cause.
Environment Details
MTU adjustment provided immediate resolution.
This did not work.
This resolved my issue of getting constant
API Error (Request timed out.).I am facing this still today and i am on 1.0.64 and face this consistent issue of API Error (Request timed out.)
sometimes it tries and fails all 10 times sometimes it starts working on 9th try but fails on the next query all 10 times
Environment Details
Also 1.0.64 1,5 hour no request went through. Then like 5 minut of few requests passed and now again 15 minutes no requests are passing.
Im on WSL2.
Same problem with the max plan all the time.
<img width="647" height="183" alt="Image" src="https://github.com/user-attachments/assets/906c9867-e837-4218-b7ff-5d11ac13a353" />
Fully uninstall Little Snitch from your macOS. Just disabling it or setting it to ALL ON won't solve the problem. No need to say thank you.
Erp. Wut?
to me, the problem was with the docker where I was running claude code on: for lack of storage space, it was not working properly anymore... once I made some extra spece and restarted it, everything went back to normal
the solution of @Ryotaniii worked, why they didn't include it in the updates?
I just updated claude code with npm and the problem resolved.
npm update -g @anthropic-ai/claude-code --verbosesame error in mac, solved it with exit current session and restart a session
Ya its work for me thank you
I'm on Windows _without WSL2_ and have the same issues. It's not a WSL2 Linux or a Mac thing.
To everyone trying to find a solution: many things will solve the problem temporarily because it resets something etc.
If anything the shared solutions so far is telling us one thing and one thing only: the error messages associated with this issues can disappear for a while when resetting something relevant. This kind of reset may be hiding the message for a while or it may actually fix the issues for a while. And it seems true for all platforms.
I tried update
npm update -g @anthropic-ai/claude-code --verboseand @Ryotaniii solution. But still getting timeouts. On laptot it works, desktop keeps getting timeouts.I tried update
npm update -g @anthropic-ai/claude-code --verbose, but still getting timeouts.I run
npm rm -g @anthropic-ai/claude-codeandcurl -fsSL claude.ai/install.sh | bash, but still getting timeouts.on the $200 a month plan, and nothing has worked to fix this. I've got 2 days of downtime over this. Not cool Claude.
Running
/clearhelps fix some of these API errors, but it's inconsistent, and/compact, which should theoretically do the trick, doesn't work either. This is frustrating since I recently started using Claude-code, and it is not living up to the hype. The usage metrics are not clear or transparent, and I hit my limits in less than 30 minutes. If I don't hit the limits, then I hit API errors.The solution for me was changing the install method from "unknown" to "global" in the config. This issue only appeared after switching to the Powerlevel10k terminal decorator and installing Claude code with NVM on Mac through Brew. I'm not sure what might have corrupted or improperly set up the config, but I suspect it might be related to installing via NVM Brew.
For now, this fix has resolved the issue. I plan to gradually reintroduce my original terminal and environment config to identify the exact cause.
Works perfectly to me! Thanks @zroman88
export API_TIMEOUT_MS=600000 worked like a charm for me.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I noticed this error occurs only when Docker is running. Once I quit Docker, the API errors stop and tokens start being consumed again.
Does anyone have suggestions for running Claude inside Docker?
I had this problem in May, June, July, when the docker container was in Austin Texas, but not when the container was in Paris France or Vilnius Lithuania. Then, late July or early August, the container in Austin started working fine.
Network debugging hints that this is due to overloaded networks and time-of-day effects (works when it is NOT Monday-Friday 10AM to 8PM California time)
A work-around was to use TOR (torsocks) before starting Claude. TOR will encrypt and route the network traffic to somewhere outside the US, and then it would work. Coworkers report that using a VPN also solves the issue.
Note that if the code you are developing/debugging uses the network, then TOR/VPN can interfere with that. I was using MCP and had to write a custom tcp/ip bridge to hop out of TOR/VPN for that portion.
Hope that helps.
p.s. Other people have reported that this is DNS related, and that using a faster DNS resolver solves the issue (e.g. using 8.8.8.8) This might be because Claude bounces between lots of different servers, and if DNS can't find the server, or can't find it fast enough, then Claude croaks. That would be consistent with some of what I saw (but I did not test.)
I have same issues. DNS update doesn't help
This should be feeling better in later versions. We're also releasing a few minor UX improvements for timeouts today/tomorrow.
For folks hitting this:
If you're still hitting this and the above doesn't work, please open a new issue.
Turn off any ad blocks you have running; for me it's AdGuard.
I started seeing the new messaging and thought something new broke so I put in this bug: https://github.com/anthropics/claude-code/issues/6424
But I was able to fix it by adding public DNS addresses to my wifi settings:
<img width="660" height="421" alt="Image" src="https://github.com/user-attachments/assets/539a0e38-a103-454b-9131-95ae328589a0" />
so outages are a usual thing on this company that gives 0 suport ?
API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 34 seconds… (attempt 10/10)
API Error (Request timed out.) · Retrying in 17 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 36 seconds… (attempt 7/10)
and status page says everything is ok, been down for like 1 hour now
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 17 seconds… (attempt 6/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 38 seconds… (attempt 7/10)
got the same problem. 200 max sub
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 20 seconds… (attempt 6/10)
⎿ API Error: Operation aborted
Got the same: 200 max subscription
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 10 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 17 seconds… (attempt 6/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 33 seconds… (attempt 7/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 39 seconds… (attempt 8/10)
same here. 100 max
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 18 seconds… (attempt 6/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 35 seconds… (attempt 7/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 35 seconds… (attempt 8/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 35 seconds… (attempt 9/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 38 seconds… (attempt 10/10)
Got the same: 200 max subscription
Downdetector shows a large number of reports for anthropic right now.
Same here, stuck for an hour... :(
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 5 seconds… (attempt 4/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 18 seconds… (attempt 6/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 36 seconds… (attempt 7/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 39 seconds… (attempt 8/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 37 seconds… (attempt 9/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 33 seconds… (attempt 10/10)
⎿ API Error: 504 <!DOCTYPE html>
got it twice in the last hour. stuck now compacting...
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 17 seconds… (attempt 6/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 39 seconds… (attempt 7/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 34 seconds… (attempt 8/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 39 seconds… (attempt 9/10)
✢ Compacting conversation… (esc to interrupt · /todos)
upgrade to 200 max plan didn't help.
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 10 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 18 seconds… (attempt 6/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 35 seconds… (attempt 7/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 37 seconds… (attempt 8/10)
same issue
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 5 seconds… (attempt 4/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 19 seconds… (attempt 6/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 38 seconds… (attempt 7/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 35 seconds… (attempt 8/10)
⎿ API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 39 seconds… (attempt 9/10)
None of those worked 😟
Same here
Claude code running in Singapore Azure server, Ubuntu 22.04
⎿ API Error (api.anthropic.com | 504: Gateway time-out)
· Retrying in 18 seconds… (attempt 6/10)
https://the-decoder.com/anthropic-will-set-new-weekly-usage-limits-for-claude-subscribers-starting-august/
likely due to the new limits going live today (august 28)
WSL restart, claude restart don't work.
Things that worked:
ubuntu 24lts ⎿ API Error (503 no healthy upstream) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (503 no healthy upstream) · Retrying in 10 seconds… (attempt 5/10)
⎿ API Error (503 no healthy upstream) · Retrying in 20 seconds… (attempt 6/10)
⎿ API Error (503 no healthy upstream) · Retrying in 35 seconds… (attempt 7/10)
⎿ API Error (503 no healthy upstream) · Retrying in 38 seconds… (attempt 8/10)
I had the same errors, it was vpn related. switched my vpn off and its fine
Same issue, I am using MacOS
⎿ API Error (Connection error.) · Retrying in 5 seconds… (attempt 4/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 10 seconds… (attempt 5/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 19 seconds… (attempt 6/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 35 seconds… (attempt 7/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 34 seconds… (attempt 8/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 39 seconds… (attempt 9/10)
⎿ TypeError (fetch failed)
⎿ API Error (Connection error.) · Retrying in 33 seconds… (attempt 10/10)
⎿ TypeError (fetch failed)
⎿ API Error: Connection error.
these are the quantized model and api timeout hours everyday apparently. same timeout error
happens all the time....
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.