English | 简体中文 | 繁體中文 | 日本語 | 한국어 | हिन्दी | Tiếng Việt | Français | Русский | Español | Português | Norsk | Svenska | Deutsch | Nederlands | Italiano
GAC supports authentication via ChatGPT OAuth, allowing you to use your ChatGPT subscription to access OpenAI's Codex API instead of paying for OpenAI API keys separately. This mirrors the same OAuth flow used by OpenAI's Codex CLI.
⚠️ Heads up — unsanctioned use: This uses the same OAuth flow as OpenAI's Codex CLI, and while it currently works, OpenAI may restrict third-party token usage at any time. GAC is small enough that it has flown under the radar so far, but using ChatGPT OAuth here is not officially sanctioned for third-party tools and could stop working at any time. If you need reliable commit-message generation, use a direct API provider (openai, etc.) instead. See OpenAI's Codex documentation for the current policy.
ChatGPT OAuth lets you leverage your existing ChatGPT Plus or Pro subscription to access the Codex API for generating commit messages. Instead of managing API keys and per-token billing, you authenticate once via your browser and GAC handles the token lifecycle automatically.
- Cost effective: Use your existing ChatGPT Plus/Pro subscription instead of paying separately for API access
- Same models: Access Codex-optimized models (
gpt-5.5,gpt-5.4,gpt-5.3-codex) - No API key management: Browser-based OAuth means no API keys to rotate or store
- Separate billing: ChatGPT OAuth usage is separate from direct OpenAI API billing
GAC includes built-in OAuth authentication for ChatGPT. The setup process is fully automated and will open your browser for authentication.
When running uvx gac init, simply select "ChatGPT OAuth" as your provider:
uvx gac initThe wizard will:
- Ask you to select "ChatGPT OAuth" from the provider list
- Automatically open your browser for OAuth authentication
- Save your access token to
~/.gac/oauth/chatgpt-oauth.json - Set the default model
If you already have GAC configured with another provider and want to switch to ChatGPT OAuth:
uvx gac modelThen:
- Select "ChatGPT OAuth" from the provider list
- Your browser will open automatically for OAuth authentication
- Token saved to
~/.gac/oauth/chatgpt-oauth.json - Model configured automatically
Once authenticated, use GAC as usual:
# Stage your changes
git add .
# Generate and commit with ChatGPT OAuth
uvx gac
# Or override the model for a single commit
uvx gac -m chatgpt-oauth:gpt-5.4ChatGPT OAuth provides access to Codex-optimized models. Current models include:
gpt-5.5— Latest and most capable Codex modelgpt-5.4— Previous generation Codex modelgpt-5.3-codex— Third generation Codex model
Check the OpenAI documentation for the full list of available models.
GAC provides dedicated CLI commands for ChatGPT OAuth management:
Authenticate or re-authenticate with ChatGPT OAuth:
uvx gac auth chatgpt loginYour browser will open automatically to complete the OAuth flow. If you're already authenticated, this will refresh your tokens.
Remove stored ChatGPT OAuth tokens:
uvx gac auth chatgpt logoutThis deletes the stored token file at ~/.gac/oauth/chatgpt-oauth.json.
Check your current ChatGPT OAuth authentication status:
uvx gac auth chatgpt statusOr check all providers at once:
uvx gac authIf you see authentication errors, your token may have expired. Re-authenticate by running:
uvx gac auth chatgpt loginYour browser will open automatically for fresh OAuth authentication. GAC automatically uses refresh tokens to renew access without re-authentication when possible.
To check if you're currently authenticated:
uvx gac auth chatgpt statusOr check all providers at once:
uvx gac authTo remove your stored token:
uvx gac auth chatgpt logoutThis means GAC can't find your access token. Authenticate by running:
uvx gac modelThen select "ChatGPT OAuth" from the provider list. The OAuth flow will start automatically.
If OAuth authentication fails:
- Make sure you have an active ChatGPT Plus or Pro subscription
- Check that your browser opens correctly
- Try a different browser if issues persist
- Verify network connectivity to
auth.openai.com - Check that ports 1455-1465 are available for the local callback server
The OAuth callback server tries ports 1455-1465 automatically. If all ports are occupied:
# On macOS/Linux:
lsof -ti:1455-1465 | xargs kill -9
# On Windows (PowerShell):
Get-NetTCPConnection -LocalPort 1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }Then re-run uvx gac auth chatgpt login.
| Feature | OpenAI (openai:) |
ChatGPT OAuth (chatgpt-oauth:) |
|---|---|---|
| Authentication | API Key (OPENAI_API_KEY) |
OAuth (automated browser flow) |
| Billing | Per-token API billing | Subscription-based (ChatGPT Plus/Pro) |
| Setup | Manual API key entry | Automatic OAuth via uvx gac init or uvx gac model |
| Token Management | Long-lived API keys | OAuth tokens (auto-refresh using refresh tokens) |
| Models | All OpenAI models | Codex-optimized models |
- Never commit your access token to version control
- GAC stores OAuth tokens in
~/.gac/oauth/chatgpt-oauth.json(outside your project directory) - OAuth flow uses PKCE (Proof Key for Code Exchange) for enhanced security
- Local callback server runs on localhost only (ports 1455-1465)
- Refresh tokens are used to automatically renew access without re-authentication