ChatGPT login token missing api.responses.write scope
Resolved 💬 3 comments Opened Jul 8, 2026 by ivy921 Closed Jul 8, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
Environment
- Codex CLI: 0.142.5
- OS: Ubuntu
- ChatGPT Plus
- Personal organization
- Organization Owner
- Default project
Authentication
- Logged in using ChatGPT (
codex login status) - No
OPENAI_API_KEYor anyOPENAI_*environment variables - Installed from the official npm package
@openai/codex
Problem
After logging in with ChatGPT successfully, every prompt fails with:
401 Unauthorized
Missing scopes: api.responses.write
The access token only contains these scopes:
- openid
- profile
- offline_access
- api.connectors.read
- api.connectors.invoke
It does not include api.responses.write.
Steps to reproduce
- Install
@openai/codex0.142.5 - Run
codex login - Sign in with a ChatGPT Plus account
- Run
codex - Enter any prompt (for example:
Hello)
Expected behavior
ChatGPT login should authorize Codex CLI to use the Responses API.
Actual behavior
Every prompt returns:
401 Unauthorized
Missing scopes: api.responses.write
Troubleshooting already performed
- Reinstalled Codex CLI from the official npm registry
- Logged out and logged in again
- Deleted
~/.codex/auth.jsonand logged in again - Confirmed there is no
OPENAI_API_KEY - Confirmed I am the Organization Owner of the Personal organization
If needed, I can provide the request ID from the error message or run additional diagnostics.
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I found the cause.
My ~/.codex/config.toml contained:
openai_base_url = "https://api.openai.com/v1"
After removing this line, logging in again, and restarting Codex, everything worked correctly.
It might be helpful if Codex warned users that overriding
openai_base_urlis incompatible with ChatGPT OAuth login, instead of returning a confusingMissing scopes: api.responses.writeerror.Excuse me, I would like to ask the following questions,Are you seeing this error: unexpected status 401 Unauthorized?