Skip to content

Feature request: Add Google/Gemini provider support #18

@pbrazier

Description

@pbrazier

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

Thanks for the great plugin — would love to see this added!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions