request
curl https://api.openai.com/v1/chat/completions \
-X POST \
-H "Content-Type: application/json" \
--proxy-pass "127.0.0.1:7890" "https://api.openai.com" \
-H "Authorization: Bearer {your key}" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'
response
$ curl https://api.openai.com/v1/chat/completions \
> -X POST \
> -H "Content-Type: application/json" \
> --proxy-pass "127.0.0.1:7890" "https://api.openai.com" \
> -H "Authorization: Bearer {your key}" \
> -d '{
> "model": "gpt-3.5-turbo",
> "messages": [{"role": "user", "content": "Say this is a test!"}],
> "temperature": 0.7
> }'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:21 --:--:-- 0
curl: (28) Failed to connect to api.openai.com port 443 after 21051 ms: Timed out
curl: (3) URL using bad/illegal format or missing URL
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:21 --:--:-- 0
curl: (28) Failed to connect to api.openai.com port 443 after 21041 ms: Timed out
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
我本地在使用 clash for windows ,链接的是新加坡节点。
请问我应该如何做,才能够在本地可以正常的请求呢。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.