Frequent 504 Gateway Timeout errors from api.anthropic.com

Status Closed — not planned
Maintainer reply None cached
Activity 14 comments · opened Aug 29, 2025 · closed Jan 5, 2026

Description

Experiencing frequent and random 504 Gateway Timeout errors when using Claude Code, which significantly impacts productivity.

Error Details

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 16 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 34 seconds… (attempt 8/10)

I'm now having difficulty recovering my session, even after the agent responded:
<img width="965" height="380" alt="Image" src="https://github.com/user-attachments/assets/2b37139f-2b45-4ee0-9f45-4c647f9f8672" />

Frequency

These errors occur randomly during normal usage, often requiring multiple retry attempts before succeeding.

Impact

  • Interrupts workflow
  • Causes delays in development
  • Sometimes requires 8+ retry attempts

Environment

  • Claude Code CLI
  • Platform: macOS (Darwin 23.5.0)
  • Date observed: 2025-08-29

Expected Behavior

API calls should complete successfully without frequent gateway timeouts.

Additional Context

The retry mechanism does eventually succeed in most cases, but the frequency of these errors suggests there may be an infrastructure or rate limiting issue that needs investigation.

Workaround:

I was able to recover my session task by asking the agent to break out the output file into seperate smaller files.

<img width="1362" height="200" alt="Image" src="https://github.com/user-attachments/assets/2ba8c65f-be5a-4ec5-a251-261ab33bb20c" />

I got it to write one file, but now it's stuck again:

<img width="612" height="53" alt="Image" src="https://github.com/user-attachments/assets/bf1940c4-9830-4819-9088-06374cc6d538" />

Here's a screenshot of my current context usage for whomever at anthropic works on debugging this issue:
<img width="846" height="280" alt="Image" src="https://github.com/user-attachments/assets/69dc97e5-19e0-4e7c-8b7a-e3dc2c3191f6" />

View original on GitHub ↗

14 Comments

dimfeld · 1 year ago

Same here. It starts out working ok but as context length grows I run into these errors. I think #6781 is the same issue.

github-actions[bot] · 1 year ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/6781

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

roy-law · 1 year ago

same here. It started from 6pm EST onwards. very confusing and frustrating. Just reached out to support team but haven't got any feedback

roy-law · 1 year ago

For more context:
<img width="796" height="835" alt="Image" src="https://github.com/user-attachments/assets/2e26b4e7-a929-4788-943f-1261b737da01" />

ty13r · 1 year ago
same here. It started from 6pm EST onwards. very confusing and frustrating. Just reached out to support team but haven't got any feedback

https://status.anthropic.com/ not showing any outages.

eyal-spexsai · 1 year ago

same here

Suketug · 1 year ago

Full Context
<img width="1029" height="864" alt="Image" src="https://github.com/user-attachments/assets/9cc17b7f-a529-4714-981d-20fb76754df5" />
<img width="1059" height="800" alt="Image" src="https://github.com/user-attachments/assets/7f546f4c-df46-47c6-81ea-44fe7f0edab1" />

a7asoft · 1 year ago

Same here

Suketug · 1 year ago

So, here is what happened, after the error I hit:

<img width="722" height="337" alt="Image" src="https://github.com/user-attachments/assets/f30cf7fe-91c6-465b-9658-21f49fd28f46" />

ty13r · 1 year ago

Not sure if this has anything to do with it, but they just updated their status page:

<img width="879" height="247" alt="Image" src="https://github.com/user-attachments/assets/87527e43-ea0c-4af6-98b9-985457230005" />

Suketug · 1 year ago

I think it's resolved and working fine for me now.

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months 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.