From 97cf277c893db3d71c6e87b22e400948380a09eb Mon Sep 17 00:00:00 2001 From: Cristhofer Pincetti Date: Fri, 4 Dec 2026 16:05:21 -0300 Subject: [PATCH 1/2] feat(catalog): source tiers, context and API-only models from the official pricing page Workit-Session: ses_dbdda4daaffexKPxS5Z9LKhpI2:ses_dbd93db0effeEfWTGgb4u7WLz9 --- docs/specs/2026-09-20-catalog-freshness.md | 26 +- scripts/sync-models.ts | 123 +- src/catalog.ts | 1 + src/costs-docs.ts | 299 +++++ src/schemas.ts | 3 + .../command-code/pricing-limits.html.txt | 1 + .../command-code/provider-models.json | 1004 +++++++++++++++++ tests/unit/costs-docs.test.ts | 212 +++- tests/unit/sync-models.test.ts | 76 +- 9 files changed, 1731 insertions(+), 14 deletions(-) create mode 100644 tests/fixtures/command-code/pricing-limits.html.txt create mode 100644 tests/fixtures/command-code/provider-models.json diff --git a/docs/specs/2026-09-20-catalog-freshness.md b/docs/specs/2026-09-20-catalog-freshness.md index 31d7299..74b0814 100644 --- a/docs/specs/2026-09-20-catalog-freshness.md +++ b/docs/specs/2026-09-20-catalog-freshness.md @@ -28,14 +28,14 @@ Provider-side resolution (2026-09-20): the availability filter shipped in `fix(c The public `GET https://api.commandcode.ai/provider/v1/models` response is the availability authority at synchronization time. The extractor output, which is metadata read from the Command Code CLI bundle only, remains the metadata authority for fields that the endpoint does not provide. -The publishable catalog is the exact-ID intersection of: +The publishable catalog is the union of: -- candidate entries produced from the selected Command Code CLI bundle; and -- IDs in the availability response's `data` array. +- the exact-ID intersection of candidate entries produced from the selected Command Code CLI bundle and IDs in the availability response's `data` array; and +- API-only entries: availability IDs with no CLI candidate that the official pricing page lists (see [Official pricing page](#official-pricing-page)). -Matching is case-sensitive and exact. Display names and suffixes must not be used to infer availability. +Availability matching is case-sensitive and exact. Display names and suffixes must not be used to infer availability; an API-only entry always carries the exact availability ID. -API-only IDs are not synthesized because they lack the required provider metadata. They enter the published catalog only after the extractor produces a matching candidate. +API-only entries are synthesized from the live availability item (ID, display name, `context_length`, `supported_endpoints`), the official pricing row (billed rates, context tiers, `contextWindow`, `caps.vision`, `caps.reasoning`, `category`) and models.dev metadata. They have no CLI-only fields (reasoning effort lists) and use a 65,536-token output cap bounded by the context window. Their IDs are listed, sorted, in `manifest.review.apiOnly` for maintainer review. An availability ID with neither a CLI candidate nor an official pricing row is not published. No model rows or API-only ID lists are hardcoded. An extracted model absent from the availability response is unavailable. It must: @@ -94,6 +94,18 @@ Cost and modality enrichment runs only for the filtered catalog. `manifest.model The unavailable list is sorted by ID so repeated synchronization is deterministic. +### Official pricing page + +`https://commandcode.ai/docs/resources/pricing-limits` embeds every model row (`id`, `name`, `category`, `contextWindow`, `caps`, `deal`, `tiers` or `contextTiers`) in its Next.js flight payload. Synchronization decodes the `self.__next_f.push` chunks and parses the `rows` array. + +- Rows join availability items by exact ID, then by the vendor-less ID ignoring case and punctuation (`Qwen/Qwen3.7-Max` ↔ `qwen-3.7-max`), then by display name. A key shared by two rows never matches. This join selects pricing data only; it never makes an ID available. +- `contextWindow` is the catalog context authority. The live `context_length` is a cross-check: a disagreement is reported as a warning in the run log and the GitHub step summary. +- Costs use the billed `rates` (deal prices), never `listRates`, including `cacheWrite` when present. The first band is the base cost; each later band becomes a context tier priced above the previous band's upper bound (`≤ 32K` then `≤ 256K` then `> 256K` gives tiers at 32,000 and 256,000 tokens). A band billed like the previous band adds no tier. +- For a model with an official row, official rates and tiers replace every other cost source, and models.dev context tiers are not applied. Models without an official row keep the existing waterfall (CLI, official table, free SKU, models.dev, models.dev tiers). +- Official cost rows are counted under `costSources.officialDocs`. + +If the page cannot be fetched or no `rows` array with at least two priced models parses, synchronization fails soft: it writes no generated artifact, exits zero, and appends a warning to the log and to `$GITHUB_STEP_SUMMARY`. The previous committed artifacts remain the published catalog. + ### Mutable OpenCode plugin packages OpenCode V2.0.18 loads a warm cached package at startup and does not silently replace it. An isolated local startup with a cached Command Code 0.9.1 package loaded 0.9.1 even though npm `latest` was 0.10.1. A clean cache does install the latest package. OpenCode's current V2 plugin documentation describes startup update checks without changing the installed package; the host's update action must be applied before a restart loads the new code. V1.18.30's `opencode plugin --global --force` explicitly refreshes a global package. @@ -136,6 +148,10 @@ This preserves deterministic startup and offline use. Freshness is delivered by - Static or dynamic Command Code hiding requires no special parser handling when the hidden ID is absent from the API. - An unavailable, malformed, empty, duplicate-ID, or below-floor response leaves all generated artifacts byte-for-byte unchanged and exits non-zero. - Cost, reasoning, and manifest counts are computed from the filtered catalog. +- The official pricing-page fixture parses every embedded row, and its rows join all 111 live IDs of the matching availability fixture. +- Official prices replace third-party tiers: `claude-sonnet-4-6` is flat 3/15 with no 200K tier, `gpt-5.5` is flat 5/30 with a 400K context, MiniMax M3 bills 0.3/1.2, and Qwen 3.7 Max has no 32K or 128K tier. +- Live IDs without a CLI candidate are synthesized from the official row (for example `subquadratic/subq-savant-1.4` with a 4,194,304-token context and the free `recursive/flint-v1.1:free` and `reflection/beam-contributor:free` at $0) and listed in `manifest.review.apiOnly`. +- An unparseable pricing page leaves generated artifacts unchanged, exits zero, and records a step-summary warning. - `bun run check` passes after generated artifacts are refreshed. ### OpenCode package refresh diff --git a/scripts/sync-models.ts b/scripts/sync-models.ts index 7a39efa..c745e56 100644 --- a/scripts/sync-models.ts +++ b/scripts/sync-models.ts @@ -1,4 +1,12 @@ -import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync, statSync } from "fs"; +import { + appendFileSync, + readFileSync, + writeFileSync, + existsSync, + mkdirSync, + rmSync, + statSync, +} from "fs"; import { join } from "path"; import { homedir, tmpdir } from "os"; import { execSync } from "child_process"; @@ -13,11 +21,23 @@ import { loadCatalogFromBundle, loadCatalogFromLocalCommandCode, parseAvailabilityModels, + sortModelEntries, type ModelEntry, type ProviderModelMetadata, } from "@/src/catalog.js"; import { ModelEntrySchema } from "@/src/schemas.js"; -import { applyDocCosts, fetchOfficialModelsMarkdown, parseModelsTable } from "@/src/costs-docs.js"; +import { + OFFICIAL_PRICING_URL, + applyDocCosts, + applyOfficialPricing, + fetchOfficialModelsMarkdown, + fetchOfficialPricingHtml, + matchOfficialRows, + parseModelsTable, + parseOfficialPricingRows, + synthesizeApiOnlyEntries, + type OfficialModelRow, +} from "@/src/costs-docs.js"; import { applyFreeCosts, applyModelsDevCosts, @@ -93,6 +113,7 @@ export function buildSyncArtifacts(input: { docIds: Set; thirdPartyIds: Set; freeIds: Set; + apiOnlyIds?: Set; generatedAt: string; }): SyncArtifacts { const { retained, unavailable } = filterCatalogByAvailability( @@ -148,6 +169,14 @@ export function buildSyncArtifacts(input: { ), generatedAt: input.generatedAt, }); + const retainedIds = new Set(retained.map((e) => e.id)); + const apiOnly = [...(input.apiOnlyIds ?? [])].filter((id) => retainedIds.has(id)).sort(); + if (apiOnly.length > 0) { + manifest.review = { + ...(manifest.review ?? { thirdParty: [], free: [], unmatched: [] }), + apiOnly, + }; + } if ( input.priorManifest && isDeepStrictEqual(models, input.priorModels) && @@ -158,6 +187,47 @@ export function buildSyncArtifacts(input: { return { models, version: input.version, manifest }; } +export type OfficialPricingResult = + | { ok: true; rows: OfficialModelRow[] } + | { ok: false; warning: string }; + +/** + * Parse the official pricing page. A missing or unparseable page is a soft + * failure: the caller keeps the previous artifacts and reports the warning. + */ +export function resolveOfficialPricing(html: string): OfficialPricingResult { + const rows = html ? parseOfficialPricingRows(html) : []; + if (rows.length > 0) return { ok: true, rows }; + return { + ok: false, + warning: `Official pricing page ${OFFICIAL_PRICING_URL} returned no parseable model rows; kept the previous models.json and manifest.json.`, + }; +} + +/** Append a warning to the GitHub Actions step summary when one is available. */ +export function appendStepSummaryWarning( + warning: string, + summaryPath: string | undefined = process.env.GITHUB_STEP_SUMMARY, +): void { + console.warn(`WARNING: ${warning}`); + if (!summaryPath) return; + appendFileSync(summaryPath, `> [!WARNING]\n> ${warning}\n\n`, "utf-8"); +} + +/** Live context windows that disagree with the official catalog context. */ +export function contextMismatches( + models: ModelEntry[], + liveModels: ProviderModelMetadata[], +): string[] { + const live = new Map(liveModels.map((model) => [model.id, model.context_length] as const)); + return models.flatMap((model) => { + const length = live.get(model.id); + return length !== undefined && length !== model.limit.context + ? [`${model.id} (catalog ${model.limit.context}, live ${length})`] + : []; + }); +} + function cliCostIds(source: string): Set { try { return new Set(buildCostMap(extractCostData(source)).keys()); @@ -289,6 +359,14 @@ async function main() { } console.log(` Callable models: ${availableIds.length}`); + console.log("Fetching official pricing page..."); + const official = resolveOfficialPricing(await fetchOfficialPricingHtml()); + if (!official.ok) { + appendStepSummaryWarning(official.warning); + return; + } + console.log(` Official model rows: ${official.rows.length}`); + let version: string; let sourceLabel: string; let bundleSource: string | null = null; @@ -328,9 +406,21 @@ async function main() { `filtered model count ${prefiltered.retained.length} below floor (lastSuccessful=${last}); leaving generated artifacts unchanged`, ); } - const entries = prefiltered.retained; + const officialMatches = matchOfficialRows(vendorModels, official.rows); + const synthesized = synthesizeApiOnlyEntries({ + liveModels: vendorModels, + candidateIds: new Set(prefiltered.retained.map((e) => e.id)), + matches: officialMatches, + }); + const apiOnlyIds = new Set(synthesized.entries.map((e) => e.id)); + console.log( + ` Synthesized ${apiOnlyIds.size} API-only models from the official pricing page` + + (synthesized.skipped.length ? ` (skipped ${synthesized.skipped.join(", ")})` : ""), + ); + const entries = sortModelEntries([...prefiltered.retained, ...synthesized.entries]); - const cliIds = bundleSource ? cliCostIds(bundleSource) : new Set(); + const bundleCliIds = bundleSource ? cliCostIds(bundleSource) : new Set(); + const cliIds = new Set([...bundleCliIds].filter((id) => !apiOnlyIds.has(id))); const docIds = new Set(); const docsMd = await fetchOfficialModelsMarkdown(); if (docsMd) { @@ -359,12 +449,32 @@ async function main() { const message = err instanceof Error ? err.message : String(err); console.log(` models.dev fill skipped: ${message}`); } + // Official billed rates, tiers and context windows override every earlier + // cost source for the models the pricing page lists. + const officialIds = new Set(); + const officialFilled = applyOfficialPricing(entries, officialMatches, officialIds); + console.log(` Applied official pricing-page rates and context to ${officialFilled} models`); + for (const id of officialIds) { + cliIds.delete(id); + docIds.add(id); + thirdPartyIds.delete(id); + freeIds.delete(id); + } const modalityFilled = applyModelsDevModalities(entries, modelsDevRows); console.log(` Applied models.dev modalities to ${modalityFilled} models`); const metadataFilled = applyModelsDevMetadata(entries, modelsDevRows); console.log(` Applied models.dev metadata to ${metadataFilled} models`); - const tierFilled = applyModelsDevCostTiers(entries, modelsDevRows); - console.log(` Applied models.dev cost tiers to ${tierFilled} models`); + const tierFilled = applyModelsDevCostTiers( + entries.filter((e) => !officialIds.has(e.id)), + modelsDevRows, + ); + console.log(` Applied models.dev cost tiers to ${tierFilled} models without official rows`); + const mismatches = contextMismatches(entries, vendorModels); + if (mismatches.length > 0) { + appendStepSummaryWarning( + `Official context differs from live /models context_length: ${mismatches.join(", ")}`, + ); + } // Entries are already filtered above; buildSyncArtifacts re-validates the // floor and returns every generated payload before the first write. @@ -382,6 +492,7 @@ async function main() { docIds, thirdPartyIds, freeIds, + apiOnlyIds, generatedAt: new Date().toISOString(), }); diff --git a/src/catalog.ts b/src/catalog.ts index 27b8590..659ad21 100644 --- a/src/catalog.ts +++ b/src/catalog.ts @@ -917,6 +917,7 @@ export const MODELS_API_URL = "https://api.commandcode.ai/provider/v1/models"; export type ProviderModelMetadata = { id: string; + name?: string; context_length?: number; supported_endpoints?: string[]; }; diff --git a/src/costs-docs.ts b/src/costs-docs.ts index 3a02b91..62ca230 100644 --- a/src/costs-docs.ts +++ b/src/costs-docs.ts @@ -160,6 +160,305 @@ export function applyDocCosts( return filled; } +export const OFFICIAL_PRICING_URL = "https://commandcode.ai/docs/resources/pricing-limits"; + +export type OfficialRates = { + input: number; + output: number; + cache_read?: number; + cache_write?: number; +}; + +export type OfficialTier = { context?: string; rates: OfficialRates }; + +/** One model object embedded in the official pricing page (billed `rates`, never `listRates`). */ +export type OfficialModelRow = { + id: string; + name: string; + category?: string; + contextWindow?: number; + caps?: { text: boolean; vision: boolean; reasoning: boolean }; + free: boolean; + deprecated: boolean; + tiers: OfficialTier[]; +}; + +export type OfficialContextTier = OfficialRates & { tier: { type: "context"; size: number } }; + +/** Decode and join the Next.js flight chunks (`self.__next_f.push([1,"..."])`) of a page. */ +export function extractNextFlight(html: string): string { + const chunks: string[] = []; + for (const match of html.matchAll(/self\.__next_f\.push\(\[1,("(?:[^"\\]|\\.)*")\]\)/g)) { + try { + const chunk: unknown = JSON.parse(match[1]!); + if (typeof chunk === "string") chunks.push(chunk); + } catch { + // skip a malformed chunk; the rows check below decides if the page parsed + } + } + return chunks.join(""); +} + +/** Return the balanced `[...]` / `{...}` span starting at `start`, skipping JSON strings. */ +function balancedSpan(text: string, start: number): string | undefined { + let depth = 0; + for (let i = start; i < text.length; i++) { + const ch = text[i]; + if (ch === '"') { + for (i++; i < text.length && text[i] !== '"'; i++) { + if (text[i] === "\\") i++; + } + } else if (ch === "[" || ch === "{") { + depth++; + } else if (ch === "]" || ch === "}") { + depth--; + if (depth === 0) return text.slice(start, i + 1); + } + } + return undefined; +} + +const finite = (value: unknown): value is number => + typeof value === "number" && Number.isFinite(value); + +function parseRates(value: unknown): OfficialRates | undefined { + if (!value || typeof value !== "object") return undefined; + const raw = value as Record; + if (!finite(raw.input) || !finite(raw.output)) return undefined; + const rates: OfficialRates = { input: raw.input, output: raw.output }; + if (finite(raw.cacheRead)) rates.cache_read = raw.cacheRead; + if (finite(raw.cacheWrite)) rates.cache_write = raw.cacheWrite; + return rates; +} + +function parseOfficialRow(value: unknown): OfficialModelRow | undefined { + if (!value || typeof value !== "object") return undefined; + const raw = value as Record; + if (typeof raw.id !== "string" || !raw.id || typeof raw.name !== "string" || !raw.name) { + return undefined; + } + const rawTiers = Array.isArray(raw.tiers) + ? raw.tiers + : Array.isArray(raw.contextTiers) + ? raw.contextTiers + : []; + const tiers = rawTiers.flatMap((item: unknown): OfficialTier[] => { + if (!item || typeof item !== "object") return []; + const tier = item as Record; + const rates = parseRates(tier.rates); + if (!rates) return []; + return [typeof tier.context === "string" ? { context: tier.context, rates } : { rates }]; + }); + if (tiers.length === 0) return undefined; + const row: OfficialModelRow = { + id: raw.id, + name: raw.name, + free: (raw.deal as { free?: unknown } | undefined)?.free === true, + deprecated: raw.deprecated === true, + tiers, + }; + if (typeof raw.category === "string") row.category = raw.category; + if (Number.isInteger(raw.contextWindow) && (raw.contextWindow as number) > 0) { + row.contextWindow = raw.contextWindow as number; + } + const caps = raw.caps as Record | undefined; + if (caps && typeof caps === "object") { + row.caps = { + text: caps.text === true, + vision: caps.vision === true, + reasoning: caps.reasoning === true, + }; + } + return row; +} + +/** + * Parse the model rows embedded in the official pricing page. Returns [] when + * no embedded `rows` array with at least two priced models is found. + */ +export function parseOfficialPricingRows(html: string): OfficialModelRow[] { + for (const source of [extractNextFlight(html), html]) { + for (const match of source.matchAll(/"rows":\[/g)) { + const span = balancedSpan(source, match.index + '"rows":'.length); + if (!span) continue; + let items: unknown; + try { + items = JSON.parse(span); + } catch { + continue; + } + if (!Array.isArray(items)) continue; + const rows = items.flatMap((item) => parseOfficialRow(item) ?? []); + if (rows.length >= 2) return rows; + } + } + return []; +} + +/** Parse a tier context label such as `≤ 512K` or `> 272K` into a token boundary. */ +export function parseTierBoundary( + label: string | undefined, +): { op: "le" | "gt"; size: number } | undefined { + const match = label?.match(/^\s*(≤|<=|<|>|≥|>=)\s*([0-9]+(?:\.[0-9]+)?)\s*([KkMm])?\b/); + if (!match) return undefined; + const unit = match[3]?.toLowerCase(); + const size = Math.round(Number(match[2]) * (unit === "m" ? 1_000_000 : unit === "k" ? 1_000 : 1)); + if (!Number.isInteger(size) || size <= 0) return undefined; + return { op: match[1] === ">" || match[1] === "≥" || match[1] === ">=" ? "gt" : "le", size }; +} + +const sameRates = (a: OfficialRates, b: OfficialRates) => + a.input === b.input && + a.output === b.output && + a.cache_read === b.cache_read && + a.cache_write === b.cache_write; + +/** + * Map official bands to the catalog cost shape: the first band is the base + * cost; each later band becomes a context tier priced above the previous + * band's upper bound. Bands billed like the previous band add no tier. + */ +export function officialCost(row: OfficialModelRow): { + base: OfficialRates; + tiers: OfficialContextTier[]; +} { + const base = row.tiers[0]!.rates; + const tiers: OfficialContextTier[] = []; + let previous = base; + for (let i = 1; i < row.tiers.length; i++) { + const band = row.tiers[i]!; + const own = parseTierBoundary(band.context); + const prior = parseTierBoundary(row.tiers[i - 1]!.context); + const size = own?.op === "gt" ? own.size : prior?.op === "le" ? prior.size : undefined; + if (size === undefined || sameRates(band.rates, previous)) continue; + tiers.push({ ...band.rates, tier: { type: "context", size } }); + previous = band.rates; + } + return { base: { ...base }, tiers }; +} + +function officialKey(value: string): string { + const segment = value.slice(value.lastIndexOf("/") + 1); + return segment.toLowerCase().replace(/[^a-z0-9:]/g, ""); +} + +/** + * Match live provider models to official rows: exact id, then the + * vendor-less id ignoring case and punctuation (`Qwen/Qwen3.7-Max` ↔ + * `qwen-3.7-max`), then the display name. Ambiguous keys never match. + */ +export function matchOfficialRows( + models: Array<{ id: string; name?: string }>, + rows: OfficialModelRow[], +): Map { + const index = (key: (row: OfficialModelRow) => string) => { + const map = new Map(); + for (const row of rows) { + const k = key(row); + map.set(k, [...(map.get(k) ?? []), row]); + } + return map; + }; + const byId = index((row) => row.id.toLowerCase()); + const byKey = index((row) => officialKey(row.id)); + const byName = index((row) => officialKey(row.name)); + const matches = new Map(); + const used = new Set(); + const lookups: Array<(model: { id: string; name?: string }) => OfficialModelRow[] | undefined> = [ + (model) => byId.get(model.id.toLowerCase()), + (model) => byKey.get(officialKey(model.id)), + (model) => (model.name ? byName.get(officialKey(model.name)) : undefined), + ]; + for (const lookup of lookups) { + for (const model of models) { + if (matches.has(model.id)) continue; + const found = lookup(model); + if (found?.length !== 1 || used.has(found[0]!)) continue; + matches.set(model.id, found[0]!); + used.add(found[0]!); + } + } + return matches; +} + +/** + * Apply official billed rates, context tiers and context windows to matched + * models. Official tiers replace any earlier tier data, including a flat + * official price clearing a third-party long-context tier. + */ +export function applyOfficialPricing( + models: ModelEntry[], + matches: ReadonlyMap, + filledIds?: Set, +): number { + let filled = 0; + for (const model of models) { + const row = matches.get(model.id); + if (!row) continue; + const { base, tiers } = officialCost(row); + model.cost = { ...base, ...(tiers.length ? { tiers } : {}) }; + if (row.contextWindow !== undefined) model.limit.context = row.contextWindow; + filledIds?.add(model.id); + filled++; + } + return filled; +} + +/** Default output cap for synthesized rows, matching the CLI catalog default. */ +const SYNTHESIZED_OUTPUT_LIMIT = 65536; + +/** + * Build catalog entries for live provider models that have no CLI catalog + * candidate, from the live inventory plus the official pricing row. Models + * without an official row or any known context window are skipped. + */ +export function synthesizeApiOnlyEntries(input: { + liveModels: Array<{ + id: string; + name?: string; + context_length?: number; + supported_endpoints?: string[]; + }>; + candidateIds: ReadonlySet; + matches: ReadonlyMap; +}): { entries: ModelEntry[]; skipped: string[] } { + const entries: ModelEntry[] = []; + const skipped: string[] = []; + for (const live of input.liveModels) { + if (input.candidateIds.has(live.id)) continue; + const row = input.matches.get(live.id); + const context = row?.contextWindow ?? live.context_length; + if (!row || context === undefined) { + skipped.push(live.id); + continue; + } + const vision = row.caps?.vision === true; + const { base, tiers } = officialCost(row); + entries.push({ + id: live.id, + name: live.name ?? row.name, + tier: row.category === "premium" ? "premium" : "open-source", + reasoning: row.caps?.reasoning === true, + tool_call: true, + cost: { ...base, ...(tiers.length ? { tiers } : {}) }, + limit: { context, output: Math.min(context, SYNTHESIZED_OUTPUT_LIMIT) }, + ...(live.supported_endpoints ? { supported_endpoints: [...live.supported_endpoints] } : {}), + attachment: vision, + modalities: { input: vision ? ["text", "image"] : ["text"], output: ["text"] }, + }); + } + return { entries, skipped }; +} + +export async function fetchOfficialPricingHtml(): Promise { + try { + const resp = await fetch(OFFICIAL_PRICING_URL); + return resp.ok ? await resp.text() : ""; + } catch { + return ""; + } +} + export async function fetchOfficialModelsMarkdown(): Promise { const urls = [ "https://commandcode.ai/models", diff --git a/src/schemas.ts b/src/schemas.ts index 78b7eac..e741ff5 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -78,6 +78,8 @@ export const ManifestSchema = z.strictObject({ thirdParty: z.array(z.string()), free: z.array(z.string()), unmatched: z.array(z.string()), + /** Live provider IDs with no CLI candidate, synthesized from the official pricing page. */ + apiOnly: z.array(z.string()).optional(), unavailable: z .array( z.strictObject({ @@ -103,6 +105,7 @@ export const AvailabilityPayloadSchema = z .array( z.object({ id: z.string().min(1), + name: z.string().min(1).optional().catch(undefined), context_length: z.number().int().positive().optional().catch(undefined), supported_endpoints: z.array(z.string().min(1)).optional().catch(undefined), }), diff --git a/tests/fixtures/command-code/pricing-limits.html.txt b/tests/fixtures/command-code/pricing-limits.html.txt new file mode 100644 index 0000000..b730483 --- /dev/null +++ b/tests/fixtures/command-code/pricing-limits.html.txt @@ -0,0 +1 @@ +Pricing and limits diff --git a/tests/fixtures/command-code/provider-models.json b/tests/fixtures/command-code/provider-models.json new file mode 100644 index 0000000..7b28566 --- /dev/null +++ b/tests/fixtures/command-code/provider-models.json @@ -0,0 +1,1004 @@ +{ + "object": "list", + "data": [ + { + "id": "claude-sonnet-5-5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Sonnet 5.5", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-sonnet-5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Sonnet 5", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-sonnet-4-6", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Sonnet 4.6", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-fable-5-2", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Fable 5.2", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-fable-5-1", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Fable 5.1", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-fable-5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Fable 5", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-opus-5-5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Opus 5.5", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-opus-5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Opus 5", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-opus-4-8", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Opus 4.8", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-opus-4-7", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Opus 4.7", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-haiku-5-5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Haiku 5.5", + "context_length": 1000000, + "supported_endpoints": ["/messages"] + }, + { + "id": "claude-haiku-4-5-20251001", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Claude Haiku 4.5", + "context_length": 200000, + "supported_endpoints": ["/messages"] + }, + { + "id": "gpt-6-astra", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-6 Astra", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-6.2-astra", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-6.2 Astra", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-6.2-sol", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-6.2 Sol", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-6.1-sol", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-6.1 Sol", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-6.1-terra", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-6.1 Terra", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-6-sol", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-6 Sol", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-6-luna", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-6 Luna", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-5.6-sol", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-5.6 Sol", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-5.6-terra", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-5.6 Terra", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-5.6-luna", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-5.6 Luna", + "context_length": 1050000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-5.5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-5.5", + "context_length": 400000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-5.4", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-5.4", + "context_length": 400000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-5.3-codex", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-5.3 Codex", + "context_length": 400000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "gpt-5.4-mini", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GPT-5.4 Mini", + "context_length": 400000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "deepseek/deepseek-v4-pro", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "DeepSeek V4 Pro (latest)", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "deepseek/deepseek-v4-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "DeepSeek V4 Flash (latest)", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses", "/messages"] + }, + { + "id": "deepseek/deepseek-v4-flash-vision-exp", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "DeepSeek V4 Flash Vision (exp)", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "deepseek/deepseek-v4-flash-fast", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "DeepSeek V4 Flash Fast", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "deepseek/deepseek-v4.1-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "DeepSeek V4.1 Flash (latest)", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses", "/messages"] + }, + { + "id": "deepseek/deepseek-v4.1-flash-fast", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "DeepSeek V4.1 Flash Fast (latest)", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "deepseek/deepseek-v4.1-flash-ultrafast", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "DeepSeek V4.1 Flash Ultrafast", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "moonshotai/Kimi-K3.1-Pro", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Kimi K3.1 Pro", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "moonshotai/Kimi-K3", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Kimi K3", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses", "/messages"] + }, + { + "id": "moonshotai/Kimi-K2.7-Code", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Kimi K2.7 Code", + "context_length": 256000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "moonshotai/Kimi-K2.7-Code-Highspeed", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Kimi K2.7 Code HighSpeed", + "context_length": 262000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "moonshotai/Kimi-K2.6", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Kimi K2.6", + "context_length": 256000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "moonshotai/Kimi-K2.5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Kimi K2.5", + "context_length": 256000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "z-ai/glm-5.3-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GLM-5.3 Flash", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/messages"] + }, + { + "id": "z-ai/glm-5.3-flashx", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GLM-5.3 FlashX", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "zai-org/GLM-5.4", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GLM-5.4", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "zai-org/GLM-5.3", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GLM-5.3", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "zai-org/GLM-5.2", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GLM-5.2", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "zai-org/GLM-5.2-Fast", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GLM-5.2 Fast", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "zai-org/GLM-5.1", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GLM-5.1", + "context_length": 200000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "zai-org/GLM-5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "GLM-5", + "context_length": 200000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "minimax/minimax-m4", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "MiniMax M4", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "minimax/minimax-m3.1-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "MiniMax M3.1 Flash", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "MiniMaxAI/MiniMax-M3", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "MiniMax M3", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "MiniMaxAI/MiniMax-M2.7", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "MiniMax M2.7", + "context_length": 200000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "MiniMaxAI/MiniMax-M2.5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "MiniMax M2.5", + "context_length": 200000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "ornith/ornith-1.5-122b", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Ornith 1.5 122B", + "context_length": 262144, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "xiaomi/mimo-v2.6-pro", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "MiMo V2.6 Pro", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "xiaomi/mimo-v2.6-pro-ultraspeed", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "MiMo V2.6 Pro UltraSpeed", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "xiaomi/mimo-v2.6-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "MiMo V2.6 Flash", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen4-Max", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 4 Max", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.8-Omni-Flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.8 Omni Flash", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.8-Max-Prime", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.8 Max Prime", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.8-Max-0902", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.8 Max 0902", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "Qwen/Qwen3.8-Max", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.8 Max", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.8-27B", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.8 27B", + "context_length": 262144, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.8-Flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.8 Flash", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "Qwen/Qwen3.7-Max", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.7 Max", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.7-Plus", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.7 Plus", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.7-Flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.7 Flash", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.6-Max-Preview", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.6 Max Preview", + "context_length": 200000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "Qwen/Qwen3.6-Plus", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Qwen 3.6 Plus", + "context_length": 200000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "meituan/LongCat-2.0", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "LongCat 2.0", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "stepfun/Step-5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Step 5", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "stepfun/Step-3.7-Flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Step 3.7 Flash", + "context_length": 256000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "stepfun/Step-3.5-Flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Step 3.5 Flash", + "context_length": 262144, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "tencent/hy3-paid", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Tencent Hy3", + "context_length": 262144, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "tencent/hy4", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Tencent Hy4", + "context_length": 1024000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "tencent/hy4-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Tencent Hy4 Flash", + "context_length": 1024000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "tencent/hy4-preview", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Tencent Hy4 Preview", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "google/gemini-4-carbon", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 4 Carbon", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "google/gemini-4-neon", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 4 Neon", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "google/gemini-4-argon", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 4 Argon", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "google/gemini-3.8-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 3.8 Flash", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "google/gemini-3.7-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 3.7 Flash", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "google/gemini-3.6-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 3.6 Flash", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "google/gemini-3.5-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 3.5 Flash", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "google/gemini-3.5-flash-lite", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 3.5 Flash Lite", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "google/gemini-3.1-flash-lite", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Gemini 3.1 Flash Lite", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "sakana/fugu-ultra", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Fugu Ultra", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "nvidia/nemotron-3-ultra-550b-a55b", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Nemotron 3 Ultra", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "nvidia/nemotron-3.5-super-vl", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Nemotron 3.5 Super VL", + "context_length": 262144, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "thinkingmachines/inkling", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Inkling", + "context_length": 256000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "thinkingmachines/inkling-small", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Inkling Small", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "thinkingmachines/inkling-2-mini", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Inkling 2 Mini", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "thinkingmachines/inkling-2-small", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Inkling 2 Small", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "recursive/flint-v1.1:free", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Flint 1.1", + "context_length": 262144, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "reflection/beam-contributor:free", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Beam 1.0 Contributor", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "stealth/glyph-cluster:free", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Glyph Cluster", + "context_length": 256000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "inclusionai/ling-3.1-flash", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Ling 3.1 Flash", + "context_length": 262144, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "inclusionai/ling-3.1-flash-1019", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Ling 3.1 Flash 1019", + "context_length": 1000000, + "supported_endpoints": ["/chat/completions"] + }, + { + "id": "meta/muse-spark-1.1", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Muse Spark 1.1", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "meta/muse-spark-1.2", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Muse Spark 1.2", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "meta/muse-spark-1.2-contributor", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Muse Spark 1.2 Contributor", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "meta/muse-spark-1.3", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Muse Spark 1.3", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "meta/muse-spark-1.3-contributor", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Muse Spark 1.3 Contributor", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "meta/muse-spark-open", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Muse Spark Open", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "meta/muse-wonder-1.0", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Muse Wonder", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "meta/muse-ember", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Muse Ember", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "xai/grok-4.5", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Grok 4.5", + "context_length": 500000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "xai/grok-4.6", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Grok 4.6", + "context_length": 500000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "xai/grok-4.7", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Grok 4.7", + "context_length": 500000, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "mistral/mistral-large-4", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Mistral Large 4", + "context_length": 524288, + "supported_endpoints": ["/chat/completions", "/responses"] + }, + { + "id": "amazon/ergo-1.0", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "Ergo 1.0", + "context_length": 1048576, + "supported_endpoints": ["/chat/completions", "/responses", "/messages"] + }, + { + "id": "subquadratic/subq-savant-1.4", + "object": "model", + "created": 1796410764, + "owned_by": "command-code", + "name": "SubQ Savant 1.4", + "context_length": 4194304, + "supported_endpoints": ["/chat/completions", "/responses"] + } + ] +} diff --git a/tests/unit/costs-docs.test.ts b/tests/unit/costs-docs.test.ts index 2177a07..cda91dc 100644 --- a/tests/unit/costs-docs.test.ts +++ b/tests/unit/costs-docs.test.ts @@ -1,8 +1,18 @@ import { expect, test, describe } from "bun:test"; import { readFileSync } from "fs"; import { join } from "path"; -import { applyDocCosts, parseModelsTable, parseMoneyCell } from "@/src/costs-docs.ts"; -import type { ModelEntry } from "@/src/catalog.ts"; +import { + applyDocCosts, + applyOfficialPricing, + matchOfficialRows, + officialCost, + parseModelsTable, + parseMoneyCell, + parseOfficialPricingRows, + parseTierBoundary, + synthesizeApiOnlyEntries, +} from "@/src/costs-docs.ts"; +import { parseAvailabilityModels, type ModelEntry } from "@/src/catalog.ts"; describe("parseMoneyCell", () => { test("reads billed amount when a deal shows two prices", () => { @@ -92,3 +102,201 @@ describe("applyDocCosts", () => { expect(models[1].cost).toEqual({ input: 9, output: 9 }); }); }); + +const fixture = (name: string) => + readFileSync(join(import.meta.dir, "../fixtures/command-code", name), "utf-8"); +const officialRows = () => parseOfficialPricingRows(fixture("pricing-limits.html.txt")); +const liveModels = () => + parseAvailabilityModels(JSON.parse(fixture("provider-models.json")) as unknown); + +function entry(id: string, overrides: Partial = {}): ModelEntry { + return { + id, + name: id, + tier: "premium", + reasoning: true, + tool_call: true, + cost: { input: 0.5, output: 2 }, + limit: { context: 200000, output: 16000 }, + ...overrides, + }; +} + +describe("parseOfficialPricingRows", () => { + test("parses every embedded model row from the split Next.js flight chunks", () => { + const rows = officialRows(); + expect(rows).toHaveLength(115); + expect(rows.filter((row) => row.contextWindow !== undefined)).toHaveLength(111); + const live = liveModels(); + expect(live).toHaveLength(111); + const matches = matchOfficialRows(live, rows); + expect(matches.size).toBe(111); + expect(matches.get("Qwen/Qwen3.7-Max")?.id).toBe("qwen-3.7-max"); + expect(matches.get("claude-haiku-4-5-20251001")?.id).toBe("claude-haiku-4-5"); + expect(matches.get("nvidia/nemotron-3-ultra-550b-a55b")?.id).toBe("nemotron-3-ultra"); + }); + + test("reads billed rates, never list rates", () => { + const m3 = officialRows().find((row) => row.id === "minimax-m3")!; + expect(m3.tiers[0]!.rates).toEqual({ input: 0.3, output: 1.2, cache_read: 0.06 }); + }); + + test("returns no rows for a page without embedded model data", () => { + expect(parseOfficialPricingRows("
")).toEqual([]); + expect( + parseOfficialPricingRows('self.__next_f.push([1,"{\\"rows\\":[{\\"id\\":1}]}"])'), + ).toEqual([]); + }); + + test("accepts contextTiers as the tier list", () => { + const html = JSON.stringify({ + rows: [ + { id: "a", name: "A", contextTiers: [{ rates: { input: 1, output: 2 } }] }, + { id: "b", name: "B", contextTiers: [{ rates: { input: 3, output: 4 } }] }, + ], + }); + expect(parseOfficialPricingRows(html).map((row) => row.tiers[0]!.rates.input)).toEqual([1, 3]); + }); +}); + +describe("parseTierBoundary", () => { + test("parses token bands", () => { + expect(parseTierBoundary("≤ 512K")).toEqual({ op: "le", size: 512000 }); + expect(parseTierBoundary("> 272K")).toEqual({ op: "gt", size: 272000 }); + expect(parseTierBoundary("≤ 1M")).toEqual({ op: "le", size: 1000000 }); + expect(parseTierBoundary(undefined)).toBeUndefined(); + }); +}); + +describe("officialCost", () => { + test("maps three bands to tiers priced above each previous upper bound", () => { + const flash = officialRows().find((row) => row.id === "qwen-3.7-flash")!; + const { base, tiers } = officialCost(flash); + expect(base).toEqual({ input: 0.03, output: 0.13, cache_read: 0.006, cache_write: 0.038 }); + expect(tiers.map((tier) => [tier.tier.size, tier.input, tier.output])).toEqual([ + [32000, 0.1, 0.4], + [256000, 0.2, 0.8], + ]); + }); + + test("drops a long-context band billed like the base band", () => { + const m3 = officialRows().find((row) => row.id === "minimax-m3")!; + expect(officialCost(m3).tiers).toEqual([]); + }); +}); + +describe("applyOfficialPricing", () => { + function priced(id: string, overrides: Partial = {}): ModelEntry { + const model = entry(id, overrides); + applyOfficialPricing([model], matchOfficialRows(liveModels(), officialRows())); + return model; + } + + test("a flat official price clears a third-party long-context tier", () => { + const sonnet = priced("claude-sonnet-4-6", { + cost: { + input: 3, + output: 15, + tiers: [{ input: 6, output: 22.5, tier: { type: "context", size: 200000 } }], + context_over_200k: { input: 6, output: 22.5 }, + }, + }); + expect(sonnet.cost).toEqual({ input: 3, output: 15, cache_read: 0.3, cache_write: 3.75 }); + expect(sonnet.limit.context).toBe(1000000); + }); + + test("official spot checks", () => { + const gpt = priced("gpt-5.5", { + cost: { + input: 5, + output: 30, + tiers: [{ input: 10, output: 45, tier: { type: "context", size: 272000 } }], + }, + }); + expect(gpt.cost).toEqual({ input: 5, output: 30, cache_read: 0.5, cache_write: 0 }); + expect(gpt.limit.context).toBe(400000); + + expect(priced("MiniMaxAI/MiniMax-M3").cost).toEqual({ + input: 0.3, + output: 1.2, + cache_read: 0.06, + }); + + const qwen = priced("Qwen/Qwen3.7-Max", { + cost: { + input: 2.5, + output: 7.5, + tiers: [ + { input: 3, output: 9, tier: { type: "context", size: 32000 } }, + { input: 4, output: 12, tier: { type: "context", size: 128000 } }, + ], + }, + }); + expect(qwen.cost.tiers).toBeUndefined(); + expect(qwen.cost).toMatchObject({ input: 2.5, output: 7.5 }); + + const astra = priced("gpt-6-astra"); + expect(astra.cost.tiers).toEqual([ + { + input: 20, + output: 75, + cache_read: 2, + cache_write: 25, + tier: { type: "context", size: 272000 }, + }, + ]); + }); + + test("leaves models without an official row untouched", () => { + const model = entry("unlisted/model"); + expect(applyOfficialPricing([model], new Map())).toBe(0); + expect(model.cost).toEqual({ input: 0.5, output: 2 }); + }); +}); + +describe("synthesizeApiOnlyEntries", () => { + test("builds the live models absent from the CLI catalog from official rows", () => { + const live = liveModels(); + const apiOnly = [ + "minimax/minimax-m4", + "recursive/flint-v1.1:free", + "reflection/beam-contributor:free", + "subquadratic/subq-savant-1.4", + "thinkingmachines/inkling-2-small", + ]; + const candidateIds = new Set(live.map((m) => m.id).filter((id) => !apiOnly.includes(id))); + const { entries, skipped } = synthesizeApiOnlyEntries({ + liveModels: live, + candidateIds, + matches: matchOfficialRows(live, officialRows()), + }); + expect(skipped).toEqual([]); + expect(entries.map((e) => e.id).sort()).toEqual([...apiOnly].sort()); + const byId = new Map(entries.map((e) => [e.id, e])); + expect(byId.get("subquadratic/subq-savant-1.4")?.limit.context).toBe(4194304); + expect(byId.get("subquadratic/subq-savant-1.4")?.cost).toEqual({ + input: 0.1, + output: 0.5, + cache_read: 0.01, + }); + expect(byId.get("recursive/flint-v1.1:free")?.cost).toEqual({ + input: 0, + output: 0, + cache_read: 0, + }); + expect(byId.get("reflection/beam-contributor:free")?.cost.input).toBe(0); + expect(byId.get("reflection/beam-contributor:free")?.modalities?.input).toEqual(["text"]); + expect(byId.get("minimax/minimax-m4")?.modalities?.input).toEqual(["text", "image"]); + expect(byId.get("minimax/minimax-m4")?.supported_endpoints?.length).toBeGreaterThan(0); + }); + + test("skips a live model with no official row instead of inventing one", () => { + const { entries, skipped } = synthesizeApiOnlyEntries({ + liveModels: [{ id: "vendor/unknown", context_length: 1000 }], + candidateIds: new Set(), + matches: new Map(), + }); + expect(entries).toEqual([]); + expect(skipped).toEqual(["vendor/unknown"]); + }); +}); diff --git a/tests/unit/sync-models.test.ts b/tests/unit/sync-models.test.ts index 13480cc..e4b5269 100644 --- a/tests/unit/sync-models.test.ts +++ b/tests/unit/sync-models.test.ts @@ -3,8 +3,69 @@ import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "fs"; import { tmpdir } from "os"; import { join } from "path"; import { parseAvailabilityIds } from "@/src/catalog.ts"; -import { buildSyncArtifacts } from "@/scripts/sync-models.ts"; +import { + appendStepSummaryWarning, + buildSyncArtifacts, + contextMismatches, + resolveOfficialPricing, +} from "@/scripts/sync-models.ts"; import { lastSuccessfulModelCount, meetsModelCountFloor } from "@/src/manifest.ts"; +import { ManifestSchema } from "@/src/schemas.ts"; + +describe("official pricing fail-soft", () => { + test("an unparseable or empty page yields a warning instead of rows", () => { + for (const html of ["", "maintenance"]) { + const result = resolveOfficialPricing(html); + expect(result.ok).toBe(false); + if (!result.ok) expect(result.warning).toContain("kept the previous models.json"); + } + }); + + test("the fixture page parses", () => { + const html = readFileSync( + join(import.meta.dir, "../fixtures/command-code/pricing-limits.html.txt"), + "utf-8", + ); + const result = resolveOfficialPricing(html); + expect(result.ok && result.rows.length).toBe(115); + }); + + test("the warning is appended to the step summary", () => { + const dir = mkdtempSync(join(tmpdir(), "sync-summary-")); + try { + const path = join(dir, "summary.md"); + writeFileSync(path, "# Sync\n"); + appendStepSummaryWarning("pricing page unparseable", path); + expect(readFileSync(path, "utf-8")).toBe( + "# Sync\n> [!WARNING]\n> pricing page unparseable\n\n", + ); + } finally { + rmSync(dir, { recursive: true, force: true }); + } + }); + + test("context cross-check reports models whose live context differs", () => { + const model = (id: string, context: number) => ({ + id, + name: id, + tier: "open-source" as const, + reasoning: false, + tool_call: true, + cost: { input: 0, output: 0 }, + limit: { context, output: 1 }, + }); + expect( + contextMismatches( + [model("same", 100), model("drift", 400)], + [ + { id: "same", context_length: 100 }, + { id: "drift", context_length: 272 }, + { id: "unknown" }, + ], + ), + ).toEqual(["drift (catalog 400, live 272)"]); + }); +}); function availabilityResponse(ids: string[]): unknown { return { object: "list", data: ids.map((id) => ({ id })) }; @@ -99,6 +160,19 @@ describe("buildSyncArtifacts", () => { ]); }); + test("synthesized API-only ids are listed as review.apiOnly, only when retained", () => { + const ids = Array.from({ length: 20 }, (_, i) => `keep-${i}`); + const artifacts = buildSyncArtifacts({ + ...base, + candidates: [...ids, "vendor/api-b", "vendor/api-a"].map(candidate), + availabilityModels: [...ids, "vendor/api-a", "vendor/api-b"].map((id) => ({ id })), + apiOnlyIds: new Set(["vendor/api-b", "vendor/api-a", "vendor/not-live"]), + }); + expect(artifacts.manifest.modelCount).toBe(22); + expect(artifacts.manifest.review?.apiOnly).toEqual(["vendor/api-a", "vendor/api-b"]); + expect(ManifestSchema.safeParse(artifacts.manifest).success).toBe(true); + }); + test("sync carries advertised endpoint changes and preserves known endpoints on partial responses", () => { const candidates = [ candidate("changed"), From 7e862c7ca871b39bf63943be3ff52ca21bd8d9f1 Mon Sep 17 00:00:00 2001 From: Cristhofer Pincetti Date: Fri, 4 Dec 2026 16:05:24 -0300 Subject: [PATCH 2/2] fix(catalog): sync official pricing tiers and five API-only models Workit-Session: ses_dbdda4daaffexKPxS5Z9LKhpI2:ses_dbd93db0effeEfWTGgb4u7WLz9 --- manifest.json | 17 +- models.json | 460 +++++++++++++++++++++----------------------------- 2 files changed, 203 insertions(+), 274 deletions(-) diff --git a/manifest.json b/manifest.json index 6703d8a..e344b75 100644 --- a/manifest.json +++ b/manifest.json @@ -1,11 +1,11 @@ { "schemaVersion": 1, - "generatedAt": "2026-12-04T18:34:26.642Z", + "generatedAt": "2026-12-04T19:03:51.789Z", "pluginVersion": "0.12.56", "commandCodeVersion": "1.94.0", "commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.94.0.tgz", - "modelCount": 106, - "reasoningModelCount": 95, + "modelCount": 111, + "reasoningModelCount": 100, "extraction": { "modelCatalog": "ok", "costCatalog": "docs", @@ -13,7 +13,7 @@ }, "costSources": { "cli": 0, - "officialDocs": 106, + "officialDocs": 111, "thirdParty": 0, "free": 0, "fallback": 0, @@ -22,7 +22,14 @@ "review": { "thirdParty": [], "free": [], - "unmatched": [] + "unmatched": [], + "apiOnly": [ + "minimax/minimax-m4", + "recursive/flint-v1.1:free", + "reflection/beam-contributor:free", + "subquadratic/subq-savant-1.4", + "thinkingmachines/inkling-2-small" + ] }, "status": "healthy" } diff --git a/models.json b/models.json index f12acb0..bdd68c8 100644 --- a/models.json +++ b/models.json @@ -216,25 +216,7 @@ "input": 5, "output": 25, "cache_read": 0.5, - "cache_write": 6.25, - "tiers": [ - { - "input": 10, - "output": 37.5, - "cache_read": 1, - "cache_write": 12.5, - "tier": { - "type": "context", - "size": 200000 - } - } - ], - "context_over_200k": { - "input": 10, - "output": 37.5, - "cache_read": 1, - "cache_write": 12.5 - } + "cache_write": 6.25 }, "limit": { "context": 1000000, @@ -273,25 +255,7 @@ "input": 5, "output": 25, "cache_read": 0.5, - "cache_write": 6.25, - "tiers": [ - { - "input": 10, - "output": 37.5, - "cache_read": 1, - "cache_write": 12.5, - "tier": { - "type": "context", - "size": 200000 - } - } - ], - "context_over_200k": { - "input": 10, - "output": 37.5, - "cache_read": 1, - "cache_write": 12.5 - } + "cache_write": 6.25 }, "limit": { "context": 1000000, @@ -408,21 +372,7 @@ "input": 3, "output": 15, "cache_read": 0.3, - "cache_write": 3.75, - "tiers": [ - { - "input": 6, - "output": 22.5, - "tier": { - "type": "context", - "size": 200000 - } - } - ], - "context_over_200k": { - "input": 6, - "output": 22.5 - } + "cache_write": 3.75 }, "limit": { "context": 1000000, @@ -537,7 +487,8 @@ "cost": { "input": 2, "output": 8, - "cache_read": 0.5 + "cache_read": 0.5, + "cache_write": 0 }, "limit": { "context": 400000, @@ -577,20 +528,7 @@ "input": 2.5, "output": 15, "cache_read": 0.25, - "tiers": [ - { - "input": 5, - "output": 22.5, - "tier": { - "type": "context", - "size": 272000 - } - } - ], - "context_over_200k": { - "input": 5, - "output": 22.5 - } + "cache_write": 0 }, "limit": { "context": 400000, @@ -628,7 +566,8 @@ "cost": { "input": 0.75, "output": 4.5, - "cache_read": 0.075 + "cache_read": 0.075, + "cache_write": 0 }, "limit": { "context": 400000, @@ -668,22 +607,7 @@ "input": 5, "output": 30, "cache_read": 0.5, - "tiers": [ - { - "input": 10, - "output": 45, - "cache_read": 0.5, - "tier": { - "type": "context", - "size": 272000 - } - } - ], - "context_over_200k": { - "input": 10, - "output": 45, - "cache_read": 0.5 - } + "cache_write": 0 }, "limit": { "context": 400000, @@ -736,13 +660,7 @@ "size": 272000 } } - ], - "context_over_200k": { - "input": 20, - "output": 75, - "cache_read": 2, - "cache_write": 25 - } + ] }, "limit": { "context": 1050000, @@ -789,17 +707,13 @@ "input": 0.2, "output": 0.75, "cache_read": 0.02, + "cache_write": 0.25, "tier": { "type": "context", "size": 272000 } } - ], - "context_over_200k": { - "input": 0.2, - "output": 0.75, - "cache_read": 0.02 - } + ] }, "limit": { "context": 1050000, @@ -846,17 +760,13 @@ "input": 4, "output": 15, "cache_read": 0.4, + "cache_write": 5, "tier": { "type": "context", "size": 272000 } } - ], - "context_over_200k": { - "input": 4, - "output": 15, - "cache_read": 0.4 - } + ] }, "limit": { "context": 1050000, @@ -903,17 +813,13 @@ "input": 4, "output": 15, "cache_read": 0.2, + "cache_write": 5, "tier": { "type": "context", "size": 272000 } } - ], - "context_over_200k": { - "input": 4, - "output": 15, - "cache_read": 0.2 - } + ] }, "limit": { "context": 1050000, @@ -966,13 +872,7 @@ "size": 272000 } } - ], - "context_over_200k": { - "input": 2, - "output": 7.5, - "cache_read": 0.1, - "cache_write": 2.5 - } + ] }, "limit": { "context": 1050000, @@ -1025,13 +925,7 @@ "size": 272000 } } - ], - "context_over_200k": { - "input": 16, - "output": 60, - "cache_read": 0.8, - "cache_write": 20 - } + ] }, "limit": { "context": 1050000, @@ -1084,13 +978,7 @@ "size": 272000 } } - ], - "context_over_200k": { - "input": 4, - "output": 15, - "cache_read": 0.2, - "cache_write": 5 - } + ] }, "limit": { "context": 1050000, @@ -1114,6 +1002,37 @@ "/responses" ] }, + { + "id": "reflection/beam-contributor:free", + "name": "Beam 1.0 Contributor", + "tier": "open-source", + "reasoning": true, + "tool_call": true, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + }, + "limit": { + "context": 1048576, + "output": 65536 + }, + "supported_endpoints": [ + "/chat/completions", + "/responses" + ], + "attachment": false, + "modalities": { + "input": [ + "text" + ], + "output": [ + "text" + ] + }, + "family": "beam", + "release_date": "2026-12-01" + }, { "id": "deepseek/deepseek-v4-flash", "name": "DeepSeek V4 Flash (latest)", @@ -1411,6 +1330,37 @@ "/messages" ] }, + { + "id": "recursive/flint-v1.1:free", + "name": "Flint 1.1", + "tier": "open-source", + "reasoning": true, + "tool_call": true, + "cost": { + "input": 0, + "output": 0, + "cache_read": 0 + }, + "limit": { + "context": 262144, + "output": 65536 + }, + "supported_endpoints": [ + "/chat/completions", + "/responses" + ], + "attachment": false, + "modalities": { + "input": [ + "text" + ], + "output": [ + "text" + ] + }, + "family": "flint", + "release_date": "2026-12-02" + }, { "id": "sakana/fugu-ultra", "name": "Fugu Ultra", @@ -1424,23 +1374,7 @@ "cost": { "input": 5, "output": 30, - "cache_read": 0.5, - "tiers": [ - { - "input": 10, - "output": 45, - "cache_read": 1, - "tier": { - "type": "context", - "size": 272000 - } - } - ], - "context_over_200k": { - "input": 10, - "output": 45, - "cache_read": 1 - } + "cache_read": 0.5 }, "limit": { "context": 1000000, @@ -2140,13 +2074,7 @@ "size": 272000 } } - ], - "context_over_200k": { - "input": 0.4, - "output": 1.8, - "cache_read": 0.04, - "cache_write": 0.5 - } + ] }, "limit": { "context": 1050000, @@ -2199,13 +2127,7 @@ "size": 272000 } } - ], - "context_over_200k": { - "input": 10, - "output": 45, - "cache_read": 1, - "cache_write": 12.5 - } + ] }, "limit": { "context": 1050000, @@ -2258,13 +2180,7 @@ "size": 272000 } } - ], - "context_over_200k": { - "input": 4, - "output": 18, - "cache_read": 0.4, - "cache_write": 5 - } + ] }, "limit": { "context": 1050000, @@ -2302,23 +2218,7 @@ "cost": { "input": 2, "output": 6, - "cache_read": 0.5, - "tiers": [ - { - "input": 4, - "output": 12, - "cache_read": 0.6, - "tier": { - "type": "context", - "size": 200000 - } - } - ], - "context_over_200k": { - "input": 4, - "output": 12, - "cache_read": 0.6 - } + "cache_read": 0.5 }, "limit": { "context": 500000, @@ -2367,12 +2267,7 @@ "size": 200000 } } - ], - "context_over_200k": { - "input": 4, - "output": 12, - "cache_read": 1 - } + ] }, "limit": { "context": 500000, @@ -2421,12 +2316,7 @@ "size": 200000 } } - ], - "context_over_200k": { - "input": 4, - "output": 12, - "cache_read": 1 - } + ] }, "limit": { "context": 500000, @@ -2519,6 +2409,38 @@ "/chat/completions" ] }, + { + "id": "thinkingmachines/inkling-2-small", + "name": "Inkling 2 Small", + "tier": "open-source", + "reasoning": true, + "tool_call": true, + "cost": { + "input": 0.3, + "output": 1, + "cache_read": 0.03 + }, + "limit": { + "context": 1000000, + "output": 65536 + }, + "supported_endpoints": [ + "/chat/completions", + "/responses" + ], + "attachment": true, + "modalities": { + "input": [ + "text", + "image" + ], + "output": [ + "text" + ] + }, + "family": "inkling-small", + "release_date": "2026-11-05" + }, { "id": "thinkingmachines/inkling-small", "name": "Inkling Small", @@ -3027,23 +2949,7 @@ "cost": { "input": 0.3, "output": 1.2, - "cache_read": 0.06, - "tiers": [ - { - "input": 0.6, - "output": 2.4, - "cache_read": 0.12, - "tier": { - "type": "context", - "size": 512000 - } - } - ], - "context_over_200k": { - "input": 0.6, - "output": 2.4, - "cache_read": 0.12 - } + "cache_read": 0.06 }, "limit": { "context": 1000000, @@ -3104,6 +3010,37 @@ "/chat/completions" ] }, + { + "id": "minimax/minimax-m4", + "name": "MiniMax M4", + "tier": "open-source", + "reasoning": true, + "tool_call": true, + "cost": { + "input": 0.8, + "output": 3.1, + "cache_read": 0.05 + }, + "limit": { + "context": 1000000, + "output": 65536 + }, + "supported_endpoints": [ + "/chat/completions" + ], + "attachment": true, + "modalities": { + "input": [ + "text", + "image" + ], + "output": [ + "text" + ] + }, + "family": "minimax-m", + "release_date": "2026-12-03" + }, { "id": "mistral/mistral-large-4", "name": "Mistral Large 4", @@ -3157,23 +3094,7 @@ "cost": { "input": 0.1, "output": 0.5, - "cache_read": 0.004, - "tiers": [ - { - "input": 0.3, - "output": 1.5, - "cache_read": 0.012, - "tier": { - "type": "context", - "size": 200001 - } - } - ], - "context_over_200k": { - "input": 0.3, - "output": 1.5, - "cache_read": 0.012 - } + "cache_read": 0.004 }, "limit": { "context": 1048576, @@ -3607,20 +3528,13 @@ { "input": 2, "output": 6, - "cache_read": 0.4, - "cache_write": 2.5, + "cache_read": 0.2, "tier": { "type": "context", "size": 256000 } } - ], - "context_over_200k": { - "input": 2, - "output": 6, - "cache_read": 0.4, - "cache_write": 2.5 - } + ] }, "limit": { "context": 200000, @@ -3709,27 +3623,7 @@ "input": 2.5, "output": 7.5, "cache_read": 0.5, - "cache_write": 3.13, - "tiers": [ - { - "input": 5, - "output": 15, - "cache_read": 1, - "tier": { - "type": "context", - "size": 32000 - } - }, - { - "input": 6.25, - "output": 18.5, - "cache_read": 1.25, - "tier": { - "type": "context", - "size": 128000 - } - } - ] + "cache_write": 3.13 }, "limit": { "context": 1000000, @@ -3767,17 +3661,13 @@ "input": 1.2, "output": 4.8, "cache_read": 0.24, + "cache_write": 1.5, "tier": { "type": "context", - "size": 262144 + "size": 256000 } } - ], - "context_over_200k": { - "input": 1.2, - "output": 4.8, - "cache_read": 0.24 - } + ] }, "limit": { "context": 1000000, @@ -4165,6 +4055,38 @@ "/chat/completions" ] }, + { + "id": "subquadratic/subq-savant-1.4", + "name": "SubQ Savant 1.4", + "tier": "open-source", + "reasoning": true, + "tool_call": true, + "cost": { + "input": 0.1, + "output": 0.5, + "cache_read": 0.01 + }, + "limit": { + "context": 4194304, + "output": 65536 + }, + "supported_endpoints": [ + "/chat/completions", + "/responses" + ], + "attachment": true, + "modalities": { + "input": [ + "text", + "image" + ], + "output": [ + "text" + ] + }, + "family": "subq-savant", + "release_date": "2026-12-02" + }, { "id": "tencent/hy3-paid", "name": "Tencent Hy3",