Effortlessly manage and switch between multiple Codex accounts — never run out of credits again.
Codex Hub is a lightweight VS Code extension that lets you store multiple OpenAI Codex accounts and switch between them with a single click. No more logging in and out manually.
✨ Features
Multi-Account Storage — Securely store unlimited Codex accounts locally using VS Code's built-in globalState.
One-Click Switching — Inject any stored account into auth.json and reload to activate instantly.
Automatic Token Refresh — Expired access tokens are automatically refreshed via the OpenAI Auth0 endpoint before switching.
Bulk Refresh — Refresh all stored account tokens at once with a single button press.
Active Account Indicator — Clearly see which account is currently active with a visual badge.
Smart Add Account Flow — Leverages the official Codex extension's login flow; just click "Add Account", log in, and the new account is captured automatically.
Account Removal Protection — Cannot delete the currently active account; a warning is shown instead.
Full Theme Support — Seamlessly integrates with Light, Dark, and High Contrast VS Code themes.
Keyboard Accessible — Navigate accounts with arrow keys, manage modals with Escape/Enter/Tab.
📋 Requirements
VS Code 1.120.0 or later
Codex extension (openai.chatgpt) must be installed — Codex Hub uses its login flow.
🚀 Getting Started
Install the Codex Hub extension.
Click the Codex Hub icon in the Activity Bar (sidebar).
Click Add Account — this will clear the current auth and reload VS Code.
Log in via the official Codex login screen.
Your account is automatically captured and stored.
Repeat for additional accounts.
Switch between accounts at any time!
🔧 How It Works
Codex Hub does not perform OAuth itself. Instead, it:
Reads the auth.json file that the official Codex extension (codex.exe) creates.
Stores a copy of each account's auth data in VS Code's globalState.
When switching, writes the target account's data back into auth.json and reloads.
Token refresh is performed directly via https://auth.openai.com/oauth/token using the stored refresh_token.
📦 Commands
Command
Description
Codex Hub: Add Account
Start the add-account flow
Codex Hub: Refresh All Accounts
Refresh tokens for all stored accounts
⚠️ Known Limitations
The extension requires the official Codex extension for login — it cannot authenticate independently.
After switching accounts, a window reload is required for the change to take effect.
Real-time rate limit information (messages remaining) is not available without codex.exe.
🔒 Security
All tokens are stored locally in VS Code's globalState — they never leave your machine.
No telemetry, analytics, or external data transmission.
The only external request is to auth.openai.com for token refresh (same endpoint Codex uses).