Skip to content

Feature Request: Multi-account support for load balancing #85

@sreekaransrinath

Description

@sreekaransrinath

Feature Request

Add multi-account support similar to how opencode-antigravity-auth handles multiple Google accounts.

Use Case

I have multiple ChatGPT accounts (Pro + Plus) and would like to:

  1. Add multiple accounts to a pool
  2. Automatic load balancing when one account hits rate limits
  3. Automatic failover to the next available account

How Antigravity Does It

The opencode-antigravity-auth plugin has excellent multi-account support:

  • Stores accounts in ~/.config/opencode/antigravity-accounts.json
  • Supports up to 10 accounts
  • Sticky account selection - sticks to the same account until rate limited (preserves prompt cache)
  • Automatic failover - on HTTP 429, switches to next available account
  • Smart cooldown - rate-limited accounts become available again after cooldown expires
  • When running opencode auth login, prompts: "(a)dd new account(s) or (f)resh start?"

Current Behavior

Currently, running opencode auth login for OpenAI overwrites the existing account in ~/.local/share/opencode/auth.json. There's no way to maintain multiple accounts.

Proposed Solution

Similar to Antigravity:

  1. Store multiple accounts in a separate JSON file (e.g., ~/.config/opencode/openai-accounts.json)
  2. Prompt to add or replace when an account already exists
  3. Implement automatic switching on 429 errors
  4. Track rate limit cooldowns per account

Environment

  • OpenCode version: 1.0.207
  • Plugin version: Using hotfix branch via oh-my-opencode
  • OS: macOS

Thank you for the great plugin!

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