The Codex token is needed to display ChatGPT usage quotas in the dashboard.
- Open ChatGPT in your browser: https://chatgpt.com
- Login to your account
- Open DevTools:
- Chrome/Edge:
F12orCmd+Option+I(Mac) /Ctrl+Shift+I(Windows/Linux) - Firefox:
F12orCmd+Option+K(Mac) /Ctrl+Shift+K(Windows/Linux)
- Chrome/Edge:
- Go to Network tab
- Reload the page (
F5orCmd+R) - Filter by "usage" in the Network tab search box
- Find the request to
backend-api/wham/usage - Click on it and go to Headers tab
- Look for "Authorization" in Request Headers
- Copy the token - it looks like:
Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik1UaEVOVUpHTkVNMVFURTRNMEZCTWpk...
If the Authorization header is not visible:
- Open DevTools → Application tab (Chrome) or Storage tab (Firefox)
- Go to Cookies →
https://chatgpt.com - Find cookie named:
__Secure-next-auth.session-token - Copy its Value
Once you have the token:
# Save to config (no need to pass it every time)
bun run dev --config set-codex-token --token <your-token>
# Verify it's saved
bun run dev --config show
# Now dashboard will use it automatically
bun run dev --dashboard- JWT tokens (Authorization header): Start with
eyJ... - Session tokens (cookie): Various formats, often start with
sess-or similar
⚠️ Never share your token - it gives full access to your ChatGPT account⚠️ Token is stored in plaintext at~/.config/opencode-usage/config.json- 🔄 Tokens expire - you may need to refresh it periodically
- 🗑️ To remove:
rm ~/.config/opencode-usage/config.json
Token not working?
- Make sure you copied the full token (can be very long)
- Remove
Bearerprefix if present (only the token itself) - Token may have expired - get a fresh one
- Try logging out and back into ChatGPT
Can't find the usage endpoint?
- Make sure you're on chatgpt.com (not chat.openai.com)
- Try navigating to https://chatgpt.com/codex/settings/usage
- Reload the page and check Network tab again
Dashboard shows "error" for Codex?
- Check token with
--config show - Verify token format is correct
- Get a fresh token from browser