Skip to content

Support multiple authenticated accounts per provider with automatic load balancing / failover #36778

Closed

Description

@muhedin998

Problem

Currently OpenCode allows a single authenticated account per provider.

Some users legitimately have multiple subscriptions for the same provider (for example separate personal and work accounts, or multiple family/team subscriptions).

Today, once the active account reaches a rate limit or usage cap, requests fail even though another authenticated account is available.

The only workaround is manually reconnecting or running multiple OpenCode instances.

Proposal

Allow multiple authenticated accounts to be stored for the same provider.

When a request fails due to rate limiting or quota exhaustion, OpenCode should automatically retry with the next available account for that provider.

Ideally the rotation should also support a simple load-balancing strategy so that usage is spread across accounts proactively, not only on failure.

Suggested behavior

  • opencode auth add <provider> can be called more than once to register additional accounts.
  • A new subcommand or config section lists all stored accounts per provider and lets the user set a preferred order.
  • On rate-limit or quota errors, OpenCode transparently retries on the next account before surfacing an error to the user.
  • Optional: round-robin or random account selection to distribute load before hitting limits.

Why this matters

Many developers have multiple subscriptions (personal, work, family plan, etc.) and currently have no way to use them seamlessly in a single OpenCode session.

Automatic failover would also improve reliability for long-running or batch tasks.

Activity

  1. github-actions commented on Jul 13, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature requests must use the [FEATURE]: prefix in the title (e.g. [FEATURE]: Support multiple authenticated accounts per provider...)
    • Feature requests must use the feature request issue template, which includes a verification checkbox confirming you have searched for existing issues

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. muhedin998 commented on Jul 13, 2026

    @muhedin998
    Author

    Closing — this is already tracked in #8145, #5391, #23620, and #29085. Subscribing to those instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions