Visitar URL original
[Bug] OpenRouter upstream for z-ai/glm-5.3-flash returns reseller panel error as 200-OK assistant content (billed, no failover) · Issue #53968 · anomalyco/opencode · GitHub
Skip to content

[Bug] OpenRouter upstream for z-ai/glm-5.3-flash returns reseller panel error as 200-OK assistant content (billed, no failover) #53968

Description

@acaliebe

Description

Title:
[Bug] OpenRouter upstream for z-ai/glm-5.3-flash returns reseller panel error as 200-OK assistant content (billed, no failover)

Summary

While using openrouter/z-ai/glm-5.3-flash in opencode, the model's "answer" was literally the raw error message of an upstream reseller panel:

Your quota is exhausted.

API key status: exceeded
Name: VIP.aaa
USDT balance: -9.110032 USDT
USDT spent: 140.900032 USDT
exp_date: 2026-11-03T04:07:25.259Z

This was NOT an HTTP error: the request completed normally (finish reason stop), the text was stored and displayed as the assistant message, and the request was billed as a normal completion. OpenRouter's provider failover never triggered because the response looked like a successful 200-OK.

Evidence

  • opencode 1.18.34, provider openrouter, model z-ai/glm-5.3-flash
  • Session DB entry (2026-10-08 13:37 UTC): assistant message with finish: "stop", tokens input 150,819 / output 58, cost $0.02265185
  • My OpenRouter account is fine: key valid, no per-key limit, positive balance (verified via GET /api/v1/key)
  • Direct test call to openrouter.ai/api/v1/chat/completions with the same key works normally (routed to GMICloud)
  • The error text format (USDT balance, key name, exp_date) is a one-api/new-api style reseller panel — clearly neither OpenRouter nor Z.ai official

Root cause (assumed)

z-ai/glm-5.3-flash is served by ~30 upstream providers on OpenRouter. At least one of them appears to be a reseller whose own panel key ("VIP.aaa") ran out of USDT quota. Instead of returning an HTTP error (which would trigger OpenRouter failover), the panel returns the error text as a 200-OK completion, which OpenRouter passes through verbatim and bills.

Compounding problem: parroting

Once this text is in the conversation context, GLM-5.3-flash tends to echo it verbatim in subsequent turns — several assistant replies consisted solely of the error text. This makes it look like a persistent quota problem on the user's side, which it is not.

Related

Suggestions

  1. OpenRouter: consider scanning 200-OK completions for known panel-error patterns (or require upstreams to error properly) and fail over / not bill such responses.
  2. Users: check openrouter.ai/activity to identify the provider that served the request and pin/exclude it via provider routing.
  3. opencode: maybe worth flagging assistant messages that consist entirely of known upstream error patterns?

Happy to provide the generation ID from the activity page if needed.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. opencode-agent commented on Oct 8, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed write-up, @acaliebe!

    You're on opencode 1.18.34, which is OpenCode v1. v1 now only gets fixes for critical bugs (data loss, security problems, or breakage with no workaround), so this is unlikely to be changed there.

    From your analysis, the bad response comes from an upstream reseller on OpenRouter. It returned its own quota error as a normal 200-OK completion, and OpenRouter passed it through and billed it. OpenCode only showed what it received. Your suggestion to flag replies that look like upstream errors is a feature idea, not a v1 fix. In the meantime:

    • Report the generation ID to OpenRouter so they can deal with that upstream (refunds and failover are on their side).
    • Use OpenRouter provider routing to exclude that provider, or pin a known-good one such as GMICloud.
    • Start a fresh session, or remove the affected messages, so GLM stops repeating the error text from its context.

    We recommend moving to OpenCode v2 (npm package @opencode/cli), which is where active development happens. If this also happens on v2, or you think it is critical, please reply here.

    Related (cited by you): #24492, #28129: upstream provider accounts out of balance, which reached users as proper HTTP errors.

  2. opencode-agent commented on Oct 9, 2026

    @opencode-agent
    Contributor

    Closing this as not planned. It was reported on opencode 1.18.34 (v1), which only gets fixes for critical bugs. The faulty reply came from an upstream reseller on OpenRouter, and you can avoid it by excluding that provider through OpenRouter provider routing.

    Thanks again for the detailed report, @acaliebe. If you see the same thing on OpenCode v2 (@opencode/cli), please open a new issue with the v2 version and the OpenRouter generation ID, and link back to this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions