Skip to content

[FEATURE]: multi-account OpenAI support — account pool, /account commands, interactive picker #23620

Closed as not planned

Description

@lNimien

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

Context

I'm aware of previous requests for this feature (#8591, #9068, #11830)
but none received maintainer feedback. I'm opening this one because
I have a working implementation ready.

Problem

Currently, /connect overwrites the previous OpenAI account every time it's used.
There is no way to have multiple ChatGPT accounts connected simultaneously.
This is a significant limitation for users who manage several accounts and want to
distribute usage across them without manually reconnecting every time.

Scope

This implementation is OpenAI-only — specifically for users running
ChatGPT Plus with Codex quota. No generic multi-provider abstraction,
no over-engineering. Just the problem I actually had.

Proposed Solution

We implemented a multi-account pool for OpenAI in a fork. The approach is minimal,
backwards compatible, and OpenAI-specific (no over-engineered generic abstraction).

What We Built

  • /connect now accumulates accounts instead of overwriting — each new login adds
    a new entry to the pool
  • /account list — shows all connected accounts with email and status (enabled/disabled/active)
  • /account use — interactive picker with arrow keys + Enter to switch active account
  • /account disable — interactive picker to disable an account from the pool
  • /account remove — interactive picker to remove an account from the pool
  • Visual indicator in the TUI showing the active account email next to the model indicator
  • Full backwards compatibility with existing single-account auth.json format —
    existing users are not affected

Technical Approach

  • Extended auth.json with an accounts[] array under the OpenAI key
  • Old single-account format is auto-migrated on first read
  • /account commands are local TUI commands, not model prompts
  • Token refresh updates only the selected account entry, never touches others
  • New backend endpoints: GET/DELETE/POST /provider/openai/account/...

Status

We have a working fork validated on Windows 11. All features above are functional.

Fork

https://github.com/lNimien/opencode

Question for Maintainers

Would you be interested in a PR for this? If so, do you have preferences on:

  • The storage approach (auth.json extension vs separate file)
  • Whether session affinity (pinning a session to a specific account) should be
    included in the same PR or as a follow-up
  • Any specific test coverage requirements

Happy to polish and submit a proper PR if there's interest.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Apr 21, 2026
  2. github-actions commented on Apr 21, 2026

    @github-actions
    Contributor

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

    You also mentioned #8591, #9068 in your issue — those are closed, but the open ones above are still active. Please review these and consider whether your request overlaps, or add context in this issue explaining how it differs.

  3. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
  4. KaramTNC commented on May 26, 2026

    @KaramTNC

    Im interested in this, perhaps open a PR so they can approve it?

  5. lNimien commented on May 26, 2026

    @lNimien
    Author

    Im interested in this, perhaps open a PR so they can approve it?

    I was using this on version 1.14.50, so my branch already has it merged.
    If you want, you can create the PR using my code/fork. Just credit me for the original implementation, and you can maintain the PR from there.
    I won’t open the PR myself since I don’t need this anymore.

  6. github-actions commented on Jul 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions