Gemini API "Logprobs is not enabled for this model": which models still support it and the fix

Last verified: November 30, 2026
Developers who ask Gemini for token probabilities have been getting a flat refusal since November 20, 2026. A request that asks a Gemini 4 model for log probabilities (the per-token likelihood scores often called logprobs) now comes back as an HTTP 400 error, even though the same key and the same code returned log probabilities a day earlier. Nothing is wrong with the request or the account. Google has switched logprobs off for its newer models, and a Google staff member confirmed on the official developer forum that this is working as intended: log probabilities are not supported on Gemini 3.x and Gemini 4 models.
The fix depends on why you were asking for logprobs in the first place. If the parameter is only there because a library or an old template sends it, removing it (or letting your client drop it) brings the 200 responses back immediately. If your application depends on token probabilities for classification confidence, ranking or evaluation, you need a model that still returns them, and in tests run on November 18-20 the only ones found to do so were the Gemini 2.5 models called through Vertex AI. The change affects every Gemini 4 model (Hydrogen, Argon, Carbon and Neon) and Gemini 3.x on both the Gemini API and Vertex AI, and Google has not published a changelog entry or documentation note about it.
··········
THE GEMINI API LOGPROBS ERROR AND WHERE IT APPEARS.
The message differs slightly depending on which Google endpoint you call, which matters if you search your logs for it. On the Gemini API (keys from Google AI Studio) the body reads "Logprobs is not enabled for this model". On Vertex AI, which Google now runs as part of the Gemini Enterprise Agent Platform, the same request returns "Logprobs is not supported for this model". An earlier wave of the same refusal, in October 2025, named the model inside the text.
........
Endpoint | Exact message | Status |
Gemini API (AI Studio key), Gemini 3.x and 4 | Logprobs is not enabled for this model | 400 INVALID_ARGUMENT |
Vertex AI, Gemini 4 | Logprobs is not supported for this model | 400 |
Gemini API, gemini-2.5-flash (October 2025) | Logprobs is not enabled for models/gemini-2.5-flash | 400 INVALID_ARGUMENT |
OpenAI-compatible endpoint (2025 reports) | Unknown name "logprobs": Cannot find field. | 400 |
........
The full error object from the Gemini API is short and gives no hint of a workaround:
{"error": {"code": 400, "message": "Logprobs is not enabled for this model", "status": "INVALID_ARGUMENT"}}The developer who opened the forum thread on November 20 reported that the refusal began at about 02:00 UTC that day, after the same key had returned logprobs until 18:39 UTC on November 19. He tested all four Gemini 4 models, and also tried Hydrogen and Neon with a thinking budget of zero, and got the same 400 every time. Reasoning settings do not change the outcome.
··········
WHAT GOOGLE DOCUMENTS ABOUT GEMINI LOGPROBS.
The parameters themselves are still in the official Gemini API reference, which is why the error surprises people. The GenerationConfig object lists responseLogprobs as an optional boolean ("If true, export the logprobs results in response") and logprobs as an optional integer that is only valid when responseLogprobs is true. It sets how many top candidates, including the chosen token, come back at each decoding step, and it must be between 0 and 20. On the response side, each candidate can carry avgLogprobs (the average log probability of the candidate) and a logprobsResult object with topCandidates, chosenCandidates and logProbabilitySum.
The reference does not list which models accept these fields. Its only caveat is a general sentence at the top of GenerationConfig: not all parameters are configurable for every model. The Live API setup object goes further and states that responseLogprobs and logprobs are not supported there at all, but that note covers real-time sessions, not ordinary generateContent calls.
The model restriction itself is documented only in the forum. On November 20, a Google staff member answered the thread titled "Logprobs turned off without notice for gemini-4-hydrogen, argon, carbon and neon" with three sentences: thanks for reaching out, this is working as intended, logprobs are not supported on Gemini 3.x and Gemini 4 models. The forum marks the account as Google staff. No date for a return of the feature was given, and the original poster's follow-up question about whether the earlier access had been unintended went unanswered.
··········
WHICH GEMINI MODELS STILL RETURN LOGPROBS.
Two independent sets of tests give a consistent picture for Vertex AI and a less clear one for the Gemini API. The forum poster ran his checks on November 20. The maintainers of LiteLLM, an open-source library that routes requests to many providers, ran a probe script directly against Google's endpoints on November 18 and published the results in a merged pull request.
........
Model family | Gemini API (AI Studio key) | Vertex AI | Source and date |
Gemini 4 Hydrogen, Argon, Carbon, Neon | Refused from Nov 20 | Refused | Forum test Nov 20, LiteLLM probe Nov 18 |
Gemini 3.8 Flash | Refused | Refused | LiteLLM probe Nov 18 |
Gemini 3.x (all) | Not supported | Not supported | Google staff answer Nov 20 |
Gemini 2.5 Flash, 2.5 Flash-Lite, 2.5 Pro | Not callable | Returned logprobs | LiteLLM probe Nov 18, forum test Nov 20 (2.5 Flash) |
........
The LiteLLM probe of November 18 recorded the four Gemini 4 models as still accepting logprobs on the Gemini API, two days before the forum poster saw them refused. Both observations fit the timeline he described, with the switch happening overnight between November 19 and 20, and the Google answer that followed applies to every Gemini 4 model.
Gemini 2.5 is the exception, and only on Vertex AI. On the Gemini API those models were already unavailable for direct calls at the time of the probe, as covered in our page on Gemini 2.5 Flash and 2.5 Pro returning 404 NOT_FOUND. Users in a 2025 forum thread reported the same split: logprobs disappeared from 2.5 Flash on the Gemini API in October 2025 but kept working on Vertex AI with the Vertex flag set in the Google Gen AI SDK. Treat Vertex 2.5 as a temporary bridge, because these are older models with their own retirement schedule.
··········
CAUSES OF THE GEMINI LOGPROBS 400 AND HOW TO FIX EACH ONE.
Almost every occurrence traces back to one of a handful of situations, and the first check is always the model ID in the failing request.
........
Cause | How to check | Fix |
Gemini 4 or 3.x model with responseLogprobs set | Model ID in the request starts with gemini-4 or gemini-3 | Remove responseLogprobs and logprobs, or switch to a model that still returns them |
A library or framework adds the parameter for you | Log the outgoing request body and look for responseLogprobs | Turn the feature off in the library or update it (see the LiteLLM steps below) |
Gemini 2.5 called through the Gemini API | The endpoint is generativelanguage.googleapis.com | Call the same model through Vertex AI if your project has access |
OpenAI-compatible endpoint with logprobs=True | Your code uses the OpenAI SDK pointed at Gemini | Drop logprobs from the call; the field was not accepted there in 2025 reports |
Live API session with logprobs in the setup | Request goes to the real-time BidiGenerateContent setup | Remove the fields; the Live API reference lists them as unsupported |
........
The step-by-step fixes below follow the same order.
1. Find the model. Print the exact model string your code sends. If it begins with gemini-4 or gemini-3, no configuration on your side will make logprobs work today, according to Google's forum answer.
2. Decide whether you need the probabilities. Search your code for responseLogprobs, response_logprobs, logprobs and top_logprobs. If nothing reads avgLogprobs or logprobsResult from the response, delete the parameters and the 400 goes away.
3. If you need them, move that one call to Vertex AI with a Gemini 2.5 model. In the Google Gen AI SDK this means creating the client for Vertex AI with your Google Cloud project and region instead of an AI Studio API key. A forum user reported success on November 11, 2025 with gemini-2.5-pro, response_logprobs=True and logprobs=3 on Vertex AI, and the November 2026 tests still showed 2.5 Flash returning probabilities there.
4. Keep the rest of your traffic on Gemini 4. Only the requests that score or rank output need the older model; generation can stay where it is.
5. Retest after each change and store the model ID and date with the result, because the support matrix has changed twice in thirteen months without an announcement.
For reference, a request body that asks for logprobs looks like this. It is illustrative, built from the documented field names, and it fails on Gemini 3.x and 4:
{
"contents": [{"role": "user", "parts": [{"text": "Is this review positive or negative?"}]}],
"generationConfig": {
"responseLogprobs": true,
"logprobs": 5
}
}··········
GEMINI LOGPROBS ERRORS INSIDE LITELLM AND OTHER LIBRARIES.
Libraries that translate OpenAI-style parameters into Gemini requests are a common hidden source of the error, because the developer never wrote responseLogprobs anywhere. LiteLLM merged a fix on November 19, 2026 (pull request 52700) that marks dozens of Gemini and Vertex AI model entries as not supporting logprobs in its model table. The change works through LiteLLM's existing drop_params option: with drop_params set to true, LiteLLM removes the unsupported logprobs parameter before calling Google, and the response comes back as 200 with logprobs set to null. Without drop_params, Google's 400 still passes through to your code.
An illustrative request body, following the example in the pull request description:
{
"model": "vertex_ai/gemini-3.5-flash",
"messages": [{"role": "user", "content": "hello"}],
"logprobs": true,
"drop_params": true
}A null logprobs field in the response is the expected result here, so any downstream code that divides by or averages those values needs a guard. Other projects have reacted the same way: one open-source library opened a change on November 28 titled "drop logprobs scoring", and a GitHub search for the exact error string turns up more than a dozen issues and pull requests opened since late October. If your stack wraps Gemini, update the wrapper before rewriting your own code. Developers who have already hit the related temperature refusals on reasoning models will recognise the pattern from our page on the "Unsupported parameter: temperature" error across OpenAI, Claude and Gemini.
··········
DOCUMENTED BY GOOGLE VERSUS REPORTED BY DEVELOPERS.
Only part of the picture comes from Google itself, and the difference affects how much weight each fix deserves.
........
Statement | Status |
responseLogprobs and logprobs exist, range 0 to 20, not every parameter works on every model | Official Gemini API reference |
Logprobs are not supported on Gemini 3.x and Gemini 4 | Google staff answer on the official forum, Nov 20, 2026 |
Live API sessions do not support logprobs | Official Gemini API reference |
The switch happened around 02:00 UTC on Nov 20 | Reported by one developer, not confirmed by Google |
Gemini 2.5 models on Vertex AI still return logprobs | Independent tests (forum user, LiteLLM probe), not documented by Google |
The OpenAI-compatible endpoint rejects logprobs | Forum reports from 2025, not re-tested here |
........
Google has not said why the feature was removed or whether it will return, and the official reference has not been updated to show model support.
··········
REPLACING LOGPROBS FOR CONFIDENCE SCORES ON GEMINI 4.
Most teams used logprobs for one of three jobs: a confidence score on a classification label, a way to rank several candidate answers, or a metric in an evaluation suite. None of these has a Google-documented substitute on Gemini 3.x or 4, so each option below is an engineering choice made on your side, and your own documentation should describe it that way.
The most direct option keeps the probability-based scoring on a model that still supports it: generate with Gemini 4, then score the output with a Gemini 2.5 call on Vertex AI. This keeps comparability with historical scores but ties a production feature to an older model. A second option replaces probabilities with agreement: send the same classification prompt several times at a non-zero temperature and use the share of matching answers as the confidence measure, which costs one request per sample. A third asks the model to write a score in a structured output field. That number is generated text with no measured probability behind it, so it should be validated against labelled data before anyone treats it as calibrated.
Whatever you choose, record which method produced each score. Comparing logprob-based confidence from before November 20 with agreement-based confidence after it will produce misleading trends on any dashboard. Rate limits also become relevant if sampling multiplies your request volume; our guide to Gemini API rate limits, tiers and 429 fixes covers the per-tier quotas.
··········
GEMINI API LOGPROBS IN PRACTICE.
The 400 "Logprobs is not enabled for this model" is a deliberate restriction, confirmed by Google staff, on every Gemini 3.x and Gemini 4 model, and no setting, key type or thinking budget lifts it on the Gemini API or on Vertex AI. When the parameter is incidental, removing it, or enabling drop_params in LiteLLM, ends the error at once. When the probabilities are the point, the only working route found in tests from November 18 to 20 was a Gemini 2.5 model on Vertex AI, which should be planned as a stopgap. The official API reference still describes the fields without saying which models honour them, so teams that depend on token probabilities should log the model ID with every scored result and re-run a one-request test before each model migration.
··········
FOLLOW US FOR MORE.
·····
DATA STUDIOS
·····
datastudios.org




