GEMINI LABJP
PRO35 — July 17, the date reports had pointed to, has passed without an official Gemini 3.5 Pro announcement or model card. July 24 is being cited as the fallbackNB2LITE — Nano Banana 2 Lite, otherwise known as Gemini 3.1 Flash-Lite Image, arrives as the fastest of the family: roughly four seconds per image at $0.034 per thousandOMNI — Gemini Omni Flash enters public preview, generating video up to ten seconds long at $0.10 per second of outputEDIT — Omni Flash is built around conversational editing. Swap a character, relight a scene, or change the angle in plain language, and the original audio and video tracks stay intactSYNTHID — Both new models carry SynthID watermarking, so anything they produce can be checked for provenance from inside the Gemini appSHUTDOWN — The older image generation models are deprecated and switch off on August 17. Worth checking your migration windowPRO35 — July 17, the date reports had pointed to, has passed without an official Gemini 3.5 Pro announcement or model card. July 24 is being cited as the fallbackNB2LITE — Nano Banana 2 Lite, otherwise known as Gemini 3.1 Flash-Lite Image, arrives as the fastest of the family: roughly four seconds per image at $0.034 per thousandOMNI — Gemini Omni Flash enters public preview, generating video up to ten seconds long at $0.10 per second of outputEDIT — Omni Flash is built around conversational editing. Swap a character, relight a scene, or change the angle in plain language, and the original audio and video tracks stay intactSYNTHID — Both new models carry SynthID watermarking, so anything they produce can be checked for provenance from inside the Gemini appSHUTDOWN — The older image generation models are deprecated and switch off on August 17. Worth checking your migration window
Articles/API / SDK
API / SDK/2026-06-27Advanced

Stopping Runaway Costs Twice: Project Spend Caps Plus an App-Side Soft Limit

Pairing Gemini API Project Spend Caps (a monthly USD ceiling) with an app-side soft circuit breaker that trips before the hard cap. Includes a working Python and sqlite daily cost ledger.

Gemini API190Cost Management5Spend Caps2Automation13Operations8

Premium Article

One morning, before I had even made coffee, I opened the Gemini API dashboard and my hand froze for a second. The automated publishing pipeline I run unattended overnight had fired several times more requests than I expected. The cause was mundane: an external API was intermittently returning 5xx, and the retry logic I had written was dutifully hammering it again and again. The bill never became serious, but it left a quiet mark on me. Running something unattended means keeping a path open through which costs can quietly pile up while you are not watching.

Project Spend Caps, which reached general availability on June 26, 2026, speaks directly to that anxiety. You can set a monthly USD ceiling on Gemini API usage per project, and it stays in force until you change or disable it. Even so, a hard ceiling alone is not enough — that has been my honest experience as an indie developer running several apps and blogs unattended in parallel. In this piece I want to leave behind a two-layer design: Project Spend Caps as the foundation, with an app-side soft limit layered just inside it that quietly slows things down before the hard cap ever fires.

Where costs actually spike in unattended runs

Costs spike, almost always, during the hours when nobody is watching. And the causes are few enough to count on one hand.

First, retry storms. If you fire requests again immediately on a transient 429 or 5xx without exponential backoff, every failure becomes another call, and the volume swells in minutes. My own near-miss was exactly this.

Second, model misrouting. If you point a heavy model at light preprocessing such as background lookups or tagging, your per-request unit cost multiplies for no reason. Output tokens are priced higher than input, so casually letting a model return long responses adds up too.

Third, loops that never settle. In agentic flows that keep retrying "once more if it isn't enough," a loose stop condition spawns near-infinite round trips. When you run autonomous execution like Managed Agents unattended, this is the scariest pitfall of all.

None of these surface in normal testing. They bare their teeth only in production, in the hours while you sleep. That is exactly why you need a ceiling on cost itself, in a layer separate from the correctness of your code.

What Project Spend Caps protect, and what they don't

The role of Project Spend Caps is clear. Once monthly spend tied to a project reaches the USD amount you set, further billable requests are stopped. It works like a credit card limit — a last line of defense.

But a hard ceiling has an inherent limitation. The moment the cap is reached, in-flight work is rejected uniformly. A half-assembled article and a batch that was halfway done are stopped without distinction. From the app's point of view, calls suddenly start returning errors past a certain moment in time.

In other words, a hard cap exists to prevent disaster, not to decelerate gracefully. As the cap approaches near month-end, it cannot make the judgment to let important jobs through while deferring trivial ones. Filling that gap is the job of the soft limit we build next.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
How to assign a monthly USD ceiling per project with Project Spend Caps so a runaway loop can't bleed your budget
A daily cost ledger in Python and sqlite, with a soft circuit breaker that trips before the hard cap
Routing preprocessing to gemini-flash-latest and capping thinking budget to lower your baseline cost
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API / SDK2026-07-14
When a Batch Job Sat in RUNNING for Half a Day: Field Notes on Catching Stalls Early with Per-State Dwell Budgets and Record Reconciliation
When a Gemini Batch job stalls quietly under the shadow of the 24-hour SLA, per-state dwell-time budgets and submitted-vs-completed record reconciliation let you name the stall early. Field notes with real operational numbers.
API / SDK2026-07-01
Keeping Unattended Jobs From Failing Silently: A Preflight Gate for Gemini's Platform Changes
Unrestricted API keys are now rejected, the old CLI reached end of life, and the Interactions API is becoming the default entry point. These 2026 platform shifts stop working automation without raising an error. Here is a preflight gate, with runnable code, that catches the failure before the batch runs.
API / SDK2026-06-30
Fire-and-Forget on a Cron That Never Loses a Result: Reclaiming Gemini Background Executions with a Submission Ledger
A design for running the Interactions API's background execution safely from a cron-driven runner. We reserve a row in a ledger by idempotency key before submitting, then reclaim only outstanding handles on the next tick — shown with working code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →