Pass these to the next model: an empty answer, a 503, the 404 of a retired model, and one specific Groq 400. Stop only on errors that no other model can fix. The usual rule, "retry 429 and 5xx, give up on everything else", gets three of those four wrong, and every wrong call ends the same way: a dead chain with a healthy model still waiting.

We found this by running our own jobs, then wrote it down as a checklist for reviewing code. Below are the situations, then a test of how well a model finds them in pasted code.

Method

The facts come from two places. The first is calls we made ourselves to the live Gemini and Groq services during the autumn of 2026, each with its date in our notes. The second is the vendor documentation, fetched and searched on the day of publication, so every documented claim below is as of that day.

For the test we wrote 31 short programs, 26 with one planted fault and 5 without, in TypeScript and Python; they talk to Gemini by plain HTTP or Google's library, and to Groq through an OpenAI-style client. Sonnet and Haiku each reviewed every sample once, with and without a review skill. We scored by hand and by code, and re-ran the samples where our own input was flawed.

Results

Situations where the obvious rule is wrong

An empty 200 is not an answer. With thinking switched on and a small output limit, a Gemini call returned a 200, finish reason STOP and no text at all: the thinking had eaten the whole limit. Code that saves the empty string as a result has stopped for good. The next model, or the same one with room, would have answered.

A 503 can last two days. One alias replied with an overload message to every request across two days. Models with fixed names answered normally during those same hours, using the same key. A job that merely put the work back in the queue for that alias published nothing for the whole stretch.

A retired model's 404 goes on. The error page for Gemini points to a different model for exactly this case (API errors). Our chain treated only 429 and 5xx as "next model", so on 11 October it stopped at a retired name and the alias placed last never ran. A listing that names a model does not prove it answers either: we saw listed names return 404.

Groq's schema 400 is not your mistake. In its default best-effort mode Groq may reject its own generated JSON with a 400, and the docs list retrying among the remedies (structured outputs). On 22 September a prompt that had worked hours earlier failed this way while all three Gemini models were overloaded. Classifying that 400 as ours left no model at all. Any other 400 is different: the vendor says not to retry it, so walking it through every model only multiplies the failure.

A stop ends one provider, not all of them. A 403 from Gemini is final for Gemini. Groq is still waiting behind it.

The SDK already retries. Google's Python library already tries a 429 or a 5xx again, up to four times, without being asked (Gemini troubleshooting). Wrap your own loop around it and the attempts multiply instead of adding safety.

Thinking you pay for and cannot always switch off

Thinking tokens are billed as output (pricing). On 10 September a prompt that only asked the model to say hello, with no thinking setting, used 100 thinking tokens, 106 in total. With a zero thinking budget the total was 20, about five times less. On 21 September we ran the same zero-budget request three times per model: pinned models gave 0, 0, 0 thinking tokens, while the -latest alias gave 0, 62, 65. It ignored the budget in two of three identical runs.

3.8 Flash, the newest Flash model, has no "minimal" level in the documented table (low, medium and high only), and asking for it on the alias returned a 400 (thinking guide). Output limits count thinking tokens, so the safer cost control is a lower level, not a small limit. Both 3.8 and 3.6 Flash prices double on 1 January 2027, per the pricing page, so this cost is not static.

Two smaller facts: Gemini limits are counted per project, so four keys of one project share one quota (rate limits); and an alias ending in -latest is replaced by each new release, so record the model name that the response itself reports. Even a fixed name moved: on 10 October the 3.5 Flash name started to be served by 3.6 Flash, with no error at all; an email from AI Studio was the only notice.

What a model finds in pasted code

With the review skill, Sonnet was right on all 31 samples, against 27 without it. Haiku went from 23 to 30. The skill is llm-api-fallback-review; the programs and the scoring are ours, and the changelog describes the scoring.

Bare Sonnet already caught empty answers saved as results, a retired model's 404 that ended the chain, and a Gemini stop that kept Groq from running. It slipped in four places. It recommended handing a plain 400 to the next model, though the vendor says that error is not worth repeating. It was unaware that the library repeats calls itself. It believed the models listing proves a name works. And it called two closed lists acceptable when both contain the word "other". On that last point, a weak model in an earlier job put a topic value into the category field; three added lines in the prompt fixed it for roughly 40 tokens.

Without the skill, Haiku missed those four and three more: the Groq schema 400, a missing thinking setting and a level the model refuses. With it, Haiku wrongly flagged one sound sample, a strict-mode Groq client, and added small extra findings in eleven answers.

What we did not measure

  • The programs are ours. We wrote all 31 and the way they are marked, so they show only what we thought of. Real code has faults we did not plant.
  • One run per model and case. Another run could shift a single result.
  • Facts have dates. Names, aliases, levels and prices are as of 16 October 2026, and will change; if a vendor page disagrees with us, believe the page.
  • The cost of thinking was measured on a one-word prompt. A long prompt may behave differently, and an alias can pick a different model tomorrow.
  • The live API, not the code. We did not run the reviewed samples against a live endpoint; the review reads code only.

Read this post as Markdown: /blog/gemini-fallback-empty-response.md · Atom feed.