Commit ea9407e
committed
feat(ai): offer Claude Opus 5 on OpenRouter (BYOK) + 1M-context caps
Gateway (LevelCode Cloud) users get Opus 5 from the server roster with no editor
release — that side is thin.ly. This is the BYOK half: the OpenRouter picker, the
local caps table, and the sketch cost meter.
- providers/index.js — a picker row for `anthropic/claude-opus-5`. Placed second,
under the flagship, since it is the frontier pick most people reach for.
- providers/catalog.js — an explicit CAPS row, for the same reason Kimi K3 has one:
the `claude-` heuristic reports 200K, so a 1M window would drive the in-run
context meter to cry "full" at a fifth of the real budget.
- sketch/pricing.js — Opus 5 ties Opus 4.8's $5/$25, which the `claude-opus` family
fallback already produced. The FAST variant does NOT: it is $10/$50, and the
fallback was quietly pricing it at half. Both are pinned now, so the meter is
honest whichever slug a BYOK user types.
- sketch.js — MODEL_TIERS openrouter.powerful moves 4.8 → 5. Same price, newer
model. It also fixes a latent wart: the old id was never in the OpenRouter
registry, so a per-node model override naming it failed validation and silently
fell back. Revert this one line if you'd rather pin the tier to 4.8.
Prices/context confirmed against the OpenRouter models API (2026-07-24):
$5/M in · $25/M out · $0.50/M cached · 1M ctx (fast variant: $10/$50).
Verified at runtime, not just in tests: the row renders in the picker, caps
resolve to 1,000,000, tools/vision on, and isAnthropicFamily matches so explicit
prompt-cache breakpoints are sent. Full gate green (24 suites).1 parent 7ba72f1 commit ea9407e
7 files changed
Lines changed: 24 additions & 3 deletions
File tree
- extensions/levelcode-ai
- providers
- sketch
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
0 commit comments