Production pipeline broken after Gemini 3 Flash Preview stopped working (Paid API Key / 404 Errors)

Hello everyone,

I am running a heavy data extraction pipeline in a production environment using a Paid API Key (Pay-As-You-Go).

My workflow processes scanned PDF documents page-by-page using a two-step system:

  1. Step 1 (OCR): Image $\rightarrow$ Text (Markdown format).
  2. Step 2 (QA Parsing): Markdown $\rightarrow$ Structured Question-Answer JSON output.

The Issue

This system was running perfectly with 99.9% accuracy using the gemini-3-flash-preview model. However, within the last 48 hours, the pipeline stopped working completely, throwing various API failures.

Additionally, fallback configurations targeting other models are immediately crashing with 404 NOT_FOUND errors.

Error Logs Excerpts

2026-06-18 18:07:54,909 | WARNING | Gemini [gemini-2.0-flash-lite] failed structured_ocr p1: 404 NOT_FOUND.
This model (models/gemini-2.0-flash-lite) is no longer available.

2026-06-18 18:07:56,548 | WARNING | Gemini [gemini-2.0-flash] failed structured_ocr p1: 404 NOT_FOUND.
This model (models/gemini-2.0-flash) is no longer available.

2026-06-19 10:59:10,121 | WARNING | [gemini-2.5-flash] truncated (MAX_TOKENS) — trying next model

Payload Statistics Per Page Request:

  • Average Input Tokens: 17,785 to 21,205 tokens
  • Average Output Tokens: 10,041 to 13,541 tokens

My Questions for the Community/Google Team:

  1. Model Recommendations: Since gemini-3-flash-preview and the 2.0-flash stable variants appear entirely deprecated or modified, what is the officially recommended, stable production model for high-accuracy vision OCR $\rightarrow$ JSON processing?
  2. Output Token Truncation: Why does gemini-2.5-flash throw a MAX_TOKENS truncation warning at only ~5,862 tokens when it is documented to support a much larger output capacity?
  3. Migration and Cost Lifecycle: To keep processing costs low while managing a production budget, should I upgrade directly to gemini-3.5-flash, or switch to a variant like gemini-2.5-flash-image? Are there upcoming deprecation timelines for the 2.5 series I should plan around?

Any insight, guidance, or recommended configuration changes from the engineering team or fellow developers would be greatly appreciated. Thank you!

Hello @Rinkesh,

I apologise for slow response,

  1. gemini-3.5-flash
  2. Unless explicitly set using the maxOutputTokens field, the API does not use the entire 65k token limit for flash models if thinking parameter is not specified in API request. Also, internal thinking tokens count against this limit, causing the visible output to truncate early at ~5,862 tokens. Set maxOutputTokens to 65535 in your request config to utilize the full 65k limit. (Reference: https://ai.google.dev/api/generate-content#FIELDS.max_output_tokens)
  3. Do not use gemini-2.5-flash-image for this usecase; it is an image-generation model, not an OCR model. Upgrade directly to gemini-3.5-flash, or switch to gemini-3.1-flash-lite for the lowest cost (6x cheaper than 3.5 Flash). The Gemini 2.5 series will sunset on October 16, 2026