OpenCode bug: ChatGPT token-sharing logins hit 401 INVALID_API_KEY while same token works on direct API calls

laravelgeek · ghdev · 2026-10-13

OpenCode 2.0.26/2.0.27 on Windows fails all requests to openai/gpt-6.1-sol with HTTP 401 INVALIDAPIKEY when authenticated via ChatGPT token sharing, failing within 1 second with no output. The same access token returns 200 when POSTed directly to api.openai.com/v1/responses outside OpenCode, proving the token is valid. Signing out and back in doesn't help, and debug logs hide the outbound URL, pointing to an endpoint or auth-header construction issue in OpenCode. The reporter rules out the earlier Codex routing bug (#34765).

Original post →

More from coding & agent

coding & agent channel →