400 "Request contains an invalid argument" when systemInstruction exceeds ~85–90k tokens (3.7/3.8 Flash, 3.1 Pro)

Since around 14–15 September our production requests to gemini-3.8-flash started failing with a bare 400 INVALID_ARGUMENT, “Request contains an invalid argument.”, no details, returned in under a second. The same kind of request (about 165k input tokens) worked the day before.

We narrowed it down with plain generateContent calls, API key, v1beta, no tools:

  • systemInstruction with ~300k characters (~84k tokens): works
  • systemInstruction with ~320k characters (~90k tokens): 400
  • the same 400k characters split between systemInstruction and a user turn (112k tokens total): works
  • all of it in the user turn: works
  • gemini-3.5-flash and 3.5-flash-lite accept a 125k-token systemInstruction; 3.7-flash, 3.8-flash and 3.1-pro-preview reject it

So it looks like a new ceiling on the system instruction specifically, not on total input. It isn’t in the docs or the changelog, and the status page is green. Is this intended? If so, what is the exact limit, and is it counted in tokens or bytes? A clear error message would have saved us a morning of downtime.

Possibly related !?: bug(google-antigravity): Gemini 3.7 Flash fails with 400 "Request contains an invalid argument" during long sessions · Issue #9638 · can1357/oh-my-pi · GitHub

I have exact same issue in the Gemini Studio APP (Using Free Tier). My Gemini Studio with PRO Subscription is unaffected with this cap.

Hello @C10Bjorn ,

DM’ed you for more details.