From a6241b8ac11f7156f1aa1fcb7f8581f6cf0526d6 Mon Sep 17 00:00:00 2001 From: aswink <1014642+aswink@users.noreply.github.com> Date: Tue, 24 Nov 2026 17:03:53 +0000 Subject: [PATCH] feat(catalog): declare base pricing endpoints --- packages/proxy/schema/model_list.json | 224 ++++++++++++++++++++++++++ packages/proxy/schema/models.test.ts | 12 ++ packages/proxy/schema/models.ts | 9 ++ 3 files changed, 245 insertions(+) diff --git a/packages/proxy/schema/model_list.json b/packages/proxy/schema/model_list.json index e9984cd1..ea8afff9 100644 --- a/packages/proxy/schema/model_list.json +++ b/packages/proxy/schema/model_list.json @@ -1,5 +1,9 @@ { "gpt-6.2-astra": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -304,6 +308,10 @@ ] }, "gpt-6.2-sol": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -601,6 +609,10 @@ ] }, "gpt-6.1-sol": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -907,6 +919,10 @@ ] }, "gpt-6.1-terra": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -1137,6 +1153,10 @@ ] }, "gpt-6-astra": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -1479,6 +1499,10 @@ ] }, "gpt-6-luna": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -1750,6 +1774,10 @@ ] }, "gpt-6-sol": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -2001,6 +2029,10 @@ ] }, "gpt-5.6": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -2073,6 +2105,10 @@ ] }, "gpt-5.6-luna": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -2322,6 +2358,10 @@ ] }, "gpt-5.6-sol": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -2577,6 +2617,10 @@ ] }, "gpt-5.6-terra": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -2824,6 +2868,10 @@ ] }, "gpt-5.5": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -2996,6 +3044,10 @@ ] }, "gpt-5.5-pro": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3086,6 +3138,10 @@ ] }, "gpt-5.5-2026-04-23": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3127,6 +3183,10 @@ ] }, "gpt-5.5-pro-2026-04-23": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3157,6 +3217,10 @@ ] }, "gpt-5.4": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3314,6 +3378,10 @@ ] }, "gpt-5.4-mini": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3403,6 +3471,10 @@ ] }, "gpt-5.4-nano": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3468,6 +3540,10 @@ ] }, "gpt-5.4-pro": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3574,6 +3650,10 @@ ] }, "gpt-5.4-mini-2026-03-17": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3605,6 +3685,10 @@ ] }, "gpt-5.4-nano-2026-03-17": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3638,6 +3722,10 @@ ] }, "gpt-5.4-2026-03-05": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3679,6 +3767,10 @@ ] }, "gpt-5.4-pro-2026-03-05": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3735,6 +3827,10 @@ ] }, "gpt-5.3-codex": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3786,6 +3882,10 @@ ] }, "gpt-5.2": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3913,6 +4013,10 @@ ] }, "gpt-5.2-pro": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -3953,6 +4057,10 @@ ] }, "gpt-5.2-2025-12-11": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4000,6 +4108,10 @@ ] }, "gpt-5.1": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4167,6 +4279,10 @@ ] }, "gpt-5.1-2025-11-13": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4200,6 +4316,10 @@ ] }, "gpt-5": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4303,6 +4423,10 @@ ] }, "gpt-5-mini": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4381,6 +4505,10 @@ ] }, "gpt-5-nano": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4446,6 +4574,10 @@ ] }, "gpt-5-pro": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4537,6 +4669,10 @@ ] }, "gpt-5-2025-08-07": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4570,6 +4706,10 @@ ] }, "gpt-5-mini-2025-08-07": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4603,6 +4743,10 @@ ] }, "gpt-5-nano-2025-08-07": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4636,6 +4780,10 @@ ] }, "gpt-4.1": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4692,6 +4840,10 @@ ] }, "gpt-4.1-mini": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4878,6 +5030,10 @@ ] }, "gpt-4o": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -4969,6 +5125,10 @@ ] }, "gpt-4o-mini": { + "base_pricing": { + "provider": "openai", + "api_host": "api.openai.com" + }, "format": "openai", "flavor": "chat", "multimodal": true, @@ -17546,6 +17706,10 @@ ] }, "claude-mythos-5-1": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -17598,6 +17762,10 @@ ] }, "claude-fable-5-2": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -17700,6 +17868,10 @@ ] }, "claude-fable-5-1": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -17756,6 +17928,10 @@ ] }, "claude-fable-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -17813,6 +17989,10 @@ ] }, "claude-opus-5-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -17898,6 +18078,10 @@ ] }, "claude-opus-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18014,6 +18198,10 @@ ] }, "claude-sonnet-5-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18070,6 +18258,10 @@ ] }, "claude-sonnet-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18129,6 +18321,10 @@ ] }, "claude-haiku-5-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18217,6 +18413,10 @@ ] }, "claude-haiku-4-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18276,6 +18476,10 @@ ] }, "claude-opus-4-8": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18360,6 +18564,10 @@ ] }, "claude-sonnet-4-6": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18416,6 +18624,10 @@ ] }, "claude-opus-4-7": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18472,6 +18684,10 @@ ] }, "claude-sonnet-4-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18536,6 +18752,10 @@ ] }, "claude-opus-4-6": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, @@ -18589,6 +18809,10 @@ ] }, "claude-opus-4-5": { + "base_pricing": { + "provider": "anthropic", + "api_host": "api.anthropic.com" + }, "format": "anthropic", "flavor": "chat", "multimodal": true, diff --git a/packages/proxy/schema/models.test.ts b/packages/proxy/schema/models.test.ts index 04561fe0..31a3a848 100644 --- a/packages/proxy/schema/models.test.ts +++ b/packages/proxy/schema/models.test.ts @@ -416,6 +416,18 @@ it("keeps equivalent model references within the catalog", () => { } }); +// Preserve base pricing through the parsed catalog that serves the model list API. +it.each([ + ["gpt-6.1-sol", "openai", "api.openai.com"], + ["gpt-6.2-sol", "openai", "api.openai.com"], + ["claude-opus-5-5", "anthropic", "api.anthropic.com"], +])("keeps the base pricing endpoint for %s", (model, provider, api_host) => { + expect(getAvailableModels()[model].base_pricing).toEqual({ + provider, + api_host, + }); +}); + it("Uses available providers for Fireworks model endpoint types", () => { expect(getModelEndpointTypes("accounts/fireworks/models/minimax-m3")).toEqual( ["fireworks"], diff --git a/packages/proxy/schema/models.ts b/packages/proxy/schema/models.ts index e310cac1..44406687 100644 --- a/packages/proxy/schema/models.ts +++ b/packages/proxy/schema/models.ts @@ -172,6 +172,15 @@ export const ModelSchema = z.object({ pricing: ModelPricingSchema.nullish().describe( "Verified USD prices per million tokens of the field's modality, keyed by the resolved provider and pricing tier. Each rate applies only to its endpoint, region, inference geography, deployment, model version, prompt length, and inclusive UTC date bounds. Missing prices are unknown, not zero. Missing non-standard tiers have no verified support and do not fall back to standard prices. Top-level price fields hold default standard prices; pricing.standard can specify conditional standard rates. Tier names are pricing categories, not provider API parameter values; use the tier actually served, not merely requested.", ), + base_pricing: z + .object({ + provider: z.enum(ModelEndpointType), + api_host: z.string().min(1), + }) + .nullish() + .describe( + "Catalog pricing endpoint inherited by native and custom routes.", + ), displayName: z .string() .nullish()