ChatGPT OAuth Login
Instead of using an OpenAI API key, you can log in with your ChatGPT account via OAuth. This uses OpenAI’s Codex backend at chatgpt.com.
Login Methods
Section titled “Login Methods”Running fermi oauth first asks which service to log in to — OpenAI (ChatGPT) or GitHub Copilot. Choose OpenAI (ChatGPT) for the Codex backend described here. Fermi then offers two login methods:
Browser Login (PKCE) — Recommended
Section titled “Browser Login (PKCE) — Recommended”Opens your default browser for one-click authentication. Best for local development.
fermi oauth# Select "OpenAI (ChatGPT)", then "Browser"The flow:
- A local callback server starts on
http://localhost:1455. - Your browser opens the OpenAI authorization page.
- Log in with your ChatGPT account and authorize Fermi.
- The browser redirects back to the local server to complete the flow.
Device Code — Fallback
Section titled “Device Code — Fallback”For SSH or headless environments where a browser is not available.
fermi oauth# Select "OpenAI (ChatGPT)", then "Device Code"The flow:
- Fermi displays a URL and a code.
- Open the URL on any device and enter the code.
- Log in with your ChatGPT account.
- Fermi polls for completion and stores the token.
Token Storage
Section titled “Token Storage”OAuth tokens are saved to ~/.fermi/state/oauth.json. Access tokens are refreshed automatically when they expire (with a 2-minute early-refresh window).
Managing OAuth
Section titled “Managing OAuth”# Check login status (reports both OpenAI and Copilot)fermi oauth status
# Log out (prompts for which service to log out of)fermi oauth logoutUsing OAuth with the Init Wizard
Section titled “Using OAuth with the Init Wizard”When you run fermi init, one of the provider options is OpenAI (ChatGPT Login). Selecting it triggers the OAuth login flow. Fermi then stores an internal OAuth marker for that provider and resolves the actual access token from ~/.fermi/state/oauth.json, so no API-key env var is needed. If the provider is already configured, you can switch back to it later with /model.
Once authenticated, the following models become available:
- GPT-5.2 Codex
- GPT-5.3 Codex
- GPT-5.4
- GPT-5.4 Mini
- GPT-5.5 (context capped at 400K vs 1M on the standard API)
Limitations
Section titled “Limitations”The ChatGPT OAuth backend has some differences from the standard OpenAI API:
- Requests are sent with
store: false(conversations are not stored on OpenAI’s side). - Native web search is not available through this endpoint.
- Availability depends on your ChatGPT subscription plan.