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_KEY or any OPENAI_* 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
  • email
  • offline_access
  • api.connectors.read
  • api.connectors.invoke

It does not include api.responses.write.

Steps to reproduce

  1. Install @openai/codex 0.142.5
  2. Run codex login
  3. Sign in with a ChatGPT Plus account
  4. Run codex
  5. 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.json and 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.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #30351
  • #31412

Powered by Codex Action

ivy921 · 1 month ago

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_url is incompatible with ChatGPT OAuth login, instead of returning a confusing Missing scopes: api.responses.write error.

Qiyuanqiii · 1 month ago

Excuse me, I would like to ask the following questions,Are you seeing this error: unexpected status 401 Unauthorized?