zed
zed copied to clipboard
Agent Panel: Cannot access zed hosted models (via Cloudflare HKG)
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
What is the country you're located at?
I am having the same issue in the UK.
What is the country you're located at?
I'm in VN
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.
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.
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
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.
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.
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)
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?
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.
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: I'm in Vietnam...
curl -s -4 --location --request GET 'https://www.cloudflare.com/cdn-cgi/trace' |grep locgives 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
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?
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?
Here too from South Korea 👋
Same issue from Japan.
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)"
Why block Chinese IPs? Technology has no politics. unfortunate
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.
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.
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.
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?
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.
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
Same issue in Kazakhstan.
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
I’m having the same issue, I can use Claude Code normally from Vietnam, but Claude Sonnet doesn’t work in Zed.
Same issue in Vietnam with GPT-5 and Claude Sonnet
Same issue in Vietnam with Optus 4.1 thinking.