ccr codex-auth / ccr qwen-auth
Authentication commands for provider backends that require OAuth or JWT tokens.
ccr codex-auth
Authenticate with the Codex (ChatGPT) backend API via OpenAI OAuth with PKCE.
ccr codex-auth
How It Works
- The CLI generates a PKCE challenge and prints an authorization URL from
auth.openai.com - It starts a callback server on
http://localhost:1455/auth/callback - You open the URL in your browser and sign into your OpenAI / ChatGPT account
- OpenAI redirects to the callback server, which exchanges the authorization code for tokens
- Tokens are saved to
~/.claude-code-router/codex_auth.json - The
codextransformer reads the token and uses it for API requests - When the token nears expiry, it's refreshed automatically using the refresh token
Prerequisites
- A ChatGPT Plus or Pro subscription
ccr qwen-auth
Opens a browser-based auth page at http://localhost:3456/qwen/auth for token management.
ccr qwen-auth
How It Works
- The command tells you to open
http://localhost:3456/qwen/authin your browser (or you can navigate there directly) - On the auth page, use the bookmarklet (recommended) or paste a token manually:
- Bookmarklet: Drag "Get Qwen Token" to your bookmarks bar, open
chat.qwen.ai, and click it — the token is sent back automatically - Manual: Run
copy(localStorage.getItem('token'))inchat.qwen.aiDevTools Console, then paste on the auth page
- Bookmarklet: Drag "Get Qwen Token" to your bookmarks bar, open
- The token is validated against Qwen's API and saved to
~/.claude-code-router/qwen_auth.json - Automatic token rotation — expired tokens are detected on the next request
Prerequisites
- A Qwen Chat account and access to
qwen.aikit.club