Why does Google Gemini API return permission errors after OAuth update

0 votes
May 11 in Generative AI by gaurav
• 24,860 points
176 views

1 answer to this question.

0 votes
Ok so the most common thing could be , your AUTH may be outdated . After Google OAuth updates , the gemini API got more stricter about which scopes you request If you were using a broad scope like https://www.googleapis.com/auth/cloud-platform before, you might now need to be more explicit:
SCOPES = [

    "https://www.googleapis.com/auth/generative-language",        # for Gemini API

    "https://www.googleapis.com/auth/generative-language.tuning"  # if you're fine-tuning

]

And if you’re using REST API directly then :
import google.auth

from google.oauth2 import service_account

credentials = service_account.Credentials.from_service_account_file(

    "service_account.json",

    scopes=["https://www.googleapis.com/auth/generative-language"]

)
answered May 12 by anonymous
• 1,420 points

Related Questions In Generative AI

0 votes
0 answers
0 votes
1 answer
0 votes
0 answers

Why does my GAN model fail to converge after 100 epochs?

With the help of proper code explanation ...READ MORE

Jan 22, 2025 in Generative AI by Ashutosh
• 33,370 points
726 views
0 votes
1 answer

Why does my chatbot fail after switching from API key authentication to OAuth login?

When the chatbot works with an API ...READ MORE

answered May 12 in Generative AI by anonymous
• 1,420 points
99 views
0 votes
1 answer

Why does my BeautifulSoup parser fail after an HTML structure update?

Hey this happens because BeautifulSoup usually fails ...READ MORE

answered May 20 in Generative AI by subhashini
• 1,420 points
146 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP