Skip to content

OpenAI Unauthorized - {\"detail\":\"Unauthorized\"}","isRetryable":false}} stream error #18843

@anyber11

Description

@anyber11

Description

I get an unauthorized request from the OpenAI service. The API returns a 401 after authentication is returned successful. I have the Plus subscription and not the API directly.

ERROR 2026-03-23T21:26:12 +552ms service=llm providerID=openai modelID=gpt-5.4-mini sessionID=ses_2e37698adffeX1NcMtkizyg75P small=false agent=build mode=primary error={"error":{"name":"AI_APICallError","url":"https://api.openai.com/v1/responses","requestBodyValues":{"model":"gpt-5.4-mini","input":[{"role":"user","content": ERROR 2026-03-23T21:26:12 +1ms service=session.processor error=Unauthorized stack="AI_APICallError: Unauthorized\n at <anonymous> (/$bunfs/root/src/cli/cmd/tui/worker.js:98891:30)\n at processTicksAndRejections (native:7:39)" process "responseBody":"{\"detail\":\"Unauthorized\"}","isRetryable":false}} stream error

Plugins

GSD (https://github.com/gsd-build/get-shit-done)

OpenCode version

1.3.0

Steps to reproduce

  1. opencode auth logout
  2. opencode auth login
    2.1 Select OpenAI (tried both browser and headless ways)
  3. Returns successful
  4. Still fails

Screenshot and/or share link

Image

Operating System

macOS

Terminal

Ghostty, tried iTerm as well with same behavior.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions