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_KEY or GOOGLE_API_KEY; if both are set, GOOGLE_API_KEY wins. An old key in GOOGLE_API_KEY can easily override the new one in GEMINI_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:

bash
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-flash and gemini-3.7-flash are 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_tokens is too small there may be no room left for the answer itself: raise the limit and look at usage.
  • Safety block. The response may carry a block reason (for example BlockedReason.OTHER or RECITATION). 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_p and top_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

SymptomLikely causeWhat to do
AI Studio unavailable, key cannot be createdregion or agecheck the region list, use a gateway
401 / "API key not valid"typo, whitespace, revoked keyissue a new key
"reported as leaked"key was found in a public placenew key, keep it in environment variables
429RPM, TPM, RPD or key limitlower the rate, retry with a pause
402balance is emptytop up
403 model_not_allowed_for_keythe key is not allowed this modeladd the model to the key's list
404 model_not_foundwrong namecheck against GET /v1/models
503overload or model_disabledretry 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.

Get API keyDocumentation

api.zukko.pro · fetch_*

Gemini API not working: causes and fixes · Zukko