google-gemini/cookbook

Clarity on attaching billing account to make it work, as payment instrucment is visible in https://console.cloud.google.com/billing...

gwpl opened this issue · 8 comments

gwpl commented

Description of the bug:

I've tried making simple Gemini calls either from here or generated with https://aistudio.google.com/ generated API Key using it , and in both cases I got:

400 User location is not supported for the API use without a billing account linked.

(Funny thing, that https://gemini.google.com/ could not help.)

So, I could not find way to link billing account.

What I see is that I have attached payment instrument to payment methods under:
https://console.cloud.google.com/billing

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

gwpl commented

Investigating:

maybe also some billings have to be enabled like:

metrics and should be listed in instructions? Or link to some document that will help people to set everything up, who are not used with Google AI offering?

@gwpl, Thank you reporting this issue.
This repository is for issues related to collection of guides and examples for the Gemini API like bugs or improvements. For issues related to Gemini, we would suggest you to use "Send Feedback" option in Gemini docs. Ref: Screenshot below.

image

gwpl commented

Thank you!

Still as it is returned error code that (at this second) is no where documented:

https://www.google.com/search?q=400+%22User+location+is+not+supported+for+the+API+use+without+a+billing+account+linked%22

it may be room for improvement, either for torubleshooting FAQ, setup README or other way (or just library/server to return error code with URL providing description how to resolve).

Again, I have attached billing cards so I don't know why it's complaining. This makes me not trying this solutions and falling back to other AI providers that work smoothly.

gwpl commented

I've found it! There are multiple Google Billing and Cloud AI dashboards in different places with super long tutorials attached, so given terrible UX experience I provide bullet point summary generated with help if other non-google LLM that maybe helpful for other readers:

Sure, here's a step-by-step guide on how to link a billing account for generating AI API at Google:

  1. Check Payment Method:

    • Go to the Google Cloud Console.
    • Navigate to the Payment Methods section (upper right corner, vertical ellipsis "⋮").
    • Ensure that you have a valid payment method (e.g., a credit card) linked to your account.
  2. **Verify Payment Settings and Budgets&Alerts **:

    • In the Payment Settings, confirm that all information is correct and up-to-date.
    • You may also like to setup limit on Budgets&Alerts.
  3. Access Billing Account:

    • At the top of the Google Cloud Console, click on the Billing account option.
    • Open the drop-down menu.
  4. Manage Billing Account:

    • Instead of selecting your billing account, click on Manage Billing Account.
  5. Default Tab - My Billing Account:

    • In the Manage Billing Account section, you will see the My Billing Account tab by default.
    • Confirm that your billing account is listed and properly set up.
  6. Navigate to Projects Tab:

  7. Select the Relevant Project:

    • Find the project named Generative Language Client (or your specific project for which you generated the API key).
    • Click on the vertical ellipsis () under the Actions column for this project.
  8. Change Billing:

    • In the drop-down menu that appears, select Change billing.
    • Choose your billing account from the available options.
  9. Confirm Selection:

    • Ensure that the selected billing account is now associated with your project.
  10. Make a Request:

  • With the billing account linked to your project, you can now proceed to make API requests.

By following these steps, you should be able to link your billing account properly and ensure that your project can generate AI API requests.

gwpl commented

TODO: Make similar instructions easier to discover, addressing discover-ability issue by better documentation and error messages/codes (ideally linking to robust troubleshooting steps).

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks!