You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenRouter returns "OpenAI is temporarily unavailable" error #26469
I'm also experiencing the same issue, and it's important to note that this bug seems to effect more than just the OpenRouter GLM-5.2 model; The same issue occurred when I tried OpenRouter Gemini 3.5 Flash, some Qwen models, etc.
@dannykopping My guess is that the bug is in the github.com/openai/openai-go/v3 SDK, but specifically in a fork maintained at github.com/kylecarbs/openai-go/v3, it is being used by a replace directive in go.mod .
The problematic code is in packages/ssestream/ssestream.go:72-78 of that fork. The decoder's Next() method dispatches an event for every empty line it encounters, even when no data: fields were collected. This means comment-only SSE blocks (like : OPENROUTER PROCESSING\n\n) produce empty events that fail JSON unmarshaling.
The Anthropic SDK (github.com/coder/anthropic-sdk-go) has an identical decoder implementation but is less likely to be hit by this bug in practice since it uses an explicit switch on known event types rather than attempting to unmarshal everything.
We'd appreciate that @kasyap1234! We have an engineer scheduled to work on this from next week, but if you're able to look at it sooner we'd welcome the contribution.
changed the title [-]bug: unable to use glm-5.2 via openrouter with ai gateway[/-][+]OpenRouter returns "OpenAI is temporarily unavailable" error[/+]on Aug 19, 2026
Activity
linear-code commentedon Jun 17, 2026
ENG-2935
raphaelbahat commentedon Jun 18, 2026
I'm also experiencing the same issue, and it's important to note that this bug seems to effect more than just the OpenRouter GLM-5.2 model; The same issue occurred when I tried OpenRouter Gemini 3.5 Flash, some Qwen models, etc.
raphaelbahat commentedon Jun 23, 2026
Any updates?
dannykopping commentedon Jun 23, 2026
@raphaelbahat apologies for the radio silence. We will be looking into this soon!
kasyap1234 commentedon Jun 24, 2026
@dannykopping My guess is that the bug is in the github.com/openai/openai-go/v3 SDK, but specifically in a fork maintained at github.com/kylecarbs/openai-go/v3, it is being used by a replace directive in go.mod .
The problematic code is in packages/ssestream/ssestream.go:72-78 of that fork. The decoder's Next() method dispatches an event for every empty line it encounters, even when no data: fields were collected. This means comment-only SSE blocks (like : OPENROUTER PROCESSING\n\n) produce empty events that fail JSON unmarshaling.
The Anthropic SDK (github.com/coder/anthropic-sdk-go) has an identical decoder implementation but is less likely to be hit by this bug in practice since it uses an explicit switch on known event types rather than attempting to unmarshal everything.
dannykopping commentedon Jun 24, 2026
I believe you're right @kasyap1234
kasyap1234 commentedon Jun 24, 2026
@dannykopping I would like to fix this issue , if that is fine ?
dannykopping commentedon Jun 24, 2026
We'd appreciate that @kasyap1234! We have an engineer scheduled to work on this from next week, but if you're able to look at it sooner we'd welcome the contribution.
raphaelbahat commentedon Jul 8, 2026
Any updates?
dannykopping commentedon Jul 8, 2026
@raphaelbahat apologies, I wasn't tagged as a reviewer on the linked PR by @kasyap1234 (thank you for the PR!).
I will attend to it today.
chore: apply openai-go bugfix to fix openrouter response parsing (#27092
[-]bug: unable to use glm-5.2 via openrouter with ai gateway[/-][+]OpenRouter returns "OpenAI is temporarily unavailable" error[/+]