Nano Banana 2.1: intermittent MAX_TOKENS with only 5,326 tokens used against a 32,768 limit, no image returned, billing clarification?

We use the Gemini API for photo editing and recently switched from Nano Banana 2.0 to Nano Banana 2.1 (gemini-nano-banana-2.1).

We processed thousands of photos with 2.0 without encountering this issue. Since moving to 2.1, we’re seeing intermittent responses with:

finishReason: MAX_TOKENS

These responses return no usable image, even though the reported output and thinking-token usage is substantially below our explicitly configured output limit.

Example from production

Time: October 7, 2026, approximately 6:45:36 PM US Eastern
Method: models.generateContent using the Google Gen AI JavaScript SDK
Model: gemini-nano-banana-2.1
Input: One 3840 × 2880 photo, plus editing instructions

Relevant request configuration:

{
  "temperature": 0,
  "topP": 0.95,
  "responseModalities": ["IMAGE"],
  "maxOutputTokens": 32768,
  "thinkingConfig": {
    "thinkingLevel": "HIGH"
  },
  "imageConfig": {
    "imageSize": "2K",
    "aspectRatio": "4:3"
  }
}

Relevant response fields captured by our diagnostics:

{
  "finishReason": "MAX_TOKENS",
  "promptTokenCount": 4958,
  "candidatesTokenCount": 1354,
  "thoughtsTokenCount": 3972
}

The reported candidate and thinking tokens total 5,326, or approximately 16% of the configured 32,768 output limit. The input tokens are separate from that output budget.

The candidate had no usable content/image, so our application treated the edit as failed. The next retry succeeded. Most edits complete normally; this is intermittent rather than a consistent failure for a particular image.

Questions for the team

  1. Why would this request finish with MAX_TOKENS when reported output plus thinking usage is only 5,326 against an explicit 32,768 ceiling? Is there a separate internal thinking/image-generation limit, or does the returned usage omit some tokens relevant to that limit?

  2. Is this a known change or regression in Nano Banana 2.1? We did not encounter this failure mode with 2.0 across thousands of processed photos.

  3. Are these no-image responses billed? Your billing FAQ says requests that fail with HTTP 400 or 500 errors aren’t charged. This case instead returns a model response with MAX_TOKENS and usage metadata, but no usable result. Are the input, thinking, and candidate tokens still charged, and how are candidate tokens classified when no image is returned?

  4. What mitigation do you recommend? We already explicitly set the documented 32,768 output ceiling. Is retrying the recommended approach, or is there another setting that addresses this without reducing editing quality?

We added these diagnostics specifically to distinguish actual output-budget exhaustion from other failures. We’re not assuming the finish reason is incorrect, but the reported usage doesn’t appear to explain it.

Happy to provide additional sanitized request/response details privately if helpful.

Hello @OPEN_TOURS ,

  • Why MAX_TOKENS occurs with thinkingLevel: "HIGH": 32,768 is the maximum output token limit for Gemini Nano Banana 2.1, and "HIGH" allows the model to use that full budget for reasoning and interim composition drafts (Thinking Process). If a generation exhausts the budget during reasoning before emitting the final image, it returns finishReason: "MAX_TOKENS"; retrying those calls (or using "MEDIUM" if you prefer a lower reasoning budget) is the expected approach.
  • Billing: Only HTTP 400 or 500 errors are not charged (Billing FAQ). An HTTP 200 OK response with finishReason: "MAX_TOKENS" is billed for the tokens reported in usageMetadata (promptTokenCount, thoughtsTokenCount, and candidatesTokenCount at the text output rate when no final image is returned; interim thought images are not charged—see Pricing).

Thanks for the response and I did notice that these images were reaching the maximum allowed after more debugging. I’ve already implemented the MEDIUM fallback for now. I would use MEDIUM all the time but it doesn’t give me the complete results I need that I get from HIGH. Thanks for the answer on billing. I feel that it should give you an incomplete edit back rather than charge you and give you nothing. I’m paying for nothing without any warning.