#Multiple Gemini API Keys

1 messages · Page 1 of 1 (latest)

twilit junco
#

I have two Gemini keys, and have two Gemini provider profiles. How do I specify which profile should use which key?

jolly yachtBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

true reefBOT
# twilit junco I have two Gemini keys, and have two Gemini provider profiles. How do I specify ...

You don’t wire “Gemini keys ↔ provider profiles” in openclaw.jsonAPI keys live in the per-agent auth store (auth-profiles.json). The auth.profiles block in config is just metadata + ordering (no secrets).

1) Put each Gemini key into its own auth profile

Edit (for the agent you’re running):

~/.openclaw/agents/<agentId>/agent/auth-profiles.json

Under profiles, create two entries (provider for Gemini API is google, and API keys are stored as type: "api_key" with a key field):

{
  "version": 1,
  "profiles": {
    "google:personal": { "type": "api_key", "provider": "google", "key": "AIza...PERSONAL..." },
    "google:work":     { "type": "api_key", "provider": "google", "key": "AIza...WORK..." }
  }
#
}

Tip: if you already have google:default, just duplicate it, rename the profile id, and change the key.

To see which agent/auth file you’re actually using:

openclaw models status

2) Choose which one gets used

Global/provider order (per-agent override) via CLI:

openclaw models auth order set --provider google google:work google:personal