Gemini 3 Flash Not Working? Fix API Errors
Fix Gemini 3 Flash 404, 400, 429, 403, and 503 API errors by switching to the v1beta endpoint, removing deprecated parameters, and fixing proxy tool-calling bugs.

Summary
- Switch your endpoint from /v1 to /v1beta and use exact model IDs like gemini-3-flash-preview or gemini-3.8-flash to fix 404 errors.
- Remove candidate_count, temperature, and thinking_budget; configure reasoning with thinking_level set to low, medium, or high.
- Fix coding CLI and proxy failures by stripping reasoningEffort, aliasing the model name so clients don't force native v1 paths.
- Handle 429 and 503 errors at the Google Cloud project level rather than rotating keys from the same project.
When Gemini 3 Flash fails in an existing codebase, the HTTP status code rarely tells you the whole story. I often see setups where the API key is valid and basic chat prompts work fine, yet the integration breaks the moment you switch model IDs, attach a tool, or route requests through a coding CLI.
Most failures come down to three changes in the Gemini 3 family: the models are not served on the legacy /v1 endpoint, several Gemini 2.x generation parameters are now rejected, and OpenAI-compatible proxies mangle the payload when reasoning or tool-calling flags are present.
| Error / Symptom | Most Likely Cause | Direct Fix |
|---|---|---|
404 NOT_FOUND (not found for API version v1) |
Client or proxy is hardcoded to /v1/models or using a short alias like gemini-3-flash |
Point the base URL to /v1beta/models and pass gemini-3-flash-preview or gemini-3.8-flash |
400 INVALID_ARGUMENT on generation config |
Request includes candidate_count, thinking_budget, or thinking_level: "minimal" |
Remove candidate_count and sampling controls; use thinking_level ("low", "medium", or "high") |
400 Invalid param: Please use a valid role: user, model |
Client sees reasoningEffort and routes to /v1/responses with role: "assistant" |
Move Gemini into a separate provider profile without reasoningEffort |
| Chat works, but reading files or calling tools fails / returns empty | Malformed FunctionResponse or google_search grounding hitting a separate quota |
Include both call_id and name in FunctionResponse; test without google_search |
403 PERMISSION_DENIED (even when models.list works) |
Leaked key block, unpaid balance, or project ineligible for the free tier | Check project status in Google AI Studio; link a Cloud Billing account if restricted |
429 RESOURCE_EXHAUSTED after rotating API keys |
Quota is enforced per Google Cloud project, not per key | Stop rotating keys in the same project; pace RPM/TPM or wait for the midnight PT reset |
503 UNAVAILABLE (No capacity available) |
Shared preview pool is saturated during peak hours | Use exponential backoff and migrate from gemini-3-flash-preview to gemini-3.8-flash |
On this page
1. Fix 404 Not Found: Switch from v1 to v1beta and Check the Model ID
If your logs show "models/gemini-3-flash-preview is not found for API version v1, or is not supported for generateContent", your code is fine, but your URL is pointing at the wrong API version.
Unlike the older 2.x lineup, Gemini 3 models are not deployed under https://generativelanguage.googleapis.com/v1/models. Every direct REST call has to hit v1beta (https://generativelanguage.googleapis.com/v1beta/models) or go through the Interactions API in Google's current google-genai SDK.
You also need to pass the exact model identifier documented in the Gemini API models catalog. Passing 3-flash or gemini-3-flash directly to Google's endpoint will 404—or worse, work on a proxy for plain text and then throw a 404 as soon as you attach tools: [{"google_search": {}}]. Use gemini-3-flash-preview if you are pinned to the early preview, or move to gemini-3.8-flash, which is the current release with a 1M token context window and a 64k max output token limit.
Before debugging your application framework, run a minimal call with the official Python SDK to confirm your key and model ID work:
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Reply with OK if you can read this.",
generation_config={
"thinking_level": "medium"
}
)
print(interaction.output_text)
If you see "Requested entity was not found" on one Google account while the exact same command succeeds on another, the failing account's underlying Google Cloud project does not have access to that preview model. Switching API keys inside that project will not fix it; you have to switch to an eligible project.
2. Fix 400 Invalid Argument: Remove Deprecated Parameters
A payload that ran cleanly on Gemini 2.5 Flash will often fail with 400 INVALID_ARGUMENT or FAILED_PRECONDITION on Gemini 3 Flash. Google tightened parameter validation across the 3.x series, especially with the recent Gemini API changes.
Start by stripping out legacy generation settings that the model no longer accepts. candidate_count is completely unsupported on Gemini 3 and Gemini 4 models and will immediately reject the request. You should also remove explicit sampling controls like temperature, top_p, and top_k. They are ignored on Gemini 3.6+ and deprecated altogether in the Gemini 3.8 migration. Watch out for wrapper libraries like langchain-google-genai, which often inject temperature=1.0 by default even if you leave it out of your own code.
Next, check how you configure reasoning. Gemini 3.x models have thinking enabled by default, which is also why you might notice higher latency or token usage compared to older non-thinking models. On gemini-3.8-flash, the older thinking_budget parameter is deprecated in favor of thinking_level. Valid values are "low", "medium" (the default), and "high". Do not pass "minimal"—gemini-3.8-flash does not support the minimal tier and will return a 400 error. Details on how these tiers behave are in the official thinking guide.
Finally, if you manage multi-turn conversations manually, remove any prefilled model turns from the end of your message array. Multi-turn state on the newer endpoints relies on passing the server-side previous_interaction_id instead of prefilling the assistant's response.
3. Why It Breaks in Coding CLIs, Proxies, and Tool Calls
A huge share of "Gemini 3 Flash not working" issues happen inside third-party clients—like Claude Code, OpenCode, or Cherry Studio—connected through an OpenAI-compatible gateway such as New API or CLIProxyAPI. Typically, simple Q&A works, but the model fails as soon as the agent tries to read a local file, execute a tool, or use reasoning.
Three separate translation bugs cause this:
The client hijacks the URL path when it sees "gemini" in the model name. Some coding clients inspect the model string, detect the word gemini, and automatically switch from standard /v1/chat/completions to Google's native /v1/models/gemini-3-flash-preview:streamGenerateContent?alt=sse path. Because it targets /v1/ instead of /v1beta/ (or hits an upstream router that only expects /v1/chat/completions), the proxy returns a 404. If your gateway supports model aliasing, map gemini-3-flash-preview or gemini-3.8-flash to an alias that does not contain the word gemini (for example, g3-flash). That forces the client to stay on standard OpenAI chat completions.
reasoningEffort triggers a role mismatch (Please use a valid role: user, model). If you add Gemini 3 Flash under an existing OpenAI provider profile that includes reasoningEffort, the client may route the request to /v1/responses using role: "assistant". Gemini's native API only accepts user and model roles. If your upstream proxy does not rewrite the role on the fly, the request fails with a 400 error. Put Gemini in a separate provider configuration with reasoningEffort removed.
Tool calls and grounding fail validation. If the model chats normally but throws an invalid parameter error or returns an empty response when reading files or calling functions, check how your proxy translates tool outputs. Under the generateContent API, every FunctionResponse object must include both call_id and name, and inline instructions must be separated with \n\n to avoid a Malformed_Function_Call error. Similarly, if you inject tools: [{"google_search": {}}] in a proxy override and suddenly get a 429 error, the model isn't broken—Google Search grounding draws from a much stricter rate-limit bucket than standard text generation.
4. Fix 429 Rate Limits and 503 Capacity Errors
When you hit 429 RESOURCE_EXHAUSTED, the worst thing you can do is generate a new API key in the same project and retry in a tight loop.
Gemini API rate limits—Requests Per Minute (RPM), Input Tokens Per Minute (TPM), and Requests Per Day (RPD)—are enforced at the Google Cloud Project level, not per API key. Five keys inside the same project share the exact same quota pool. You can see how these buckets work in my breakdown of the Gemini API key free limit or check your live usage in Google AI Studio.
Before retrying a 429, read the error message to see which window you hit. If you exceeded RPM or TPM, pace your workers and use exponential backoff with random jitter. If you exhausted your daily RPD limit, retrying is pointless until the quota resets at midnight Pacific Time (America/Los_Angeles), or until you upgrade your tier. Keep in mind that while failed 400 and 500 requests are not billed for tokens, they still count against your quota, and client-side timeouts do not guarantee that the server did zero work. If you are moving to a paid tier to lift your rate limits, check the current Gemini API pricing—gemini-3.8-flash is priced at $0.75 per 1M input tokens and $3.75 per 1M output tokens through December 31, 2026, before moving to $1.50 and $7.50 on January 1, 2027.
If you are getting 503 UNAVAILABLE with "No capacity available for model gemini-3-flash-preview", you are hitting shared server congestion on the preview cluster. The official google-genai Python SDK automatically retries 429 and 5xx errors up to four times with exponential backoff (starting at 1 second and capping at 60 seconds). If a preview endpoint stays congested for hours, switch your model string from gemini-3-flash-preview to the production gemini-3.8-flash or gemini-3.6-flash pool.
"No capacity available for model gemini-3.8-flash-high on the server"
The official model ID is gemini-3.8-flash, and Google's Gemini 3.8 Flash page on Vertex AI lists no -high variant. Reasoning depth is set with the thinking_level parameter, which takes LOW, MEDIUM (the default) or HIGH. A -high suffix looks like a label added by a client or gateway to pick a thinking level; that is unconfirmed, and no Google page we read mentions it.
What to check, in this order:
- Send the plain model ID
gemini-3.8-flashand setthinking_leveltoHIGHinstead of putting the level in the model name (Google AI Studio model page). - Retry later if the same request with the plain ID also returns a capacity error.
- Switch to a provider or gateway that serves the model if your current one does not. SeedRouter, the gateway we run, lists
gemini-3.8-flashin its price table. - Do not send
MINIMAL; Google says this model rejects it with a validation error (Developer's guide to Gemini 3.8 Flash).
5. Fix 403 Permission Denied (Even When Listing Models Works)
A common trap when debugging 403 PERMISSION_DENIED is testing your key with a models.list call, seeing a 200 OK response, and assuming your account is healthy. As noted in the official Gemini troubleshooting guide, listing models does not verify your project's billing state or free-tier eligibility.
When generateContent returns a 403, inspect the exact error string and open your project dashboard in AI Studio:
If the message says "Your API key was reported as leaked. Please use another API key", Google's automated scanners found your key in a public repository or client bundle and blocked it permanently. You have to generate a replacement key and lock down its restrictions. Also note that Google now rejects unrestricted standard Cloud keys on newer setups, so keep the Gemini API restriction enabled on your credential.
If your project status in AI Studio shows Free tier unavailable, Payment needed, or Restricted, rotating keys in that project will never work. Not every Google Cloud project or region qualifies for the free tier. To unblock the project, link an active Cloud Billing account (which moves the project to paid Tier 1 billing) or settle any past-due balance in the Google Cloud Console.
If you run agents that cannot afford downtime when a preview model runs out of capacity or a single project hits a rate limit, routing your requests through an aggregator like SeedRouter lets you keep a single API format while falling back across stable model endpoints automatically.