Files
heidi/app/api/example
CatoandClaude Opus 5.5 667aa64845 fix(ai): word examples run on the learner's own key only (#118)
/api/example was fired as a side effect of tapping keep: the learner asked
to save a word, and a second, unasked model call went to the free tier every
app on the box shares. Standing rule (2026-09-25): free-tier keys are spent
only when a person deliberately asks.

The route no longer builds the free chain; without a BYOK key it returns no
examples (the card shows the source sentence, as before the feature), and
the keep button no longer posts without a key.

Regression test app/api/example/route.test.ts, proven by mutation: re-adding
the freeChain import, dropping the no-key guard, or dropping the client skip
each fails it.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 23:49:49 -07:00
..