Use multiple OpenAI Codex accounts as separate OpenCode providers:
openai-personaldisplayed asOpenAI personalopenai-workdisplayed asOpenAI work
Each provider stores its own OAuth token in OpenCode auth storage, so model selection, favorites, recents, and account limits are separated by provider ID.
git clone https://github.com/chope/opencode-codex-switcher.git ~/.config/opencode/plugins/opencode-codex-switcher
cd ~/.config/opencode/plugins/opencode-codex-switcher
npm install && npm run buildRun these once to connect both accounts:
opencode auth login --provider openai-personal --method "OpenAI Codex (browser)"
opencode auth login --provider openai-work --method "OpenAI Codex (browser)"{
"plugin": [
["opencode-codex-switcher", {
"personal": { "id": "openai-main", "name": "OpenAI main" },
"work": { "id": "openai-client", "name": "OpenAI client" }
}]
]
}OpenCode does not currently expose a provider alias API, so the plugin clones OpenAI model metadata from models.dev into custom provider IDs. It keeps npm: "@ai-sdk/openai" so OpenCode still applies the official OpenAI provider transforms and reasoning variants.
The plugin respects OPENCODE_MODELS_URL when fetching model metadata.