Skip to main content

Gemini

Use this when your team already runs on Gemini and you want that vendor family to stay explicit in Loong config instead of disappearing behind a generic compatibility route.

At A Glance

FieldValue
Built-in kindgemini
Provider groupDirect Hosted Providers
Protocol familyopenai_chat_completions
Feature familyopenai_compatible
Auth schemebearer
Credential envsGEMINI_API_KEY, GOOGLE_API_KEY
Aliasesgemini_compatible, google, google_gemini, google-gemini
Default base URLhttps://generativelanguage.googleapis.com/v1beta/openai
Request endpointhttps://generativelanguage.googleapis.com/v1beta/openai/chat/completions
Models endpointhttps://generativelanguage.googleapis.com/v1beta/openai/models

Minimal Config

active_provider = "gemini"

[providers.gemini]
kind = "gemini"
api_key = { env = "GEMINI_API_KEY" }
model = "auto"

Verify It

loong doctor
loong list-models
loong ask --message "Say hello and name the active provider."
If list-models is unreliable for this account or region, pin an explicit provider.model or add preferred_models instead of leaving recovery implicit.

Auth And Routing Contract

ContractValue
Auth optionalno
Model probe auth optionalno
Default API key envGEMINI_API_KEY
OAuth envnone
Primary request routehttps://generativelanguage.googleapis.com/v1beta/openai/chat/completions
Primary model-catalog routehttps://generativelanguage.googleapis.com/v1beta/openai/models