claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Bug Report: API Error: 403 {"error":{"type":"forbidden","message":"Reque...

Open jianglonghui opened this issue 9 months ago • 7 comments

Bug Description API Error: 403 {"error":{"type":"forbidden","message":"Request not

Environment Info

  • Platform: macos
  • Terminal: iTerm.app
  • Version: 0.2.37
  • Feedback ID:

Errors

[{"error":"Error: 403 {\"error\":{\"type\":\"forbidden\",\"message\":\"Request not allowed\"}}\n    

jianglonghui avatar Mar 12 '25 09:03 jianglonghui

Can you try running /login again, and report back if you're still hitting this error?

bcherny avatar Mar 12 '25 17:03 bcherny

i am also getting this after logging in again.

dorekhov1 avatar Mar 13 '25 12:03 dorekhov1

I solved it and it was because of the proxy. If you are in China, turn on your VPN and:

HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 claude

I assume that your VPN is using the port 7890.

makecent avatar Mar 19 '25 01:03 makecent

I have the same problem

alin-ap avatar Mar 22 '25 19:03 alin-ap

I have the same problem:

PermissionDeniedError: Error code: 403 - {'error': {'type': 'forbidden', 'message': 'Request not allowed'}}

BUT,I have API key already

EricZhuXYZ avatar Mar 25 '25 16:03 EricZhuXYZ

I have the same problem

wcvb13 avatar Mar 28 '25 07:03 wcvb13

HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 claude

cool , solved

sheldon123z avatar May 29 '25 14:05 sheldon123z

it is still not working in china.

╭──────────────────────────╮ │ ✻ Welcome to Claude Code │ ╰──────────────────────────╯

Unable to connect to Anthropic services

Failed to connect to api.anthropic.com: ERR_BAD_REQUEST

Please check your internet connection and network settings.

Note: Claude Code might not be available in your country. Check supported countries at https://anthropic.com/supported-countries

use the http_proxy

henryfeng avatar Jul 15 '25 11:07 henryfeng

Hi folks, just want to reiterate our list of supported countries at https://anthropic.com/supported-countries

ant-kurt avatar Aug 22 '25 18:08 ant-kurt

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.

github-actions[bot] avatar Aug 31 '25 14:08 github-actions[bot]