Skip to content

[FEATURE]: Support multiple auth profiles per provider #16866

@young5lee

Description

@young5lee

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

  • I have searched existing issues and could not find the same request.
  • This is a feature request, not a bug report.
  • I am opening this issue first for design discussion before any PR.

Problem

OpenCode already has strong provider-agnostic support, but authentication still appears to be effectively single-profile per provider in normal usage.

That makes it difficult to use cases like:

  • separate personal and work credentials for the same provider
  • separate org/project credentials
  • explicit backup credentials for the same provider
  • switching between multiple legitimate accounts without rewriting config or re-authing

Proposed solution

Please support multiple named auth profiles per provider.

Example direction:

  • anthropic/personal
  • anthropic/work
  • openai/default
  • openai/team-a

Useful capabilities would be:

  • store multiple auth profiles for the same provider
  • select an active profile
  • optionally reference a profile from config / agent config
  • switch profiles from CLI or TUI
  • keep backward compatibility with the current single-auth setup

Why this belongs in OpenCode

This seems aligned with OpenCode’s provider-agnostic philosophy. It would improve flexibility for real-world usage without coupling the project to any specific provider.

It would also create a clean foundation for future resilience features such as cooldown-aware failover.

Non-goals

I am not asking for hidden quota bypassing. I am asking for explicit, user-configured auth profiles for legitimate multi-account / multi-org setups.

Additional context

A lot of users have separate personal/work credentials or multiple organization-managed credentials for the same provider. Right now that seems harder than it needs to be.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions