Gemini API not working: region, key, limits and model name
Step-by-step Gemini API diagnostics: from checking status and region to a leaked key, 429 and 503 errors and a typo in the model name.
6 min · · errors · API keys
When the Gemini API is not working, the cause almost always falls into five buckets: the service is unavailable in your region, the key is blocked or set up wrong, a limit is exhausted, Google's service is temporarily overloaded, or the request has a wrong model name. Below is a checklist ordered from cheap checks to expensive ones, and an error table, so you can see in ten minutes what exactly broke.
We rely on Google's documentation (the Troubleshooting, Rate limits, Available regions and API key pages) and the Zukko gateway error codes. State as of October 18, 2026.
Step 1. Check the service status
If requests that worked an hour ago suddenly fail, check the service status first: Google AI Studio has a status page at aistudio.google.com/status (that is what people look for as "gemini api status"). If there is an incident, your code is not at fault and all you can do is wait and retry.
For requests through the gateway, the model provider's state shows up as a 503 error: in Zukko's documentation it means the provider is unavailable or the model is switched off (model_disabled).
Step 2. Region and access to the service
The most common reason behind "Gemini does not work in Russia": the Gemini API and Google AI Studio are not available everywhere. Russia is not among the supported countries on the Available regions page (as of its April 28, 2026 update). On top of region, Google requires age 18+ and age verification on the account.
Typical signs: AI Studio does not open or says the service is unavailable in your country, a key cannot be created, direct requests are refused by region. Client settings cannot fix this, and we do not recommend workaround schemes. A working alternative from Russia is access through a gateway, with payment by SBP, MasterCard or crypto. Gemini 3.8 Flash and 3.7 Flash are called there in the OpenAI format, see Gemini in Russia via API.
Step 3. Key: wrong, leaked or restricted
According to Google's documentation, keys have several quirks that cause "I have a key but it does not work":
- Leaked keys are blocked. If Google finds your key in public (in a public repository, for example) it stops working, and the response contains a message like "Your API key was reported as leaked. Please use another API key." The only fix is to issue a new key and stop keeping it in code.
- Unrestricted standard keys are rejected. The Gemini API rejects requests from unrestricted standard keys, while keys with explicit restrictions keep working. New keys created in AI Studio after May 28, 2026 are authorization keys by default, bound to a service account.
- Environment variable. Google's client libraries read
GEMINI_API_KEYorGOOGLE_API_KEY; if both are set,GOOGLE_API_KEYwins. An old key inGOOGLE_API_KEYcan easily override the new one inGEMINI_API_KEY.
A gateway key is simpler: it starts with fetch_, is shown once when created, and a 401 response means a typo, whitespace around the key, or a revoked key. Details on headers and formats are in the authentication section.
Step 4. Limits: 429
A 429 RESOURCE_EXHAUSTED error at Google means you exceeded the limit on requests per minute (RPM), input tokens per minute (TPM) or requests per day (RPD). Details from the documentation:
- limits are counted per project, not per key;
- RPD resets at midnight Pacific time;
- limits are lower on the free tier and stricter for preview models;
- paid tiers add spend-based limits over a rolling 10-minute window (Tier 1, for example, $10 per window), and exceeding them also returns 429.
What to do: lower the rate, shrink context and output tokens, spread peaks out over time, retry with exponential backoff and random jitter, and if you keep hitting the ceiling, move to a paid tier or a gateway.
In Zukko a 429 has two sources: your own key's daily or monthly limit is exhausted (key_daily_limit_reached, key_monthly_limit_reached), or the model provider applies a restriction. Zukko has no global rate limit, so on a 429 first open the key settings and check whether you hit your own dollar limit. More in key limits and cache.
Step 5. The 503 error and overload
A 503 UNAVAILABLE is a temporary problem on the service side. Google's documentation advises retrying with exponential backoff (for example 1, 2, 4 and 8 seconds), adding random jitter, capping the number of attempts and not retrying client errors (400, 402, 403), because they point to a wrong key, depleted prepayment or bad syntax. Google's official SDKs retry automatically.
A minimal implementation for the OpenAI SDK:
import random
import time
from openai import OpenAI, APIStatusError
client = OpenAI(base_url="https://api.zukko.pro/v1", api_key="fetch_your_key")
def ask(prompt, retries=4):
for attempt in range(retries):
try:
r = client.chat.completions.create(
model="gemini-3.8-flash",
messages=[{"role": "user", "content": prompt}],
)
return r.choices[0].message.content
except APIStatusError as e:
if e.status_code in (429, 503) and attempt < retries - 1:
time.sleep(2 ** attempt + random.random())
continue
raise
print(ask("Answer in one word: test"))If instead of temporary overload you get a 503 with the code model_disabled, retries will not help: the model is switched off and the request must be redirected to another model from GET /v1/models. The same goes for 429 key_daily_limit_reached or key_monthly_limit_reached: that is your key's own limit, so wait for it to reset or raise it in the dashboard. A detailed breakdown is in error 503 model_disabled.
Step 6. Wrong model name
A typo in the model name gives a 404. In the Zukko gateway it is model_not_found: there is no model with that name in the catalog. Common causes:
- prefixes and suffixes that are not in the catalog (
models/gemini-3.8-flash,gemini-3.8-flash-latest, a date at the end); - a name from Google's documentation that the gateway does not offer:
gemini-3.8-flashandgemini-3.7-flashare available there; - the old name of a retired model.
The list of current names is always available from GET https://api.zukko.pro/v1/models. At Google the equivalent is the models page in the documentation. Also check the API version: at Google some features are only available in /v1beta, not /v1.
Other causes of "strange" responses
- Empty or truncated answer. If the model reasons before answering, those tokens can use up the output token limit. If
max_tokensis too small there may be no room left for the answer itself: raise the limit and look atusage. - Safety block. The response may carry a block reason (for example
BlockedReason.OTHERorRECITATION). Rephrase the request and check safety settings. - Parameters have no effect. Google's troubleshooting page says that newer models (Gemini 3.6 and later) ignore custom
temperature,top_pandtop_k. If you tune "creativity" with those knobs, nothing will change. - Repetition in the output. Google's advice: add "Be concise" or "Don't repeat yourself" to the prompt, and raise temperature where it applies.
Summary table
| Symptom | Likely cause | What to do |
|---|---|---|
| AI Studio unavailable, key cannot be created | region or age | check the region list, use a gateway |
| 401 / "API key not valid" | typo, whitespace, revoked key | issue a new key |
| "reported as leaked" | key was found in a public place | new key, keep it in environment variables |
| 429 | RPM, TPM, RPD or key limit | lower the rate, retry with a pause |
| 402 | balance is empty | top up |
403 model_not_allowed_for_key | the key is not allowed this model | add the model to the key's list |
404 model_not_found | wrong name | check against GET /v1/models |
| 503 | overload or model_disabled | retry or switch model |
FAQ
Why does Gemini not work in Russia?
The Gemini API and Google AI Studio are available in a limited set of countries, and Russia is not in the official region list. From Russia it is more practical to use a gateway: payment by SBP, MasterCard or crypto.
Where can I see the Gemini API status?
On the Google AI Studio status page (aistudio.google.com/status).
The key is created but requests are rejected. Why?
Check whether it was blocked as leaked, whether it is an unrestricted "standard" key, and whether another variable is set in the environment (GOOGLE_API_KEY takes priority over GEMINI_API_KEY). If nothing helps, issue a new key.
A 429 keeps repeating. How do I live with it?
Lower the request rate and context size and add retries with a growing pause. If you are on the gateway, check the daily and monthly limit of the key itself: a 429 often comes from it.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- OpenAI API Keys in the Open: Why You Should Not Use ThemWhere free keys on GitHub come from, why using them is dangerous for you and for the owner, and how to protect your own key from the same leak.
- GLM API Errors: Why the Request Fails and How to Fix ItA wrong model id, an overflowing 128K context, the key, the balance, limits: the typical causes of GLM API errors and a quick way to find yours.
- This organization has been disabled in the Claude API: What to DoAn Anthropic key suddenly answers "organization has been disabled". What the error is, what to check, and how to move the SDK and Claude Code to another provider.
- The API key header: Authorization Bearer or x-api-key and where each goesOpenAI clients send the key in Authorization, Anthropic clients in x-api-key. What the gateway accepts and how to tell from the response where the key got lost.