Skip to content
providerkit
GitHub

GeminiConfig

Defined in: core/src/providers/gemini.ts:50

Standard options that any provider config can accept to configure fallbacks inline.

optional allowLegacySampling?: boolean;

Defined in: core/src/providers/gemini.ts:72

Forward explicit sampling on a pinned older model known to accept it. Off by default: newer models ignore or reject temperature and topP.


apiKey: string;

Defined in: core/src/providers/gemini.ts:51


optional baseUrl?: string;

Defined in: core/src/providers/gemini.ts:55

Any endpoint speaking the Generative Language REST dialect, including a proxy or gateway. Defaults to the Generative Language API.


optional bearer?: boolean;

Defined in: core/src/providers/gemini.ts:61

Send the credential as Authorization: Bearer instead of x-goog-api-key (Antigravity OAuth).


optional effort?: "low" | "medium" | "high" | "none" | "max";

Defined in: core/src/providers/gemini.ts:77

Bound default; a per-call effort overrides it.


optional fallbackOptions?: FallbackOptions<Provider>;

Defined in: core/src/fallback.ts:109

Custom cooldown or telemetry options for the fallback pool.

ProviderFallbackConfig.fallbackOptions


optional fallbacks?: readonly FallbackCandidate[];

Defined in: core/src/fallback.ts:103

Secondary and tertiary providers to try if this provider fails/exhausts: hand-built Providers, preset-id FallbackSpecs, or both.

ProviderFallbackConfig.fallbacks


optional fetchImpl?: FetchLike;

Defined in: core/src/providers/gemini.ts:100


optional headers?: Record<string, string>;

Defined in: core/src/providers/gemini.ts:103


optional id?: string;

Defined in: core/src/providers/gemini.ts:69

Names the provider in errors and logs.


optional instanceSessionId?: string;

Defined in: core/src/providers/gemini.ts:67

The id sessionHeader carries when a call has no sessionId.


optional jsonMode?: boolean;

Defined in: core/src/providers/gemini.ts:95

Ask for JSON without sending a schema. For calls without tools; an explicit json schema still uses the normal schema and tool policy.


optional jsonWithTools?: JsonWithTools;

Defined in: core/src/providers/gemini.ts:92

How the schema rides on a call that also carries tools. See JsonWithTools. Note that it is the model’s answer, not the endpoint’s: measured 2026-09-07, gemini-3.5-flash and gemini-3.5-flash-lite called their tool under responseJsonSchema every time, while gemini-3.8-flash managed 3/10. probeJsonWithTools asks the one you actually serve. Overridable per call.


optional maxTokens?: number;

Defined in: core/src/providers/gemini.ts:99


model: string;

Defined in: core/src/providers/gemini.ts:52


optional path?: string;

Defined in: core/src/providers/gemini.ts:58

Explicit path override when a backend has custom routing (Antigravity: /v1internal:streamGenerateContent?alt=sse).


optional projectId?: string;

Defined in: core/src/providers/gemini.ts:63

Google Antigravity (Cloud Code Assist) project id for the request envelope.


optional redactErrors?: boolean;

Defined in: core/src/providers/gemini.ts:102

Leave the provider’s words out of every error. See PresetProviderConfig.redactErrors.


optional reportModelVersion?: boolean;

Defined in: core/src/providers/gemini.ts:98

Include Gemini’s reported model version in the finish chunk’s source. By default a registry or fallback keeps reporting the configured model, for its price lookup.


optional resolveThinkingConfig?: (effort, model) =>
| GeminiThinkingConfig
| undefined;

Defined in: core/src/providers/gemini.ts:83

Replace the thinking settings for the effective effort and model (without models/). Return undefined to use Core’s default. Not called when no effort is set. Use only with Gemini endpoints that accept these settings. Not supported on Antigravity.

Parameter Type
effort "low" | "medium" | "high" | "none" | "max"
model string

| GeminiThinkingConfig | undefined


optional servesHostedTools?: readonly (
| "web_search"
| "web_fetch"
| "code_execution"
| "file_search"
| "image_generation")[];

Defined in: core/src/providers/gemini.ts:112

For providers imported from @providerkit/core/hosted. The hosted tools this endpoint runs. Defaults to web search, web fetch, code execution and file search on the Gemini API (generativelanguage.googleapis.com), and to none anywhere else. Vertex and the gateways differ, and one that ignores a tool answers unsearched without saying so. Antigravity runs none.


optional sessionHeader?: string;

Defined in: core/src/providers/gemini.ts:65

Header that carries StreamOptions.sessionId.


optional settleUsageOnTerminalError?: boolean;

Defined in: core/src/providers/gemini.ts:75

Read the trailing usage frames after a terminal model error before throwing it. Use with a deadline on the request. This does not make a failed reply usable.


optional watchdog?: WatchdogOptions;

Defined in: core/src/fallback.ts:107

Watch every candidate separately. A silent candidate then times out and rotates; wrapping the completed pool would abort the whole chain instead. Fallback specs inherit this unless they set their own watchdog.

ProviderFallbackConfig.watchdog