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

**URL:** <https://discuss.ai.google.dev/t/production-pipeline-broken-after-gemini-3-flash-preview-stopped-working-paid-api-key-404-errors/171941>\
**Category:** Gemini API\
**Tags:** models, api, ai-studio, bug, billing\
**Created:** [June 19, 2026, 1:21pm UTC](https://discuss.ai.google.dev/t/production-pipeline-broken-after-gemini-3-flash-preview-stopped-working-paid-api-key-404-errors/171941 "2026-06-19T13:21:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rinkesh](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/rinkesh/32/35157_2.png) [@Rinkesh](https://discuss.ai.google.dev/u/Rinkesh)\
**Post date:** [June 19, 2026, 1:21pm UTC](https://discuss.ai.google.dev/t/production-pipeline-broken-after-gemini-3-flash-preview-stopped-working-paid-api-key-404-errors/171941/1 "2026-06-19T13:21:14Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Sai\_Deepika\_K](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/sai_deepika_k/32/34803_2.png) [@Sai\_Deepika\_K](https://discuss.ai.google.dev/u/Sai_Deepika_K)\
**Post date:** [July 20, 2026, 10:38am UTC](https://discuss.ai.google.dev/t/production-pipeline-broken-after-gemini-3-flash-preview-stopped-working-paid-api-key-404-errors/171941/2 "2026-07-20T10:38:30Z")

</div>

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](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
