unexpected status 401 Unauthorized

Resolved 💬 2 comments Opened Apr 27, 2026 by coanor Closed Apr 27, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.125.0

What subscription do you have?

pro(100$)

Which model were you using?

5.4/5.5

What platform is your computer?

Darwin 23.6.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Ghostty

What issue are you seeing?

■ unexpected status 401 Unauthorized: You have insufficient permissions for this operation. Missing scopes: api.responses.write. Check that you have the correct role in your organiz
ation (Reader, Writer, Owner) and project (Member, Owner), and if you're using a restricted API key, that it has the necessary scopes., url: https://api.openai.com/v1/responses, cf-ray: 9f2a3241884b5f2b-SIN, request id: req_5da8e9df50dd47cb95f81eb2d9e80b13

What steps can reproduce the bug?

Uploaded thread: 019dcc58-bb7f-7b03-b82d-ed433f201b22

What is the expected behavior?

i have almost 60+% usage this week and almost full usage the 5h, should not got 401 error.

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 4 months ago

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

  • #17289

Powered by Codex Action

coanor · 4 months ago

it seems that codex has fucked my config.toml:

model_provider = "openai-http"
# ...
[model_providers.openai-http]
name = "OpenAI HTTP"
base_url = "https://api.openai.com/v1"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = false

my original requirement is to disable websocket, it always reconnect about 5 timeous when start new codex session and finally switched to HTTP.

after comment these configure, codex works as expected.