GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Have multiple instances of the same provider · Issue #6217 · anomalyco/opencode

Have multiple instances of the same provider #6217

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Have multiple instances of the same provider#6217
Copy link
Assignees
thdxr

Description

@raymelon
raymelon
opened on Dec 26, 2025
Issue body actions

Question

Curious if it's possible to have multiple instances of the same provider from the same provider?

One user group that will benefit this are people managing multiple OpenRouter accounts plus their personal ones.

The idea is this: on Select model, instead of single OpenRouter group:

OpenRouter
Claude Haiku 3.5
Claude Haiku 4.5

It will be:

<Custom name 1> (OpenRouter)
Claude Haiku 3.5
Claude Haiku 4.5

<Custom name 2> (OpenRouter)
Claude Haiku 3.5
Claude Haiku 4.5

--
Meanwhile, on Connect provider, instead of asking for the key right away, a custom name will be asked optionally

The idea is there can be multiple instances of the same provider

Reacted by Alex Fanthome, Daniel Sticker , Leonardo D'Ippolito, Jason Bouffard, MiroshnykovDaniil, Cedric Ahlers, Mattwmaster58, Anurag, Martin Wernstål, rockingdice and 11 more

Activity

  1. github-actions
    assigned
    thdxr
    on Dec 26, 2025
  2. github-actions commented on Dec 26, 2025

    @github-actions
    github-actionsBot
    on Dec 26, 2025 – with GitHub Actions
    Contributor
    More actions

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

    • [FEATURE]: multiple auth profiles per provider #5391: [FEATURE]: multiple auth profiles per provider - Requests the ability to have multiple profiles per provider that can be switched between in the provider picker
    • Proposal: Provider Auth v2 (encrypted credential vault + multi-account OAuth + same-request rotation) #5748: Proposal: Provider Auth v2 (encrypted credential vault + multi-account OAuth + same-request rotation) - Comprehensive proposal for multi-account support per provider with encrypted credential vault
    • Support multiple API keys per provider with fallback logic #1326: Support multiple API keys per provider with fallback logic - Requests multiple API keys per provider with automatic fallback

    Feel free to ignore if none of these address your specific case.

  3. spenceforce commented on Jan 7, 2026

    @spenceforce
    spenceforce
    on Jan 7, 2026
    More actions

    +1 for this. From a billing standpoint, allowing multiple API keys would be a quality of life improvement. For people who mix work and personal on one computer (#7188) or want separate billing on a per project basis this would make that a lot easier.

    Edit: I see you can configure per project API keys in the config section, which solves my problem :)

    Reacted by patriksimms, Raymel and Erik O'Leary
  4. patriksimms commented on Jan 7, 2026

    @patriksimms
    patriksimms
    on Jan 7, 2026
    More actions

    @spenceforce Do you have a link to the docs where this is possible?

    I also have the feeling that this works for API-key based providers, but not the oauth ones (e.g. anthropic)

    Edit: Nevermind, found it. For reference: https://opencode.ai/docs/config/#env-vars. But as said, looks like it only works for api key based auth

  5. patriksimms commented on Jan 7, 2026

    @patriksimms
    patriksimms
    on Jan 7, 2026
    More actions

    Digged a little in the source code. It looks like oauth credentials are stored globally in /Users/patriksimms/.local/share/opencode/auth.json with following schema:

    {
      "anthropic": {
        "type": "oauth",
        "refresh": "sk-ant-ort01-eA...",
        "access": "sk-ant-oat01-5t...",
        "expires": 1234
      }
    }
    Reacted by Raymel, krshock and Oliver W.
  6. spenceforce commented on Jan 7, 2026

    @spenceforce
    spenceforce
    on Jan 7, 2026
    More actions

    I only see references to API keys and not oauth credentials. I primarily work with API keys, so didn't even think about that use case when I made my comment. That would still be a pain point then.

  7. mathisdev7 commented on Jan 17, 2026

    @mathisdev7
    mathisdev7
    on Jan 17, 2026
    More actions

    ran into this exact problem with my two $20 codex subs so i ended up building a tui that supports multiple accounts or api key per provider and rotates automatically
    sharing in case it helps: https://github.com/arctic-cli/interface

    Reacted by rockingdice
    Reacted by Raymel and rockingdice
  8. clowa commented on Feb 1, 2026

    @clowa
    clowa
    on Feb 1, 2026
    More actions

    Would be awesome to see support for using OAuth together with API Key for the same (or a duplicated) provider.

    In my case we are using OpenAI with a Business Subscription which includes access to codex. However, connecting with OpenAI via OAuth only grant access to a small subset of modules, therefore every time I want to use a none included module I have to reconfigure the OpenAI provider to use a API Key. It would be awesome if OpenCode would be capable of configuring both OAuth and API Key to connect to OpenAI (or others as well) to have access to all available models.
    It would be totally fine if there would be simply two connections to OpenAI, one with OAuth, one with API Key.

    Perhaps someone already knows a trick on how to do this?

  9. raymelon commented on Feb 9, 2026

    @raymelon
    raymelon
    on Feb 9, 2026
    Author
    More actions

    Digged a little in the source code. It looks like oauth credentials are stored globally in /Users/patriksimms/.local/share/opencode/auth.json with following schema:

    {
    "anthropic": {
    "type": "oauth",
    "refresh": "sk-ant-ort01-eA...",
    "access": "sk-ant-oat01-5t...",
    "expires": 1234
    }
    }

    This is smart. Given this information, a workaround is to just have two or more of the same provider, suffixed when unused. Easy to switch imo.

      "openrouter_work": { // unused. to use, rename this to openrouter and suffix the unused to change its name
        "type": "api",
        "key": "work key"
      },
      "openrouter": { // the one used
        "type": "api",
        "key": "main key"
      },

    Cool stuff @patriksimms . Thanks for sharing.

    Reacted by patriksimms, Florian Bellmann, Frederik Bosch, Oliver W. and Francisco Ruiz
    Reacted by Erik O'Leary and Oliver W.
  10. florianbellmann commented on Feb 16, 2026

    @florianbellmann
    florianbellmann
    on Feb 16, 2026
    More actions

    @raymelon This sounds exactly like what I need 😄 ! how do you switch between the keys in the TUI then?

  11. raymelon commented on Feb 17, 2026

    @raymelon
    raymelon
    on Feb 17, 2026
    Author
    More actions

    @raymelon This sounds exactly like what I need 😄 ! how do you switch between the keys in the TUI then?

    @florianbellmann I have to dig into the source to see. Also depends if it is something that the team will merge.

    But I'm good with editing the json to use the key for the provider. Only caveat is only one key is available per provider. Another is restarting OpenRouter after switching. For a multi-window setup, it's a bit of a hassle.

  12. quarkcore commented on Feb 25, 2026

    @quarkcore
    quarkcore
    on Feb 25, 2026
    More actions

    I wrote a small Bash script that sets auth.json as a symlink, and I have a directory with different auth settings. I am just going to share it here. Maybe it will work for someone else too.

    #!/usr/bin/env bash
    
    set -euo pipefail
    
    AUTH_PROFILES_DIR="$HOME/.config/opencode/auth-profiles"
    TARGET_LINK="$HOME/.local/share/opencode/auth.json"
    
    if [ $# -ne 1 ]; then
      echo "Available profiles:"
      if [ -d "$AUTH_PROFILES_DIR" ]; then
        ls -1 "$AUTH_PROFILES_DIR" | sed 's/\.json$//'
      else
        echo "(directory not found: $AUTH_PROFILES_DIR)"
      fi
      echo
      echo "Usage: opencode-auth <profile>"
      exit 1
    fi
    
    PROFILE="$1"
    PROFILE_FILE="${PROFILE%.json}.json"
    SOURCE_FILE="$AUTH_PROFILES_DIR/$PROFILE_FILE"
    
    if [ ! -f "$SOURCE_FILE" ]; then
      echo "Error: Profile '$PROFILE' not found in $AUTH_PROFILES_DIR"
      exit 1
    fi
    
    mkdir -p "$(dirname "$TARGET_LINK")"
    
    ln -sfn "$SOURCE_FILE" "$TARGET_LINK"
    
    echo "✅ Switched opencode auth to: ${PROFILE_FILE%.json}"
    Reacted by Thomas Orgeval
    Reacted by Raymel
  13. nateshmbhat commented on Feb 28, 2026

    @nateshmbhat
    nateshmbhat
    on Feb 28, 2026
    More actions

    really really need this feature, i'm having to juggle between many different providers and accounts as i keep running out of credits

    Reacted by Paweł Borecki, krshock and Erik O'Leary
    Reacted by Raymel
  14. krshock commented on Mar 15, 2026

    @krshock
    krshock
    on Mar 15, 2026
    More actions

    I have 3 "cost centers": two unrelated projects (work) and one for personal use.
    Opencode doesnt know about ZEN workspaces (i created 3 different ones, only to learn opencode doesnt care: one provider, one key)
    At least needs to support selecting opencode/zen workspaces for different runing instances of opencode because it just makes sense.

    This is ideal for people who wants to manage their per-project usage, because in some case i can pass my llm costs directly to my client)

  15. raf1hh commented on Mar 15, 2026

    @raf1hh
    raf1hh
    on Mar 15, 2026
    More actions

    PR #17664 should in theory work with other providers and not just copilot. Just need to specify the auth used...

  16. onionhammer commented on May 12, 2026

    @onionhammer
    onionhammer
    on May 12, 2026
    More actions

    This seems very important for people who aren't just hobbyists

  17. MythicSorcerer commented on May 14, 2026

    @MythicSorcerer
    MythicSorcerer
    on May 14, 2026
    More actions

    Sigh.... I don't want to have to change my auth.json every time I need to switch. This is so annoying.

    Reacted by Erik O'Leary
  18. raf1hh commented on May 14, 2026

    @raf1hh
    raf1hh
    on May 14, 2026
    More actions

    I had a PR that solved it but it was ignored. I have a fork of OC where this is implemented:
    https://github.com/raf1hh/opencode/tree/feat/auth-provider-alias

    I build the binary of that branch, rename and then copy it to bin. Then use OCX to launch OC with a specific profile and specific binary.

    { "$schema": "https://ocx.kdco.dev/schemas/profile.json", "bin": "/Users/raf1hh/bin/opencode_with_auth_provider_1.4.25", "registries": {}, "renameWindow": true, "exclude": [ // "**/AGENTS.md" — Commented out = project AGENTS.md files are INCLUDED. // Uncomment this line to exclude all project instruction files. "**/CLAUDE.md", "**/CONTEXT.md", "**/.opencode/**", "**/opencode.jsonc", "**/opencode.json", "**/.env" ], "include": [ "**/.env.example" ] }

  19. joeldrapper commented on Jun 2, 2026

    @joeldrapper
    joeldrapper
    on Jun 2, 2026
    More actions

    I often need to switch between my work and personal OpenAI accounts, deepening on what project I’m working on. It would be great if there was a way to configure multiple OpenAI accounts and label them.

  20. rwxce commented on Jun 3, 2026

    @rwxce
    rwxce
    on Jun 3, 2026
    More actions

    I think this would be useful beyond just supporting multiple API keys for the same provider.

    One possible UX improvement could be to make provider connections more explicit in the UI, maybe grouped under a user-defined profile or account group.

    For example:

    Work

    • OpenRouter — API key
    • ChatGPT — headless browser
    • Anthropic — API key

    Personal

    • OpenRouter — API key

    That way, the model picker would only show the providers/models available for the currently selected environment. It would avoid long labels with too many properties, while still making it clear which account, credentials, or auth method are being used.

    Not sure what the maintainers prefer from a data-model/UI perspective, but from a user point of view the key thing is visibility: when selecting a model, it should be obvious which environment and provider connection it belongs to.

    Visual Example:

    Image
    Reacted by Joel Drapper
  21. rekram1-node commented on Jun 23, 2026

    @rekram1-node
    rekram1-node
    on Jun 23, 2026
    Member
    More actions

    Automated: closing question issues.

    GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.

    • For help & questions: https://discord.gg/opencode
    • Billing issues with Opencode Go / Zen: [email protected]

    If this is a bug or feature request, please open a new issue with the appropriate template.

    Reacted by Erik O'Leary, Von, Marc Cerutti, Wolfgang Moser, Genex36 and Hubert Pietrusiak
  22. rekram1-node
    closed this as not plannedon Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @thdxr
    thdxr

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.