Skip to content

fix(ai): the OpenRouter fallback was a premium paid model - #135

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/free-first-fallback
Aug 16, 2026
Merged

fix(ai): the OpenRouter fallback was a premium paid model#135
github-actions[bot] merged 1 commit into
mainfrom
fix/free-first-fallback

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

OPENROUTER_DEFAULT_MODEL was anthropic/claude-sonnet-5.

OpenRouter is the fallback here — reached when Groq's free tier is spent. So the failure mode of "the free tier ran out" was not a degraded answer or an honest refusal. It was a bill, on a premium model, produced by the one code path nobody watches because it only runs when something else has already broken.

A fallback is a reliability mechanism; paying is a business decision. Wiring the second to the first lets an outage make the decision, at the worst possible moment, without anyone choosing it. It also broke the standing fleet rule that Anthropic is never a primary or fallback provider.

Now openai/gpt-oss-20b:freepricing.prompt = 0 in OpenRouter's own catalogue (checked 2026-08-16), probed live for tool support 2026-08-15.

Guarded, because the path is invisible

A test now pins that the default ends in :free and is never an Anthropic id. The rule mirrors modelCost in the shared ai-ration package: a routed id is free only with the :free suffix — the entire difference between free routing and a per-call charge for identical weights.

The same mistake was found in three apps on the same day (also kivvi and evig), which is why the rule now lives in a shared package rather than in three review comments.

🤖 Generated with Claude Code

OPENROUTER_DEFAULT_MODEL was `anthropic/claude-sonnet-5`. OpenRouter is the
FALLBACK here — it is reached when Groq's free tier is spent — so the failure
mode of 'the free tier ran out' was not a degraded answer or an honest refusal.
It was a bill, on a premium model, produced by the one code path nobody watches
because it only runs when something else has already broken.

A fallback is a reliability mechanism; paying is a business decision. Wiring the
second to the first lets an outage make the decision at the worst moment,
without anyone choosing it. It also broke the standing fleet rule that Anthropic
is never a primary or fallback provider.

Now `openai/gpt-oss-20b:free`, which reports pricing.prompt = 0 in OpenRouter's
own catalogue (checked 2026-08-16) and was probed live for tool support on
2026-08-15.

Guarded by a test, because this path is invisible in normal operation: the
default must end in `:free` and must never be an Anthropic id. The rule mirrors
`modelCost` in the shared ai-ration package — a routed id is free ONLY with the
`:free` suffix, which is the entire difference between free routing and a
per-call charge for identical weights.

The same mistake was found in three apps on the same day (also kivvi and evig).
@github-actions
github-actions Bot merged commit ce5c668 into main Aug 16, 2026
2 checks passed
@github-actions
github-actions Bot deleted the fix/free-first-fallback branch August 16, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant