openclaw - 💡(How to fix) Fix Support Google Gemini flex service tier (50% discount on non-time-sensitive requests) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#78258Fetched 2026-05-07 03:39:06
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
closed ×1commented ×1cross-referenced ×1

Fix Action

Fix / Workaround

Workaround for users hitting this

RAW_BUFFERClick to expand / collapse

Background

Google's Gemini API supports a "flex" service tier that offers a 50% discount on non-time-sensitive requests. It's a great fit for cron / batch / heartbeat jobs that don't need fast response.

OpenClaw already has serviceTier plumbing for OpenAI, Anthropic, and Minimax (via createOpenAIServiceTierWrapper, createAnthropicServiceTierWrapper, etc.), but no equivalent for the Google provider.

Current behavior (2026.5.4-beta.1, commit 9cc3ae1)

Setting a model as google/gemini-3.1-flash-lite-preview?serviceTier=flex in a cron payload (or anywhere a model ref is parsed):

  1. normalizeStaticProviderModelId (model-ref-shared-CCa0R1eg.js:12-22) does not strip the query string — the entire gemini-3.1-flash-lite-preview?serviceTier=flex is treated as the model id.
  2. The allowlist check fails unless the literal …?serviceTier=flex string is also added to agents.defaults.models.
  3. Even when allowlisted, Google returns either 404 Unknown Model or an empty response, since the literal model name doesn't exist.

So ?serviceTier=flex is currently a no-op syntactically — it isn't parsed anywhere, and there's no Google wrapper that would honor it.

Request

Add Google flex tier support, mirroring the existing OpenAI/Anthropic implementations:

  • A createGoogleServiceTierWrapper (analogous to createOpenAIServiceTierWrapper).
  • Wire it into the Google provider stream composition (provider-stream-…js).
  • A configuration path — either:
    • per-model option in agents.defaults.models[<id>].serviceTier = "flex", or
    • per-call override on cron payloads / agent turns, or
    • the existing ?serviceTier=flex model-id query syntax, parsed centrally and stripped before the allowlist + provider call.

Workaround for users hitting this

Use bare model ids (no ?serviceTier=flex) — costs full standard tier but jobs run.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING