-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Feature Request: Google/Gemini Provider
Summary
Add a native Google/Gemini provider to track usage quotas for users accessing Gemini models via Google OAuth, similar to how the Anthropic and Codex providers work.
Context
Many OpenCode users access Gemini models (Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 3 Pro, etc.) directly via Google OAuth through the opencode-gemini-auth plugin. The auth credentials already exist in ~/.local/share/opencode/auth.json under a google key with OAuth tokens:
{
"google": {
"type": "oauth",
"refresh": "...",
"access": "...",
"expires": ...
}
}
Currently there is no way to track Gemini usage/quotas through the plugin. The only workaround suggested is routing through OpenRouter or the Mirrowel Proxy, both of which require separate paid services — not viable for users already on a Google subscription.
Proposed Behaviour
- New google provider alongside the existing ones (codex, anthropic, proxy, copilot, zai, openrouter)
- Reads auth from the existing google entry in auth.json
- Fetches quota/rate-limit data from Google's API
- Adds "google": true toggle in usage-config.jsonc under providers
- Accessible via /usage google or /usage gemini
Related
- can you make these work? #8 also mentions "google": true as unsupported
Thanks for the great plugin — would love to see this added!