#Service tier for Google Gemini
1 messages ยท Page 1 of 1 (latest)
Not currently.
I checked the docs and provider code: OpenClaw maps serviceTier / service_tier for:
openai/*openai-codex/*anthropic/*
For direct google/* Gemini runs, the documented/provider-native extras are things like cachedContent and thinking controls, not service_tier, and the Google transport does not forward a Gemini service_tier field.
Docs:
- https://docs.openclaw.ai/providers/google
- https://docs.openclaw.ai/concepts/model-providers
- https://docs.openclaw.ai/providers/openai
- https://docs.openclaw.ai/providers/anthropic
So if you set params.serviceTier on google/gemini-*, it won't give you an OpenAI-style priority tier today.
If you want, I can help draft the exact GitHub feature request wording.
Someone openned a request on GitHub at https://github.com/openclaw/openclaw/issues/69102. Which file I need to edit (from source) to fit my needs? A temporary, "dirty" hardcode is fine
For a quick dirty hack, edit this file:
/home/exedev/openclaw-ref/extensions/google/transport-stream.ts
The key spots are:
GoogleGenerateContentRequestaround line 60buildGoogleGenerativeAiParams(...)around line 441
That function builds the JSON body sent to Gemini, so this is the place to inject a top-level service_tier.
Minimal hack:
type GoogleGenerateContentRequest = {
service_tier?: string;
cachedContent?: string;
contents: Array<Record<string, unknown>>;
generationConfig?: Record<string, unknown>;
systemInstruction?: Record<string, unknown>;
tools?: Array<Record<string, unknown>>;
toolConfig?: Record<string, unknown>;
};
and then in buildGoogleGenerativeAiParams(...):
const params: GoogleGenerateContentRequest = {
contents: convertGoogleMessages(model, context),
service_tier: "priority", // or "flex"
};
If you only want it for some models, gate it there:
if (model.id.includes("gemini-3")) {
params.service_tier = "priority";
}
If you want the slightly less dirty version, also add serviceTier?: string to GoogleTransportOptions near line 40, then map:
if (options?.serviceTier) {
params.service_tier = options.serviceTier;
}
Useful companion test file: