[BUG] API Error: 522

Resolved 💬 2 comments Opened Jun 11, 2026 by vinceinting Closed Jun 14, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

All prompts lead to this API error:

API Error: 522 {"type":"https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-522/","title":"Error 522: Connection timed out","status":522,"detail":"Cloudflare could not establish a TCP connection to the origin server. The TCP handshake timed out, which may indicate the origin is overloaded, firewalling Cloudflare, or unreachable at the network level.","instance":"a09ddee54e2fbedb","error_code":522,"error_name":"connection_timeout","error_category":"origin","ray_id":"a09ddee54e2fbedb","timestamp":"2026-06-11T04:29:03Z","zone":"api.anthropic.com","cloudflare_error":true,"retryable":true,"retry_after":120,"owner_action_required":true,"what_you_should_do":"Wait and retry. Back off for at least 120 seconds. If the error persists, the website operator should verify firewall rules and ensure the origin accepts connections from Cloudflare IP ranges.","footer":"This error was generated by Cloudflare on behalf of the website owner."}. This iâ^@¦

What Should Happen?

Responses should be generated, tasks should be executed

Error Messages/Logs

API Error: 522 {"type":"https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-522/","title":"Error 522: Connection timed out","status":522,"detail":"Cloudflare could not establish a TCP connection to the origin server. The TCP handshake timed out, which may indicate the origin is overloaded, firewalling Cloudflare, or unreachable at the network level.","instance":"a09ddee54e2fbedb","error_code":522,"error_name":"connection_timeout","error_category":"origin","ray_id":"a09ddee54e2fbedb","timestamp":"2026-06-11T04:29:03Z","zone":"api.anthropic.com","cloudflare_error":true,"retryable":true,"retry_after":120,"owner_action_required":true,"what_you_should_do":"**Wait and retry.** Back off for at least 120 seconds. If the error persists, the website operator should verify firewall rules and ensure the origin accepts connections from Cloudflare IP ranges.","footer":"This error was generated by Cloudflare on behalf of the website owner."}. This

Steps to Reproduce

sending a prompt

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.172

Platform

Other

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗