@skyphusion/create-prism 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyphusion/create-prism",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "Scaffold a new prism deployment: a multimodal AI playground on Cloudflare Workers.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "author": "Conrad Rockenhaus",
@@ -8,6 +8,10 @@ redeploy.
8
8
 
9
9
  **Migration philosophy (read this first).** `schema.sql` is the canonical full schema for standing up a *fresh* database. It contains non-idempotent `ALTER TABLE` statements, so re-running it against a database that already has tables will raise `SQLITE_ERROR: duplicate column name` and, because `wrangler d1 execute --file` runs the whole file as one transaction, abort and roll back the entire run. **Never re-run `schema.sql` against an existing database.** To upgrade an existing deployment, apply only the delta for each version you're crossing, using the explicit commands below (or, for releases that ship one, the per-release `migrate-vX.Y.Z.sql` delta file). Apply each version's delta in order, then redeploy.
10
10
 
11
+ **Unreleased (cost per chat row, prism#258): one nullable column.** `chats.cost_usd REAL`, added by `migrations/0006_chat_cost.sql`. CI applies it before deploy. Self-hosters who do not use CI run `npx wrangler d1 migrations apply skyphusion-llm --remote` BEFORE deploying the new Worker; the Worker writes `cost_usd` on every chat insert, so a Worker deployed ahead of the column fails every chat write. Existing rows stay NULL (NULL means unknown, not zero). The figure is an estimate at the model's published list rate; see `src/pricing.ts` for its limits.
12
+
13
+ **Unreleased (funnel counters, prism#259): one nullable column and one table.** `users.first_output_at TEXT` and `funnel_daily`, added by `migrations/0007_funnel_counters.sql`. CI applies it before deploy. Self-hosters who do not use CI run `npx wrangler d1 migrations apply skyphusion-llm --remote` BEFORE deploying the new Worker: the Worker updates both on signup and on a first output. No data is back-filled. The operator reads the baseline with the queries in `docs/funnel-metrics.md`; there is no route.
14
+
11
15
  **v1.1.0 (account-scoped BYOK): BREAKING for existing BYOK users, no DDL.** `account_id` is a new key in the existing `user_prefs.prefs_json` blob. Every public-mode user saved before v1.1.0 (slug + token only) is refused with HTTP 412 `gateway_account_id_required` on every inference route until they add their 32-hex Cloudflare account ID under Account > AI Gateway, and their token must hold Workers AI Read as well as AI Gateway Run. A user who upgrades and does nothing loses inference. Tell your users before you tag. Access-mode installs using worker secrets are unaffected.
12
16
 
13
17
  v0.13.0 onward touched the D1 schema only at v0.20.0, v0.20.2, and v0.20.3; everything else in the v0.13.0 to v0.20.0 range is code-only. The pre-v0.13.0 migrations (v0.7.0 to v0.10.0) are below for anyone upgrading from very old deployments.
@@ -247,7 +247,7 @@ One Worker, no framework, no build step beyond TypeScript. The interesting parts
247
247
 
248
248
  **Web search (v0.17.0):** opt-in retrieval source that queries the `skyphusion-search` Worker (service binding `SEARCH`) and Wikipedia (reference and lore) in parallel. Snippets folded into the system prompt the same way RAG chunks are. Per-turn toggle. Without the `SEARCH` binding that source reports absent; Wikipedia needs no setup. See [Web search](#web-search) below.
249
249
 
250
- **Streaming (v0.13.0+):** `POST /api/chat/stream` returns SSE for any chat model flagged `streaming: true` in the catalog. Token deltas surface as `{ type: "delta", text: "..." }` events, terminal completion as `{ type: "done", ... }` with token counts and conversation IDs. Client disconnect aborts the upstream model call immediately.
250
+ **Streaming (v0.13.0+):** `POST /api/chat/stream` returns SSE for any chat model flagged `streaming: true` in the catalog. Token deltas surface as `{ type: "delta", text: "..." }` events, terminal completion as `{ type: "done", ... }` with token counts, an estimated `cost_usd` (null when unknown; see [docs/cost-estimate.md](docs/cost-estimate.md)) and conversation IDs. Client disconnect aborts the upstream model call immediately.
251
251
 
252
252
  **Multi-turn conversations:** `conversation_id` plus `turn_index` on chat rows. Continuing a conversation pulls prior completed chat turns and assembles them for the next call. Mixed-model conversations allowed (start with Llama, continue with Claude). Text-only on continuation; prior images, audio, and video are not re-sent.
253
253
 
@@ -1007,7 +1007,7 @@ Wire format:
1007
1007
  ```
1008
1008
  data: {"type":"delta","text":"..."}
1009
1009
  data: {"type":"done","row_id":N,"latency_ms":N,"tokens_in":N|null,
1010
- "tokens_out":N|null,"conversation_id":"...","turn_index":N}
1010
+ "tokens_out":N|null,"cost_usd":N|null,"conversation_id":"...","turn_index":N}
1011
1011
  ```
1012
1012
 
1013
1013
  Or, on error:
@@ -43,6 +43,13 @@ lose it, we have no way to email you a reset.
43
43
  - **Your control-plane client key, if you enter one:** the `pcp_` key that switches chat onto the
44
44
  Skyphusion-operated metered route (see "Metered chat through play-proxy" below). You only have one if
45
45
  Skyphusion Labs issued it to you.
46
+ - **When you first got an output:** one timestamp on your account record, set the first time a model
47
+ gives you a finished result. It lets the operator measure how long a new account takes to get its first
48
+ result. It is part of your account record, so deleting your account deletes it.
49
+ - **Anonymous daily counts:** the instance keeps one row per day with how many accounts were created, how
50
+ many got a first result, and how long that took in coarse buckets. The row has no account id, username,
51
+ IP address, model, or content, so it cannot be tied back to you and is not removed when you delete your
52
+ account. There is no third-party analytics in the path.
46
53
  - **Operational records** mechanically required to run the service: request and job state, and
47
54
  abuse-control counters (see "Abuse controls" below).
48
55
 
@@ -0,0 +1,22 @@
1
+ -- 0006: estimated cost per chat row (prism#258, Part of prism#251 Sprint 1).
2
+ --
3
+ -- WHY THIS IS A NUMBERED FILE IN migrations/: CI applies only migrations/ before
4
+ -- `wrangler deploy` (wrangler d1 migrations apply skyphusion-llm --remote). The
5
+ -- Worker now binds cost_usd in INSERT INTO chats. If this column shipped only as
6
+ -- a legacy migrate-v*.sql file, the deployed Worker would write to a column the
7
+ -- table does not have and every chat would fail to persist after the tokens were
8
+ -- spent. schema.sql carries the same column for fresh databases.
9
+ --
10
+ -- cost_usd is the ESTIMATED USD cost of one chat turn at the model's published
11
+ -- list rate (or, on the control-plane path, the plane's own charge). Display
12
+ -- only: it is never an input to a limit or a charge. REAL, nullable, NO default:
13
+ -- NULL means unknown (unpriced model, missing token count, non-chat or failed
14
+ -- row). NULL is not 0; 0 means a real zero rate. Existing rows stay NULL.
15
+ --
16
+ -- Not idempotent (SQLite has no ADD COLUMN IF NOT EXISTS); wrangler records the
17
+ -- file in d1_migrations and applies it once.
18
+ --
19
+ -- Apply to an existing database with:
20
+ -- npx wrangler d1 migrations apply skyphusion-llm --remote
21
+
22
+ ALTER TABLE chats ADD COLUMN cost_usd REAL;
@@ -0,0 +1,38 @@
1
+ -- 0007: funnel counters in D1 (prism#259, Part of prism#251 Sprint 1).
2
+ --
3
+ -- WHY THIS IS A NUMBERED FILE IN migrations/: CI applies only migrations/ before
4
+ -- deploy. The Worker now updates users.first_output_at and writes funnel_daily;
5
+ -- both must exist when the new Worker starts. schema.sql carries the same DDL
6
+ -- for fresh databases.
7
+ --
8
+ -- The epic needs a baseline and AGENTS.md forbids third-party telemetry, so the
9
+ -- counts live here. Two pieces, split on purpose (ernst S1-8):
10
+ --
11
+ -- users.first_output_at PER-ACCOUNT state, nullable. When this account first
12
+ -- got a finished output. It lives on the users row so
13
+ -- account deletion (src/auth.ts cascade) removes it
14
+ -- with the account. Set once, by
15
+ -- UPDATE ... WHERE first_output_at IS NULL.
16
+ --
17
+ -- funnel_daily DURABLE aggregates, one row per UTC day. NO account
18
+ -- id, no IP, no user agent, no model id, no
19
+ -- conversation id, no text. It survives account
20
+ -- deletion because it names no one.
21
+ --
22
+ -- Counts include bots until the signup bot check lands (Sprint 2). Access-mode
23
+ -- installs have no signups to count.
24
+
25
+ ALTER TABLE users ADD COLUMN first_output_at TEXT;
26
+
27
+ CREATE TABLE IF NOT EXISTS funnel_daily (
28
+ day TEXT PRIMARY KEY, -- UTC date, YYYY-MM-DD
29
+ signups INTEGER NOT NULL DEFAULT 0, -- accounts created that day
30
+ first_outputs INTEGER NOT NULL DEFAULT 0, -- accounts that got their first output that day
31
+ -- Time from signup to first output, for the first_outputs of that day.
32
+ -- The five buckets sum to first_outputs.
33
+ ttfo_lt_1m INTEGER NOT NULL DEFAULT 0, -- under 60 s
34
+ ttfo_1_5m INTEGER NOT NULL DEFAULT 0, -- 60 s up to 5 min
35
+ ttfo_5_30m INTEGER NOT NULL DEFAULT 0, -- 5 up to 30 min
36
+ ttfo_30m_24h INTEGER NOT NULL DEFAULT 0, -- 30 min up to 24 h
37
+ ttfo_ge_24h INTEGER NOT NULL DEFAULT 0 -- 24 h or more
38
+ );
@@ -44,7 +44,11 @@ CREATE TABLE IF NOT EXISTS chats (
44
44
  -- turn_index is monotonically increasing within a conversation.
45
45
  -- For backward compat, legacy rows are backfilled as conversation_id='legacy-<id>', turn_index=0.
46
46
  conversation_id TEXT,
47
- turn_index INTEGER
47
+ turn_index INTEGER,
48
+ -- prism#258: estimated list-price cost of a chat turn, USD. NULL when unpriced
49
+ -- or not a done chat row (NULL is not 0). Display only. Existing databases get
50
+ -- it from migrations/0006_chat_cost.sql.
51
+ cost_usd REAL
48
52
  );
49
53
 
50
54
  CREATE INDEX IF NOT EXISTS idx_chats_conversation
@@ -281,7 +285,11 @@ CREATE TABLE IF NOT EXISTS users (
281
285
  username_lc TEXT NOT NULL UNIQUE,
282
286
  password_hash TEXT NOT NULL,
283
287
  email TEXT,
284
- created_at TEXT NOT NULL DEFAULT (datetime('now'))
288
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
289
+ -- prism#259: when this account first got a finished output. Per-account, so it
290
+ -- lives on this row and account deletion removes it. Set once. Existing
291
+ -- databases get it from migrations/0007_funnel_counters.sql.
292
+ first_output_at TEXT
285
293
  );
286
294
 
287
295
  CREATE TABLE IF NOT EXISTS sessions (
@@ -304,6 +312,23 @@ CREATE TABLE IF NOT EXISTS auth_attempts (
304
312
  -- the code. The prune filters window_start; index it, exactly as
305
313
  -- idx_csp_reports_received does for the other prune-on-write table.
306
314
  CREATE INDEX IF NOT EXISTS idx_auth_attempts_window ON auth_attempts(window_start);
315
+
316
+ -- ---------- Funnel counters (prism#259) ----------
317
+ --
318
+ -- Durable daily aggregates for the signup-to-first-output baseline. One row per
319
+ -- UTC day. NO account id, IP, user agent, model id, conversation id or text, so
320
+ -- it survives account deletion because it names no one. Counts include bots
321
+ -- until the signup bot check lands. See docs/funnel-metrics.md.
322
+ CREATE TABLE IF NOT EXISTS funnel_daily (
323
+ day TEXT PRIMARY KEY,
324
+ signups INTEGER NOT NULL DEFAULT 0,
325
+ first_outputs INTEGER NOT NULL DEFAULT 0,
326
+ ttfo_lt_1m INTEGER NOT NULL DEFAULT 0,
327
+ ttfo_1_5m INTEGER NOT NULL DEFAULT 0,
328
+ ttfo_5_30m INTEGER NOT NULL DEFAULT 0,
329
+ ttfo_30m_24h INTEGER NOT NULL DEFAULT 0,
330
+ ttfo_ge_24h INTEGER NOT NULL DEFAULT 0
331
+ );
307
332
  -- 0004: CSP violation collector (fleet-chezmoi#1646).
308
333
  --
309
334
  -- Two tables, and the split is the point. `csp_report_buckets` is a rate-limit
@@ -28,6 +28,7 @@ import {
28
28
  parseSessionCookie,
29
29
  } from "./session";
30
30
  import { checkRateLimit, resetRateLimit } from "./rate-limit";
31
+ import { recordSignup } from "./funnel";
31
32
 
32
33
  export type AuthMode = "public" | "access";
33
34
 
@@ -163,6 +164,9 @@ export async function handleSignup(request: Request, env: Env): Promise<Response
163
164
  .bind(id, username, usernameLc, passwordHash)
164
165
  .run();
165
166
 
167
+ // prism#259: counted only after the INSERT succeeded; a counter error never fails signup.
168
+ await recordSignup(env);
169
+
166
170
  const token = await createSession(env.DB, id);
167
171
  return json(
168
172
  { user: { username } },
@@ -7,6 +7,7 @@
7
7
  // Contract: skyphusion-labs/prism-control-plane docs/CONTRACT.md
8
8
 
9
9
  import type { Env } from "./env";
10
+ import { planeCostUsd } from "./pricing";
10
11
  import type { UserPrefsJson } from "./user-prefs";
11
12
 
12
13
  export const DEFAULT_CONTROL_PLANE_URL = "https://play-proxy.skyphusion.org";
@@ -107,6 +108,11 @@ export interface ControlPlaneChatResult {
107
108
  model: string;
108
109
  usage: { prompt_tokens: number | null; completion_tokens: number | null };
109
110
  requestId: string | null;
111
+ /**
112
+ * What the plane charged, USD, from prism-usage-micro-usd when prism-metered is
113
+ * true. Null otherwise (prism#258). Never a catalog price.
114
+ */
115
+ costUsd: number | null;
110
116
  raw: unknown;
111
117
  }
112
118
 
@@ -189,6 +195,7 @@ export async function controlPlaneChat(
189
195
  completion_tokens: intOrNull(usageRaw?.completion_tokens ?? usageRaw?.output_tokens),
190
196
  },
191
197
  requestId,
198
+ costUsd: planeCostUsd(res.headers),
192
199
  raw: body,
193
200
  };
194
201
  }
@@ -0,0 +1,96 @@
1
+ // Funnel counters (prism#259, Part of prism#251 Sprint 1).
2
+ //
3
+ // First-party counts in D1, no third-party telemetry. Signup, first output, and
4
+ // the time between them. See docs/funnel-metrics.md for the operator query.
5
+ //
6
+ // Privacy shape (ernst S1-8):
7
+ // - Per-account state is one nullable column on the users row
8
+ // (users.first_output_at). Account deletion removes the row, so it removes
9
+ // this with it.
10
+ // - The durable numbers are funnel_daily: one row per UTC day, no account id,
11
+ // IP, user agent, model id, conversation id or text.
12
+ //
13
+ // Integrity (ernst S1-9):
14
+ // - A signup is counted only after the users INSERT succeeded.
15
+ // - First output is set once, by UPDATE ... WHERE first_output_at IS NULL, and
16
+ // the daily counter moves only when that UPDATE changed a row. So a second
17
+ // output, a retry or a race cannot count twice.
18
+ // - A counter error NEVER fails a signup or a chat: every entry point catches
19
+ // and logs counts only (no id, no text).
20
+ //
21
+ // Access mode (AUTH_MODE=access) has no users rows, so there is nothing to count
22
+ // and these are no-ops there.
23
+
24
+ import type { Env } from "./env";
25
+
26
+ type Bucket = "ttfo_lt_1m" | "ttfo_1_5m" | "ttfo_5_30m" | "ttfo_30m_24h" | "ttfo_ge_24h";
27
+
28
+ /** Bucket for a signup-to-first-output time in seconds. Negative (clock skew) counts as 0. */
29
+ export function ttfoBucket(seconds: number): Bucket {
30
+ const s = Number.isFinite(seconds) && seconds > 0 ? seconds : 0;
31
+ if (s < 60) return "ttfo_lt_1m";
32
+ if (s < 300) return "ttfo_1_5m";
33
+ if (s < 1800) return "ttfo_5_30m";
34
+ if (s < 86400) return "ttfo_30m_24h";
35
+ return "ttfo_ge_24h";
36
+ }
37
+
38
+ // SQLite datetime('now') form: "YYYY-MM-DD HH:MM:SS", UTC.
39
+ function sqliteUtcToMs(s: string): number {
40
+ return Date.parse(`${s.replace(" ", "T")}Z`);
41
+ }
42
+
43
+ function logCounterError(which: string, err: unknown): void {
44
+ // Counts and a reason class only: never an account id, username or text.
45
+ const reason = err instanceof Error ? err.name : "unknown";
46
+ console.warn(`funnel counter ${which} failed (${reason})`);
47
+ }
48
+
49
+ /** Count one signup. Call only AFTER the users INSERT succeeded. Never throws. */
50
+ export async function recordSignup(env: Env): Promise<void> {
51
+ try {
52
+ await env.DB.prepare(
53
+ `INSERT INTO funnel_daily (day, signups) VALUES (date('now'), 1)
54
+ ON CONFLICT(day) DO UPDATE SET signups = signups + 1`,
55
+ ).run();
56
+ } catch (err) {
57
+ logCounterError("signup", err);
58
+ }
59
+ }
60
+
61
+ // Column names come from ttfoBucket's closed set, never from input.
62
+ const BUCKET_SQL: Record<Bucket, string> = {
63
+ ttfo_lt_1m: `INSERT INTO funnel_daily (day, first_outputs, ttfo_lt_1m) VALUES (date('now'), 1, 1)
64
+ ON CONFLICT(day) DO UPDATE SET first_outputs = first_outputs + 1, ttfo_lt_1m = ttfo_lt_1m + 1`,
65
+ ttfo_1_5m: `INSERT INTO funnel_daily (day, first_outputs, ttfo_1_5m) VALUES (date('now'), 1, 1)
66
+ ON CONFLICT(day) DO UPDATE SET first_outputs = first_outputs + 1, ttfo_1_5m = ttfo_1_5m + 1`,
67
+ ttfo_5_30m: `INSERT INTO funnel_daily (day, first_outputs, ttfo_5_30m) VALUES (date('now'), 1, 1)
68
+ ON CONFLICT(day) DO UPDATE SET first_outputs = first_outputs + 1, ttfo_5_30m = ttfo_5_30m + 1`,
69
+ ttfo_30m_24h: `INSERT INTO funnel_daily (day, first_outputs, ttfo_30m_24h) VALUES (date('now'), 1, 1)
70
+ ON CONFLICT(day) DO UPDATE SET first_outputs = first_outputs + 1, ttfo_30m_24h = ttfo_30m_24h + 1`,
71
+ ttfo_ge_24h: `INSERT INTO funnel_daily (day, first_outputs, ttfo_ge_24h) VALUES (date('now'), 1, 1)
72
+ ON CONFLICT(day) DO UPDATE SET first_outputs = first_outputs + 1, ttfo_ge_24h = ttfo_ge_24h + 1`,
73
+ };
74
+
75
+ /**
76
+ * Record the account's first finished output, once. Call only for a row
77
+ * persisted as done. The daily counter moves only if this call is the one that
78
+ * set users.first_output_at. No users row (access mode) means no change and no
79
+ * count. Never throws.
80
+ */
81
+ export async function recordFirstOutput(env: Env, userId: string): Promise<void> {
82
+ try {
83
+ const set = await env.DB.prepare(
84
+ `UPDATE users SET first_output_at = datetime('now')
85
+ WHERE id = ? AND first_output_at IS NULL
86
+ RETURNING created_at, first_output_at`,
87
+ )
88
+ .bind(userId)
89
+ .first<{ created_at: string; first_output_at: string }>();
90
+ if (!set) return; // already counted, or no such account
91
+ const seconds = (sqliteUtcToMs(set.first_output_at) - sqliteUtcToMs(set.created_at)) / 1000;
92
+ await env.DB.prepare(BUCKET_SQL[ttfoBucket(seconds)]).run();
93
+ } catch (err) {
94
+ logCounterError("first_output", err);
95
+ }
96
+ }
@@ -21,6 +21,8 @@
21
21
  // stream parser handles it (Anthropic, xAI, OpenAI, Google, Workers AI
22
22
  // are all covered)
23
23
 
24
+ import { px, TIER_200K, TIER_512K, TIER_UNSTATED, type ModelPricing } from "./pricing";
25
+
24
26
  // "voice" = conversational/streaming STT (a live WebSocket session, not a
25
27
  // one-shot request like "stt"); handled out of /api/chat via /api/stt/stream.
26
28
  export type ModelType = "chat" | "image" | "tts" | "video" | "stt" | "music" | "voice";
@@ -77,6 +79,10 @@ export interface ModelEntry {
77
79
  // max_output_tokens }) for models that only ship that format (gpt-5.6-*,
78
80
  // gpt-5.5-pro). See src/providers/openai.ts.
79
81
  api?: "responses";
82
+ // prism#258: chat only. Integer micro-USD per 1M tokens, read from the model's
83
+ // Cloudflare page on pricing.priced_at. Absent = unpriced = cost_usd null.
84
+ // An ESTIMATE for display; see src/pricing.ts for its limits.
85
+ pricing?: ModelPricing;
80
86
  }
81
87
 
82
88
  export const MODELS: ModelEntry[] = [
@@ -93,31 +99,31 @@ export const MODELS: ModelEntry[] = [
93
99
  // the dotted CF form (anthropic/claude-opus-5.5), so they need binding: true
94
100
  // (the binding path passes the full CF id; the legacy path strips the prefix
95
101
  // and sends Anthropic's native name).
96
- { id: "anthropic/claude-fable-5.2", label: "Claude Fable 5.2 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
97
- { id: "anthropic/claude-opus-5.5", label: "Claude Opus 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
98
- { id: "anthropic/claude-sonnet-5.5", label: "Claude Sonnet 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
99
- { id: "anthropic/claude-haiku-5.5", label: "Claude Haiku 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
100
- { id: "anthropic/claude-fable-5", label: "Claude Fable 5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
101
- { id: "anthropic/claude-sonnet-5", label: "Claude Sonnet 5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true },
102
+ { id: "anthropic/claude-fable-5.2", label: "Claude Fable 5.2 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true, pricing: px(8000000, 40000000) },
103
+ { id: "anthropic/claude-opus-5.5", label: "Claude Opus 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true, pricing: px(4000000, 20000000) },
104
+ { id: "anthropic/claude-sonnet-5.5", label: "Claude Sonnet 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true, pricing: px(2000000, 10000000) },
105
+ { id: "anthropic/claude-haiku-5.5", label: "Claude Haiku 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true, pricing: px(100000, 500000, TIER_UNSTATED) },
106
+ { id: "anthropic/claude-fable-5", label: "Claude Fable 5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true, pricing: px(10000000, 50000000) },
107
+ { id: "anthropic/claude-sonnet-5", label: "Claude Sonnet 5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, pricing: px(2000000, 10000000) },
102
108
  // v0.170.0: Claude Opus 5 (near-Fable intelligence, lower price). New CF
103
109
  // Unified Billing onboarding; binding path required (legacy allowlist frozen).
104
- { id: "anthropic/claude-opus-5", label: "Claude Opus 5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
105
- { id: "anthropic/claude-opus-4-8", label: "Claude Opus 4.8 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true },
106
- { id: "anthropic/claude-opus-4-7", label: "Claude Opus 4.7 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true },
107
- { id: "anthropic/claude-opus-4-6", label: "Claude Opus 4.6 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true },
108
- { id: "anthropic/claude-sonnet-4-6", label: "Claude Sonnet 4.6 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true },
109
- { id: "anthropic/claude-haiku-4-5", label: "Claude Haiku 4.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true },
110
+ { id: "anthropic/claude-opus-5", label: "Claude Opus 5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true, pricing: px(5000000, 25000000) },
111
+ { id: "anthropic/claude-opus-4-8", label: "Claude Opus 4.8 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, pricing: px(5000000, 25000000) },
112
+ { id: "anthropic/claude-opus-4-7", label: "Claude Opus 4.7 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, pricing: px(5000000, 25000000) },
113
+ { id: "anthropic/claude-opus-4-6", label: "Claude Opus 4.6 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, pricing: px(5000000, 25000000) },
114
+ { id: "anthropic/claude-sonnet-4-6", label: "Claude Sonnet 4.6 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, pricing: px(3000000, 15000000) },
115
+ { id: "anthropic/claude-haiku-4-5", label: "Claude Haiku 4.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, pricing: px(1000000, 5000000) },
110
116
 
111
117
  // xAI / Grok (Unified Billing via cf-aig-authorization, routed through AI Gateway)
112
118
  // v0.170.0: grok-4.5 re-added via env.AI.run binding (binding: true). CF docs
113
119
  // now list it on the Unified Billing catalog with working env.AI.run examples;
114
120
  // legacy gateway allowlist remains frozen for new ids.
115
121
  // 2026-12 refresh: grok-4.7 (Chat Completions on the CF catalog); binding path, as grok-4.5.
116
- { id: "xai/grok-4.7", label: "Grok 4.7 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, binding: true },
117
- { id: "xai/grok-4.5", label: "Grok 4.5 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, binding: true },
118
- { id: "xai/grok-4.3", label: "Grok 4.3 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true },
119
- { id: "xai/grok-4.20-multi-agent-0309", label: "Grok 4.20 Multi-Agent (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true },
120
- { id: "xai/grok-4.20-0309-reasoning", label: "Grok 4.20 Reasoning (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true },
122
+ { id: "xai/grok-4.7", label: "Grok 4.7 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, binding: true, pricing: px(2000000, 6000000, TIER_200K) },
123
+ { id: "xai/grok-4.5", label: "Grok 4.5 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, binding: true, pricing: px(2000000, 6000000, TIER_200K) },
124
+ { id: "xai/grok-4.3", label: "Grok 4.3 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, pricing: px(1250000, 2500000) },
125
+ { id: "xai/grok-4.20-multi-agent-0309", label: "Grok 4.20 Multi-Agent (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, pricing: px(2000000, 6000000) },
126
+ { id: "xai/grok-4.20-0309-reasoning", label: "Grok 4.20 Reasoning (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, pricing: px(2000000, 6000000) },
121
127
  // blocked (v0.169.0): xai/grok-build-0.1 is absent from the new CF Unified
122
128
  // Billing catalog, and the legacy AI Gateway allowlist is frozen (forwards
123
129
  // unknown ids keyless -> provider 401). Re-add when
@@ -128,24 +134,24 @@ export const MODELS: ModelEntry[] = [
128
134
  // AI (@cf/moonshotai/*). Chat Completions via env.AI.run; stream reuses the
129
135
  // OpenAI-compatible SSE path (callOpenAIStream). Vision claimed upstream;
130
136
  // multimodal-in through the proxy is unsmoked, so caps stay empty like OpenAI.
131
- { id: "moonshotai/kimi-k3", label: "Kimi K3 (Moonshot, 1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "moonshotai", streaming: true },
132
- { id: "moonshotai/kimi-k3.1-pro", label: "Kimi K3.1 Pro (Moonshot, 1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "moonshotai", streaming: true },
137
+ { id: "moonshotai/kimi-k3", label: "Kimi K3 (Moonshot, 1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "moonshotai", streaming: true, pricing: px(3000000, 15000000) },
138
+ { id: "moonshotai/kimi-k3.1-pro", label: "Kimi K3.1 Pro (Moonshot, 1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "moonshotai", streaming: true, pricing: px(2000000, 10000000) },
133
139
  // 2026-12 refresh: more Chat Completions providers on OPENAI_COMPAT_CHAT_PROVIDERS.
134
140
  // Caps stay empty: multimodal-in through the proxy is unsmoked (K3 convention).
135
- { id: "alibaba/qwen3.8-max", label: "Qwen 3.8 Max (Alibaba)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "alibaba", streaming: true },
136
- { id: "deepseek/deepseek-v4-pro", label: "DeepSeek V4 Pro (DeepSeek)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "deepseek", streaming: true },
137
- { id: "minimax/m3", label: "MiniMax M3 (1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "minimax", streaming: true },
141
+ { id: "alibaba/qwen3.8-max", label: "Qwen 3.8 Max (Alibaba)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "alibaba", streaming: true, pricing: px(2000000, 6000000) },
142
+ { id: "deepseek/deepseek-v4-pro", label: "DeepSeek V4 Pro (DeepSeek)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "deepseek", streaming: true, pricing: px(1740000, 3480000) },
143
+ { id: "minimax/m3", label: "MiniMax M3 (1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "minimax", streaming: true, pricing: px(300000, 1200000, TIER_512K) },
138
144
  // 2026-12 refresh: Workers AI replacements CF recommends for the models it retired on
139
145
  // 2026-11-20 (HTTP 410, error 5028): deepseek-v4.1-flash and glm-5.3 for
140
146
  // frontier needs, qwen3.8-27b (and gemma-4, below) for smaller needs.
141
- { id: "@cf/deepseek-ai/deepseek-v4.1-flash-1017", label: "DeepSeek V4.1 Flash (1M ctx, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true },
142
- { id: "@cf/zai-org/glm-5.3", label: "GLM-5.3 (Z.AI, agentic coding)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], streaming: true },
143
- { id: "@cf/thinkingmachines/inkling-2-small", label: "Inkling 2 Small (Thinking Machines, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true },
144
- { id: "@cf/openai/gpt-oss-120b", label: "GPT-OSS 120B (reasoning)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], streaming: true },
145
- { id: "@cf/meta/llama-4-scout-17b-16e-instruct", label: "Llama 4 Scout (MoE, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true },
146
- { id: "@cf/google/gemma-4-26b-a4b-it", label: "Gemma 4 26B (vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true },
147
+ { id: "@cf/deepseek-ai/deepseek-v4.1-flash-1017", label: "DeepSeek V4.1 Flash (1M ctx, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true, pricing: px(300000, 1200000) },
148
+ { id: "@cf/zai-org/glm-5.3", label: "GLM-5.3 (Z.AI, agentic coding)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], streaming: true, pricing: px(1400000, 4400000) },
149
+ { id: "@cf/thinkingmachines/inkling-2-small", label: "Inkling 2 Small (Thinking Machines, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true, pricing: px(300000, 1000000) },
150
+ { id: "@cf/openai/gpt-oss-120b", label: "GPT-OSS 120B (reasoning)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], streaming: true, pricing: px(350000, 750000) },
151
+ { id: "@cf/meta/llama-4-scout-17b-16e-instruct", label: "Llama 4 Scout (MoE, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true, pricing: px(270000, 850000) },
152
+ { id: "@cf/google/gemma-4-26b-a4b-it", label: "Gemma 4 26B (vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true, pricing: px(100000, 300000) },
147
153
  // OpenAI open weights
148
- { id: "@cf/openai/gpt-oss-20b", label: "GPT-OSS 20B", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], streaming: true },
154
+ { id: "@cf/openai/gpt-oss-20b", label: "GPT-OSS 20B", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], streaming: true, pricing: px(200000, 300000) },
149
155
  // OpenAI proxied via AI Gateway unified billing (v0.21.0; streaming added
150
156
  // v0.21.1). Routed through env.AI.run("openai/<model>", { messages }) on the
151
157
  // generic chat path; extractOutput handles both the chat-completions
@@ -155,50 +161,50 @@ export const MODELS: ModelEntry[] = [
155
161
  // against gpt-5.5 in v0.21.1, including token-usage on the final frame.
156
162
  // capabilities is empty: multimodal-in through the proxied binding is
157
163
  // unverified, so the attach affordance stays off.
158
- { id: "openai/gpt-5.5", label: "GPT-5.5 (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
164
+ { id: "openai/gpt-5.5", label: "GPT-5.5 (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, pricing: px(5000000, 30000000) },
159
165
  // 2026-12 refresh: GPT-6 generation. The CF pages list Chat Completions and Responses,
160
166
  // so the default Chat Completions path applies (no api flag).
161
- { id: "openai/gpt-6.2-astra", label: "GPT-6.2 Astra (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
162
- { id: "openai/gpt-6.2-sol", label: "GPT-6.2 Sol (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
163
- { id: "openai/gpt-6.1-terra", label: "GPT-6.1 Terra (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
164
- { id: "openai/gpt-6-luna", label: "GPT-6 Luna (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
167
+ { id: "openai/gpt-6.2-astra", label: "GPT-6.2 Astra (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, pricing: px(8000000, 40000000, TIER_UNSTATED) },
168
+ { id: "openai/gpt-6.2-sol", label: "GPT-6.2 Sol (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, pricing: px(2000000, 10000000, TIER_UNSTATED) },
169
+ { id: "openai/gpt-6.1-terra", label: "GPT-6.1 Terra (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, pricing: px(1000000, 5000000, TIER_UNSTATED) },
170
+ { id: "openai/gpt-6-luna", label: "GPT-6 Luna (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, pricing: px(100000, 500000, TIER_UNSTATED) },
165
171
  // v0.173.0: Responses API only (not Chat Completions). Flagged api:"responses".
166
- { id: "openai/gpt-5.5-pro", label: "GPT-5.5 Pro (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses" },
167
- { id: "openai/gpt-5.6-sol", label: "GPT-5.6 Sol (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses" },
168
- { id: "openai/gpt-5.6-terra", label: "GPT-5.6 Terra (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses" },
169
- { id: "openai/gpt-5.6-luna", label: "GPT-5.6 Luna (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses" },
170
- { id: "openai/gpt-5.4", label: "GPT-5.4 (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
171
- { id: "openai/gpt-5.4-mini", label: "GPT-5.4 mini (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
172
- { id: "openai/o4-mini", label: "o4-mini (OpenAI, reasoning)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
172
+ { id: "openai/gpt-5.5-pro", label: "GPT-5.5 Pro (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses", pricing: px(30000000, 180000000) },
173
+ { id: "openai/gpt-5.6-sol", label: "GPT-5.6 Sol (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses", pricing: px(5000000, 30000000, TIER_UNSTATED) },
174
+ { id: "openai/gpt-5.6-terra", label: "GPT-5.6 Terra (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses", pricing: px(2000000, 12000000, TIER_UNSTATED) },
175
+ { id: "openai/gpt-5.6-luna", label: "GPT-5.6 Luna (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses", pricing: px(200000, 1200000, TIER_UNSTATED) },
176
+ { id: "openai/gpt-5.4", label: "GPT-5.4 (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, pricing: px(2500000, 15000000) },
177
+ { id: "openai/gpt-5.4-mini", label: "GPT-5.4 mini (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, pricing: px(750000, 4500000) },
178
+ { id: "openai/o4-mini", label: "o4-mini (OpenAI, reasoning)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, pricing: px(1100000, 4400000) },
173
179
  // Meta
174
- { id: "@cf/meta/llama-3.3-70b-instruct-fp8-fast", label: "Llama 3.3 70B (fp8)", group: "Chat \u00b7 Meta", type: "chat", capabilities: [], streaming: true },
175
- { id: "@cf/meta/llama-3.2-11b-vision-instruct", label: "Llama 3.2 11B (vision)", group: "Chat \u00b7 Meta", type: "chat", capabilities: ["vision"], streaming: true },
180
+ { id: "@cf/meta/llama-3.3-70b-instruct-fp8-fast", label: "Llama 3.3 70B (fp8)", group: "Chat \u00b7 Meta", type: "chat", capabilities: [], streaming: true, pricing: px(293000, 2253000) },
181
+ { id: "@cf/meta/llama-3.2-11b-vision-instruct", label: "Llama 3.2 11B (vision)", group: "Chat \u00b7 Meta", type: "chat", capabilities: ["vision"], streaming: true, pricing: px(48500, 676000) },
176
182
  // Qwen
177
- { id: "@cf/qwen/qwen2.5-coder-32b-instruct", label: "Qwen2.5 Coder 32B", group: "Chat \u00b7 Qwen", type: "chat", capabilities: [], streaming: true },
178
- { id: "@cf/qwen/qwen3.8-27b", label: "Qwen 3.8 27B (vision)", group: "Chat \u00b7 Qwen", type: "chat", capabilities: ["vision"], streaming: true },
183
+ { id: "@cf/qwen/qwen2.5-coder-32b-instruct", label: "Qwen2.5 Coder 32B", group: "Chat \u00b7 Qwen", type: "chat", capabilities: [], streaming: true, pricing: px(660000, 1000000) },
184
+ { id: "@cf/qwen/qwen3.8-27b", label: "Qwen 3.8 27B (vision)", group: "Chat \u00b7 Qwen", type: "chat", capabilities: ["vision"], streaming: true, pricing: px(450000, 3200000) },
179
185
  // Other
180
- { id: "@cf/mistralai/mistral-small-3.1-24b-instruct", label: "Mistral Small 3.1 (vision)", group: "Chat \u00b7 Other", type: "chat", capabilities: ["vision"], streaming: true },
181
- { id: "@cf/zai-org/glm-4.7-flash", label: "GLM-4.7 Flash (Z.AI, 100+ lang)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
182
- { id: "@cf/aisingapore/gemma-sea-lion-v4-27b-it", label: "SEA-LION v4 27B (SE Asian langs)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
186
+ { id: "@cf/mistralai/mistral-small-3.1-24b-instruct", label: "Mistral Small 3.1 (vision)", group: "Chat \u00b7 Other", type: "chat", capabilities: ["vision"], streaming: true, pricing: px(351000, 555000) },
187
+ { id: "@cf/zai-org/glm-4.7-flash", label: "GLM-4.7 Flash (Z.AI, 100+ lang)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true, pricing: px(60500, 400000) },
188
+ { id: "@cf/aisingapore/gemma-sea-lion-v4-27b-it", label: "SEA-LION v4 27B (SE Asian langs)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true, pricing: px(351000, 555000) },
183
189
  // Gemini proxied via Unified Billing (v0.21.3; streaming v0.21.4). NOT
184
190
  // OpenAI-shaped: native contents/candidates format, transformed by
185
191
  // src/providers/google.ts. Streaming via callGeminiStream +
186
192
  // interpretGeminiSSEFrame, with a dual-mode delta reconciler (handles
187
193
  // incremental or cumulative chunks). Text-only (multimodal vision deferred).
188
- { id: "google/gemini-3.1-pro", label: "Gemini 3.1 Pro (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
189
- { id: "google/gemini-3.5-flash", label: "Gemini 3.5 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
194
+ { id: "google/gemini-3.1-pro", label: "Gemini 3.1 Pro (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true, pricing: px(2000000, 12000000, TIER_200K) },
195
+ { id: "google/gemini-3.5-flash", label: "Gemini 3.5 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true, pricing: px(1500000, 9000000) },
190
196
  // v0.170.0: newer Flash tier; same Generate Content / google dispatcher path.
191
- { id: "google/gemini-3.6-flash", label: "Gemini 3.6 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
197
+ { id: "google/gemini-3.6-flash", label: "Gemini 3.6 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true, pricing: px(1500000, 7500000) },
192
198
  // 2026-12 refresh: same native contents/candidates shape as 3.6 (verified on the CF
193
199
  // model pages), so the google dispatcher covers them.
194
- { id: "google/gemini-3.8-flash", label: "Gemini 3.8 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
195
- { id: "google/gemini-4-argon", label: "Gemini 4 Argon (Google, frontier)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
196
- { id: "google/gemini-4-carbon", label: "Gemini 4 Carbon (Google, reasoning)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
197
- { id: "google/gemini-4-neon", label: "Gemini 4 Neon (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
198
- { id: "google/gemini-4-hydrogen", label: "Gemini 4 Hydrogen (Google, fast)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
200
+ { id: "google/gemini-3.8-flash", label: "Gemini 3.8 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true, pricing: px(750000, 3750000) },
201
+ { id: "google/gemini-4-argon", label: "Gemini 4 Argon (Google, frontier)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true, pricing: px(4000000, 20000000) },
202
+ { id: "google/gemini-4-carbon", label: "Gemini 4 Carbon (Google, reasoning)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true, pricing: px(4000000, 20000000) },
203
+ { id: "google/gemini-4-neon", label: "Gemini 4 Neon (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true, pricing: px(3000000, 15000000) },
204
+ { id: "google/gemini-4-hydrogen", label: "Gemini 4 Hydrogen (Google, fast)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true, pricing: px(1500000, 7500000) },
199
205
  // @cf/google/gemma-3-12b-it removed v0.165.0: marked Deprecated on the
200
206
  // Workers AI model list; gemma-4-26b-a4b-it (above) is the current Gemma.
201
- { id: "@cf/ibm-granite/granite-4.0-h-micro", label: "Granite 4.0 Micro (IBM)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
207
+ { id: "@cf/ibm-granite/granite-4.0-h-micro", label: "Granite 4.0 Micro (IBM)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true, pricing: px(17000, 112000) },
202
208
  // @hf/nousresearch/hermes-2-pro-mistral-7b removed v0.165.0: marked
203
209
  // Deprecated (and Beta) on the Workers AI model list.
204
210