EvanZhouDev / gemini-ai

The simpler JavaScript Gemini SDK
https://www.npmjs.com/package/gemini-ai
GNU General Public License v3.0
95 stars 16 forks source link

[ERROR] Gemini AI Requires Billing Account Linked in Free Package? #16

Closed XCraftTM closed 3 weeks ago

XCraftTM commented 3 weeks ago

I have installed Gemini AI Package in my Node.JS(v20) Project with Discord.JS(v14) and when running a prompt through it it returns this error:

Error: There was an error when querying Gemini.
{
  "error": {
    "code": 400,
    "message": "User location is not supported for the API use without a billing account linked.",
    "status": "FAILED_PRECONDITION"
  }
}

    at _Gemini.query (file:///CENSORED/TutorialBot/node_modules/gemini-ai/dist/index.mjs:322:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _Gemini.ask (file:///CENSORED/TutorialBot/node_modules/gemini-ai/dist/index.mjs:453:22)
    at async CENSORED\TutorialBot\blocks\gemini_ai.js:96:34
XCraftTM commented 3 weeks ago

Okay i just found out that Countries in the EU can't access the API for free and have to pay for it, which i find pretty stupid but fine...

A list of all Countries which have to pay for it can be found here: https://ai.google.dev/gemini-api/docs/available-regions?hl=de#unpaid-tier-unavailable

Currently there is no other way to use it in my case...

EvanZhouDev commented 3 weeks ago

Yes, that is the issue, sorry for the delayed response. You can choose to use a proxy, which is supported through Undici. You can find it in the docs.

XCraftTM commented 3 weeks ago

Where can i find a Proxy for that?