Gemini, MakerSuite, API Keys, and “The caller does not have permission”

Allen Firstenberg
6 min readJan 5, 2024

On the Google Developer Community #gemini-api Discord channel, there have been a rise in the number of problems of people generating keys. Folks would say something like:

“I’m using MakerSuite with Gemini and I deleted an API Key. I went to create a new one, but I’m getting an error saying the caller does not have permission. What does that mean and how can I get a key?”

It took a few days to figure out what was going on, but we think we have a good solution. Let’s take a look at what is going on, why, and what you can do about it.

API Keys and What Is Causing This

API Keys are a basic authorization system that lets Google authorize developers to access the Generative AI platform API, including API access to the Gemini model. Getting a key should be fairly easy — you select “Get API Key” at the Google AI Studio website and can then copy the key. You can then use this key in your code when you try to access the API.

Google uses this key to get a good idea how many different projects are accessing Gemini and makes sure it isn’t being abused. Abuse prevention is important because the free tier for Gemini is limited to 60 queries per minute. It also leads to the problem people are now encountering.

--

--