diff --git a/src/utils/constants.ts b/src/utils/constants.ts index f941455..045088f 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -58,7 +58,9 @@ export const BASE_RPC_URLS = [ // gpt-5.3-codex ($1.75/$14) (gpt-5.3 is hidden + available:false), gpt-5.2-pro ($21/$168), gpt-5.4-mini, // gpt-5-mini, gpt-5.4-nano, gpt-4.1{,-mini,-nano}, gpt-4o{,-mini}, // o3 ($2/$8). o1 ($15/$60), o3-mini and o4-mini are RETIRED (2026-11-24, -// redirected to gpt-5.4-mini — see the note above MODEL_TIERS) +// redirected to gpt-5.4-mini — see the note above MODEL_TIERS). o3 and +// gpt-5-mini RETIRE 2026-12-11 (same note); gpt-5-nano (hidden) stays +// served from Azure at its own price until 2027-02-09. // Anthropic (12): claude-fable-5.1 ($10/$50, 1M — listed by 2026-09-08 ABOVE // the default, so it carries a price row), claude-opus-5.5 ($4/$20, 1M, 128k // out — newest Opus, cheaper than Opus 5, thinking always on), @@ -163,8 +165,25 @@ export const BASE_RPC_URLS = [ // the tier was already trying it second — that second slot now says so, // and the later duplicate is gone. The order of every other member holds. // google/gemini-2.5-pro -> google/gemini-3.8-flash. In no tier. +// +// 2026-12-11 RETIREMENTS (OpenAI shuts down o3, gpt-5-mini and gpt-5-nano — +// developers.openai.com/api/docs/deprecations, notice 2026-06-11; the +// gateways redirect o3 and gpt-5-mini, quoted at the successor's price): +// openai/gpt-5-mini -> openai/gpt-5.6-luna ($0.25/$2 -> $0.2/$1.2). fast +// already listed gpt-5.6-luna one slot earlier, so from 12-11 the tier +// would have tried the same model twice; gpt-5-mini's slot is removed and +// the order of every other member holds. +// openai/o3 -> openai/gpt-5.4-mini ($2/$8 -> $0.75/$4.5). In no tier. +// openai/gpt-5-nano is NOT redirected (owner decision 2026-11-24): every +// gateway keeps serving it from Azure at its own $0.05/$0.4 until +// 2027-02-09, when it retires. In no tier, no price row (the default +// covers it). +// openai/gpt-4.1-nano: base redirects it to gpt-5-nano ($0.05/$0.4) until +// then; Solana has sent it to gpt-4.1-mini ($0.4/$1.6) since 2026-11-03; +// arc still serves it at $0.1/$0.4. In no tier; see its (removed) price +// row. export const MODEL_TIERS = { - fast: ["google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "openai/gpt-5.6-luna", "openai/gpt-5-mini", "deepseek/deepseek-chat", "deepseek/deepseek-v4.1-flash", "google/gemini-3-flash-preview"], + fast: ["google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "openai/gpt-5.6-luna", "deepseek/deepseek-chat", "deepseek/deepseek-v4.1-flash", "google/gemini-3-flash-preview"], balanced: ["openai/gpt-5.6-terra", "anthropic/claude-sonnet-5", "moonshot/kimi-k3.1-pro", "google/gemini-3.1-pro", "xai/grok-4.5", "openai/gpt-5.5"], powerful: ["anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "openai/gpt-5.6-sol", "anthropic/claude-fable-5", "openai/gpt-5.4-pro", "openai/gpt-5.2-pro"], cheap: ["deepseek/deepseek-v4-pro", "qwen/qwen3.7-flash", "minimax/minimax-m3", "google/gemini-3.5-flash-lite", "deepseek/deepseek-chat", "deepseek/deepseek-v4.1-flash", "openai/gpt-5.4-nano"], @@ -533,6 +552,9 @@ export const CHAT_PRICE_PER_MTOKEN: Record = { // 2026-12-01: Google retires Gemini 2.5. "google/gemini-2.5-flash": ["google/gemini-3.5-flash-lite", { input: 0.3, output: 2.5 }], "google/gemini-2.5-pro": ["google/gemini-3.8-flash", { input: 1.25, output: 10 }], + // 2026-12-11: OpenAI shuts down o3 and gpt-5-mini. (gpt-5-nano too, but + // the gateways keep serving it from Azure until 2027-02-09; see below.) + "openai/o3": ["openai/gpt-5.4-mini", { input: 2, output: 8 }], + "openai/gpt-5-mini": ["openai/gpt-5.6-luna", { input: 0.25, output: 2 }], }; const bare = (id: string) => id.slice(id.indexOf("/") + 1); @@ -117,6 +121,27 @@ test("o3-mini and o4-mini carry no row: theirs would under-reserve gpt-5.4-mini' } }); +test("gpt-5-mini leaves fast without moving any other member (gpt-5.6-luna already precedes it)", () => { + // From 2026-12-11 the gateway answers gpt-5-mini with gpt-5.6-luna, which + // fast already tried one slot earlier, so the served order is unchanged. + assert.deepEqual(MODEL_TIERS.fast.slice(0, 4), [ + "google/gemini-3.6-flash", + "google/gemini-3.5-flash-lite", + "openai/gpt-5.6-luna", + "deepseek/deepseek-chat", + ]); +}); + +test("gpt-5-nano is not redirected before 2027-02-09: in no tier, and the reserve covers its own price", () => { + // Owner decision 2026-11-24: the gateways serve it from Azure at + // $0.05/$0.4 until 2027-02-09 instead of redirecting it to gpt-6-luna. + for (const [mode, ids] of Object.entries(MODEL_TIERS)) { + assert.ok(!(ids as readonly string[]).includes("openai/gpt-5-nano"), `${mode} routes to gpt-5-nano`); + } + const r = rateFor("openai/gpt-5-nano"); + assert.ok(r.input >= 0.05 && r.output >= 0.4, `gpt-5-nano reserves $${r.input}/$${r.output}`); +}); + test("gpt-4.1-nano carries no row: $0.1/$0.4 under-reserves Solana's redirect", () => { // Base -> gpt-5-nano ($0.05/$0.4) until 2027-02-09; Solana -> gpt-4.1-mini // ($0.4/$1.6) since 2026-11-03; arc serves it at $0.1/$0.4. The default