zed icon indicating copy to clipboard operation
zed copied to clipboard

Agent Panel: Cannot access zed hosted models (via Cloudflare HKG)

Open thnt opened this issue 6 months ago • 12 comments

Summary

Configure AI assistant with zed hosted models (Claude 3.5, 3.7). It returns this error when sending request to model:

cloud language model completion failed with status 451 Unavailable For Legal Reasons: Access to Anthropic models is not available from this data center (HKG)

Zed Version and System Specs

OS: Linux Zed Version: Preview 0.185.6

thnt avatar May 06 '25 00:05 thnt

What is the country you're located at?

SomeoneToIgnore avatar May 06 '25 04:05 SomeoneToIgnore

I am having the same issue in the UK.

Yathushan avatar May 06 '25 05:05 Yathushan

What is the country you're located at?

I'm in VN

thnt avatar May 06 '25 06:05 thnt

Both should be supported indeed, and HKG data center selection for GB sounds very odd at least.

Also odd that not that many people experience that, and to my knowledge, Zed should merely query the Anthropic API without any data center selection. As if networks are somehow interestingly configured in your cases, but hard to say without extra data.

SomeoneToIgnore avatar May 06 '25 06:05 SomeoneToIgnore

Cloudflare is routing you via their HKG datacenter location. This seems plausible for @thnt in Vietnam. This is surprising for @Yathushan in UK, unless you are using a VPN.

Anthropic blocks all traffic from those HKG IPs. Currently, Cloudflare requires an enterprise subscription ($$$) for us to prevent our workers from being placed in Hong Kong. We are working on a solution, but do not have one at this time.

notpeter avatar May 06 '25 19:05 notpeter

Anthropic blocks all traffic from those HKG IPs. Currently, Cloudflare requires an enterprise subscription ($$$) for us to prevent our workers from being placed in Hong Kong. We are working on a solution, but do not have one at this time.

This is a most likely the reason. Gemini, Claude and ChatGPT are all blocked in China, which means that same applies for Hong Kong and Macau, as they are both Special Administrative Regions of China.

Edit: best to my knowledge, Grok should be available to those regions

ArturAronov avatar May 07 '25 02:05 ArturAronov

The same issue occurs not only in Hong Kong and Macau but also in South Korea. Developers in South Korea want to try it out as well, but currently, they are forced to let the trial period pass due to the same problem.

GuriDonghan avatar May 09 '25 01:05 GuriDonghan

Can confirm that this can be happening for Zed users in the Philippines as well. For more details, I did try to follow the comment on #16844 and it does resolve to the correct ISO-3166-1 country code for me, but I am still routed to the Hong Kong data center. I think it's the closest CF data center to me.

micahbule avatar May 09 '25 07:05 micahbule

here too from indonesa

Error interacting with language model cloud language model request failed with status 451 Unavailable For Legal Reasons: Access to Anthropic models is not available from this data center (HKG)

e-fu avatar May 16 '25 11:05 e-fu

Hi, any updates on this? It was working fine previously. If it has been recently blocked by Anthropic, could you provide a setting that allows us to configure a different datacenter to connect to?

thnt avatar May 23 '25 01:05 thnt

Hi, if you need a VPN to change your IP address, remember to write this line in the setting: "proxy": "socks5h://localhost:10808", where the port should be modified according to your VPN. By default no proxy will be used in Zed (which may be different from cursor, etc). BTW, I tried to set http_proxy, but it doesn't work. Therefore, I suggest you set the socks5 proxy in the setting.

realfanyujun avatar May 27 '25 03:05 realfanyujun

Is there some kind of DNS override I can use for a VPN I'm using, so I don't have to route all my traffic through it?

I'm in Vietnam... curl -s -4 --location --request GET 'https://www.cloudflare.com/cdn-cgi/trace' |grep loc gives me loc=VN

jpike88 avatar Jun 08 '25 08:06 jpike88

@jpike88: I'm in Vietnam...

curl -s -4 --location --request GET 'https://www.cloudflare.com/cdn-cgi/trace' |grep loc

gives me loc=VN

Yes. We (and Cloudflare) know you are in Vietnam, but the closest CloudFlare datacenter to you is Hong Kong (HKG) and so Anthropic blocks all traffic from IPs in China (Mainland, Hong Kong, Macau).

You'll likely see colo=HKG with:

curl -s -4 --location --request GET 'https://www.cloudflare.com/cdn-cgi/trace' |grep colo

notpeter avatar Jun 09 '25 14:06 notpeter

Wild idea: route all cloudflare workers in hk out via a proxy in AWS Singapore. Would your egress costs be too high? Would that maybe violate the terms?

jpike88 avatar Jun 09 '25 14:06 jpike88

Is there any update to this? Would it be possible for you to deploy the proxy to a different platform/location and provide a config to switch to a different server?

antran22 avatar Jun 21 '25 07:06 antran22

Here too from South Korea 👋

1eedaegon avatar Aug 05 '25 07:08 1eedaegon

Same issue from Japan.

stalkerg avatar Aug 05 '25 12:08 stalkerg

Same error triggered for users from the Philippines too

Error HTTP response error from Zed's API: status 451 Unavailable For Legal Reasons - "Access to Anthropic models is not available from this data center (HKG)"

jmrecodes avatar Aug 07 '25 14:08 jmrecodes

Why block Chinese IPs? Technology has no politics. unfortunate

freeyob avatar Aug 09 '25 12:08 freeyob

Why block Chinese IPs? Technology has no politics. unfortunate

Ask Anthropic. Zed and it's devs have nothing to do with the block. Neither does Cloudflare. Read the entire exchange.

micahbule avatar Aug 09 '25 12:08 micahbule

Same, issue in Japan. However, this issue has only started recently for me. Oftentimes, I can start a session just fine, but then in the middle of it from one prompt to the next, I get the error. I then switch the model over to Copilot's GPT and it works fine. Not sure what Anthropic is doing.

sassomedia avatar Aug 19 '25 12:08 sassomedia

We are working on a solution, but do not have one at this time.

A solution like, don't use Cloudflare workers? It seems like a pretty simple one to me.

Aeolun avatar Sep 08 '25 05:09 Aeolun

same issue here, from Philippines.

Is this Anthropics problem?

I've used Anthropic models for months and never got issue regarding legal or regional restrictions before. Was able to use Zed AI yesterday with no issues. I've used several AI agents, no issues either.

Also this is happening to OpenAI model in Zed too.

This issue is lingering since May, why is it still not resolved?

KeentGG avatar Sep 26 '25 10:09 KeentGG

same issue, from Pakistan.

Usually, Anthropic and OpenAI models never show this problem but for some reason Zed isn't allowing it's usage, I'm using it on Windows and updated to Zed Pro only to not be able to use any of the models at all.

Vortex127 avatar Oct 05 '25 17:10 Vortex127

After recent Zed update I got this issue as well. Location is Kazakhstan. Not only Claude unavailable, but also google Gemini 1.5 Flash now gives error "Failed to stream completion".

Few days ago both claude and gemini was working perfectly fine

Fak3 avatar Oct 08 '25 08:10 Fak3

Same issue in Kazakhstan.

romankurakin avatar Oct 10 '25 04:10 romankurakin

Do you guys need more information on this issue? I think this is an urgent issue.

❯ curl -s -4 --location --request GET 'https://www.cloudflare.com/cdn-cgi/trace' |grep colo
colo=HKG

tienbg-zigexn avatar Oct 10 '25 17:10 tienbg-zigexn

I’m having the same issue, I can use Claude Code normally from Vietnam, but Claude Sonnet doesn’t work in Zed.

datlechin avatar Oct 17 '25 17:10 datlechin

Same issue in Vietnam with GPT-5 and Claude Sonnet

NdQuan127 avatar Oct 24 '25 07:10 NdQuan127

Same issue in Vietnam with Optus 4.1 thinking.

do2358 avatar Oct 24 '25 07:10 do2358