Files
CatoandClaude Opus 5.5 02796b0195 feat(ai-key): check a pasted key with its vendor; pick from the models it can use (#114)
- ai-kit ^1.17.0; /api/ai-key/models uses @bitbaum/ai-kit/byok-probe instead
  of fetchCatalog, which said "works" for a dead OpenRouter key (its /models
  is public; only /key refuses)
- PUT and PATCH probe the key again before sealing and reject a model the key
  cannot use (lib/byok-check.ts); a dead key is never stored
- one admission rule, lib/byok-admit.ts, shared by the server and the
  browser-only path, so "Use this key" stays off until a check passed
- panel: paste -> auto-check (600ms) -> select of the key's models with the
  strongest preselected; free text only when the vendor lists none; the
  vendor's refusal in its own words; Change model / Replace key / Remove
- tests: unchecked, refused and unlisted keys rejected; routes vet before
  they write (each guard proven by mutation)
- docs: Ask moves to @bitbaum/chatkit once it is published

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 23:10:52 -07:00
..