Gemini
Use Google Gemini models as the LLM for your agents.
Get an API key
Get a free key at aistudio.google.com under Get API key.
Setup
# 1. Store the key
pai add secret gemini-key --from-literal api-key=AIzaSy...
# 2. Create a model binding
pai apply -f - <<EOF
apiVersion: pai.io/v1
kind: ModelBinding
metadata:
name: gemini-flash
spec:
provider: gemini
model: gemini-2.5-flash
maxTokensPerDay: 1000000
maxTokensPerRequest: 32000
apiKeySecretRef:
name: gemini-key
key: api-key
EOF
Supported models
| Model | model value | Best for |
|---|---|---|
| Gemini 2.5 Flash | gemini-2.5-flash | Best overall — fast, high token limits, cheap |
| Gemini 2.0 Flash | gemini-2.0-flash | Stable previous generation |
| Gemini 2.5 Pro | gemini-2.5-pro | Deep reasoning, complex tasks |
Use in an agent
spec:
modelBindings:
- gemini-flash
openclaw.json model reference
When configuring OpenClaw's openclaw.json, reference Gemini models as:
{
"agents": {
"defaults": {
"model": {
"primary": "google/gemini-flash-2-5"
}
}
}
}