PublicAffairs / openai-gemini

Gemini ➜ OpenAI API proxy. Serverless!
https://my-openai-gemini-demo.vercel.app/
MIT License
307 stars 183 forks source link

Error: [400 FAILED_PRECONDITION] User location is not supported for the API use.# #4

Closed joostshao closed 5 months ago

joostshao commented 5 months ago

curl https://workers-playground-little-paper-80b2.sjtlqy.workers.dev/v1/chat/completions \ -H "Authorization: Bearer AIzaSyAJaC2_HRoQlWYanWPm2S-xxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Hello"}], "temperature": 0.7 }'

Error: [400 FAILED_PRECONDITION] User location is not supported for the API use.#

之前还是好的,奇怪了,这是怎么回事?

johnd0e commented 5 months ago

Cloudflare Workers tends to be as closer to user as possible. So perhaps you are located not in "Available regions" of Gemini.

Solution: deploy on Vercel.

joostshao commented 5 months ago

thank you