Skip to content

Commit 40b7fd8

Browse files
committed
feat(models): add structured pricing and currency conversion
1 parent 04a8f0d commit 40b7fd8

176 files changed

Lines changed: 4302 additions & 477 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

manifests/$schemas/model.schema.json

Lines changed: 188 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,7 @@
2323
"description": "Maximum output token size in tokens (e.g., 4096, 8192), null when undocumented"
2424
},
2525
"tokenPricing": {
26-
"type": "object",
27-
"description": "Token-based pricing information for API usage (in $/M tokens)",
28-
"properties": {
29-
"input": {
30-
"type": ["number", "null"],
31-
"description": "Input token pricing in USD per million tokens, null when unavailable or not representable as a single USD rate"
32-
},
33-
"output": {
34-
"type": ["number", "null"],
35-
"description": "Output token pricing in USD per million tokens, null when unavailable or not representable as a single USD rate"
36-
},
37-
"cache": {
38-
"type": ["number", "null"],
39-
"description": "Cache token pricing in $/M tokens (e.g., 0.07 for $0.07/1M tokens, null if not applicable)"
40-
}
41-
},
42-
"required": ["input", "output", "cache"],
43-
"additionalProperties": false
26+
"$ref": "#/$defs/tokenPricing"
4427
},
4528
"releaseDate": {
4629
"type": ["string", "null"],
@@ -150,5 +133,191 @@
150133
"platformUrls"
151134
]
152135
}
153-
]
136+
],
137+
"$defs": {
138+
"tokenPricing": {
139+
"description": "First-party, pay-as-you-go standard API token pricing. Rates use the offer's native currency per million tokens.",
140+
"oneOf": [
141+
{
142+
"type": "object",
143+
"properties": {
144+
"status": {
145+
"const": "available"
146+
},
147+
"primaryOffer": {
148+
"type": "string",
149+
"pattern": "^[a-z0-9-]+$"
150+
},
151+
"offers": {
152+
"type": "array",
153+
"items": {
154+
"$ref": "#/$defs/tokenPricingOffer"
155+
},
156+
"minItems": 1,
157+
"uniqueItems": true
158+
}
159+
},
160+
"required": ["status", "primaryOffer", "offers"],
161+
"additionalProperties": false
162+
},
163+
{
164+
"type": "object",
165+
"properties": {
166+
"status": {
167+
"const": "not-applicable"
168+
},
169+
"reason": {
170+
"type": "string",
171+
"enum": ["open-weights-only", "subscription-only"]
172+
},
173+
"primaryOffer": {
174+
"type": "null"
175+
},
176+
"offers": {
177+
"type": "array",
178+
"maxItems": 0
179+
}
180+
},
181+
"required": ["status", "reason", "primaryOffer", "offers"],
182+
"additionalProperties": false
183+
},
184+
{
185+
"type": "object",
186+
"properties": {
187+
"status": {
188+
"const": "unavailable"
189+
},
190+
"reason": {
191+
"type": "string",
192+
"enum": [
193+
"official-price-not-published",
194+
"historical-price-unverified",
195+
"unsupported-pricing-structure"
196+
]
197+
},
198+
"primaryOffer": {
199+
"type": "null"
200+
},
201+
"offers": {
202+
"type": "array",
203+
"maxItems": 0
204+
}
205+
},
206+
"required": ["status", "reason", "primaryOffer", "offers"],
207+
"additionalProperties": false
208+
}
209+
]
210+
},
211+
"tokenPricingOffer": {
212+
"type": "object",
213+
"description": "A first-party API pricing offer for one region and service tier.",
214+
"properties": {
215+
"id": {
216+
"type": "string",
217+
"pattern": "^[a-z0-9-]+$"
218+
},
219+
"currency": {
220+
"type": "string",
221+
"pattern": "^[A-Z]{3}$",
222+
"description": "ISO 4217 currency code"
223+
},
224+
"region": {
225+
"type": "string",
226+
"pattern": "^(global|[A-Z]{2})$",
227+
"description": "global or an ISO 3166-1 alpha-2 region code"
228+
},
229+
"serviceTier": {
230+
"const": "standard"
231+
},
232+
"effectiveFrom": {
233+
"type": ["string", "null"],
234+
"format": "date"
235+
},
236+
"effectiveTo": {
237+
"type": ["string", "null"],
238+
"format": "date"
239+
},
240+
"tiers": {
241+
"type": "array",
242+
"items": {
243+
"$ref": "#/$defs/tokenPricingTier"
244+
},
245+
"minItems": 1,
246+
"uniqueItems": true
247+
}
248+
},
249+
"required": [
250+
"id",
251+
"currency",
252+
"region",
253+
"serviceTier",
254+
"effectiveFrom",
255+
"effectiveTo",
256+
"tiers"
257+
],
258+
"additionalProperties": false
259+
},
260+
"tokenPricingTier": {
261+
"type": "object",
262+
"properties": {
263+
"condition": {
264+
"oneOf": [
265+
{
266+
"type": "null"
267+
},
268+
{
269+
"$ref": "#/$defs/tokenPricingCondition"
270+
}
271+
]
272+
},
273+
"rates": {
274+
"$ref": "#/$defs/tokenPricingRates"
275+
}
276+
},
277+
"required": ["condition", "rates"],
278+
"additionalProperties": false
279+
},
280+
"tokenPricingCondition": {
281+
"type": "object",
282+
"properties": {
283+
"metric": {
284+
"type": "string",
285+
"enum": ["inputTokens", "contextTokens"]
286+
},
287+
"min": {
288+
"type": ["number", "null"],
289+
"minimum": 0
290+
},
291+
"max": {
292+
"type": ["number", "null"],
293+
"minimum": 0
294+
}
295+
},
296+
"required": ["metric", "min", "max"],
297+
"additionalProperties": false
298+
},
299+
"tokenPricingRates": {
300+
"type": "object",
301+
"properties": {
302+
"input": {
303+
"type": ["number", "null"],
304+
"minimum": 0
305+
},
306+
"output": {
307+
"type": ["number", "null"],
308+
"minimum": 0
309+
},
310+
"cacheRead": {
311+
"type": ["number", "null"],
312+
"minimum": 0
313+
},
314+
"cacheWrite": {
315+
"type": ["number", "null"],
316+
"minimum": 0
317+
}
318+
},
319+
"required": ["input", "output", "cacheRead", "cacheWrite"],
320+
"additionalProperties": false
321+
}
322+
}
154323
}

manifests/models/claude-fable-5.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,29 @@
7070
"contextWindow": 1000000,
7171
"maxOutput": 128000,
7272
"tokenPricing": {
73-
"input": 10,
74-
"output": 50,
75-
"cache": 1
73+
"status": "available",
74+
"primaryOffer": "global-standard",
75+
"offers": [
76+
{
77+
"id": "global-standard",
78+
"currency": "USD",
79+
"region": "global",
80+
"serviceTier": "standard",
81+
"effectiveFrom": null,
82+
"effectiveTo": null,
83+
"tiers": [
84+
{
85+
"condition": null,
86+
"rates": {
87+
"input": 10,
88+
"output": 50,
89+
"cacheRead": 1,
90+
"cacheWrite": null
91+
}
92+
}
93+
]
94+
}
95+
]
7696
},
7797
"releaseDate": "2026-06-09",
7898
"lifecycle": "latest",

manifests/models/claude-haiku-3-5.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,31 @@
7070
"size": null,
7171
"contextWindow": 200000,
7272
"maxOutput": null,
73-
"tokenPricing": { "input": 0.8, "output": 4, "cache": 0.08 },
73+
"tokenPricing": {
74+
"status": "available",
75+
"primaryOffer": "global-standard",
76+
"offers": [
77+
{
78+
"id": "global-standard",
79+
"currency": "USD",
80+
"region": "global",
81+
"serviceTier": "standard",
82+
"effectiveFrom": null,
83+
"effectiveTo": null,
84+
"tiers": [
85+
{
86+
"condition": null,
87+
"rates": {
88+
"input": 0.8,
89+
"output": 4,
90+
"cacheRead": 0.08,
91+
"cacheWrite": null
92+
}
93+
}
94+
]
95+
}
96+
]
97+
},
7498
"releaseDate": "2024-11-04",
7599
"lifecycle": "deprecated",
76100
"knowledgeCutoff": null,

manifests/models/claude-haiku-3.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,31 @@
7070
"size": null,
7171
"contextWindow": 200000,
7272
"maxOutput": null,
73-
"tokenPricing": { "input": 0.25, "output": 1.25, "cache": null },
73+
"tokenPricing": {
74+
"status": "available",
75+
"primaryOffer": "global-standard",
76+
"offers": [
77+
{
78+
"id": "global-standard",
79+
"currency": "USD",
80+
"region": "global",
81+
"serviceTier": "standard",
82+
"effectiveFrom": null,
83+
"effectiveTo": null,
84+
"tiers": [
85+
{
86+
"condition": null,
87+
"rates": {
88+
"input": 0.25,
89+
"output": 1.25,
90+
"cacheRead": null,
91+
"cacheWrite": null
92+
}
93+
}
94+
]
95+
}
96+
]
97+
},
7498
"releaseDate": "2024-03-13",
7599
"lifecycle": "deprecated",
76100
"knowledgeCutoff": null,

manifests/models/claude-haiku-4-5.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,29 @@
7575
"contextWindow": 200000,
7676
"maxOutput": 64000,
7777
"tokenPricing": {
78-
"input": 1,
79-
"output": 5,
80-
"cache": 0.1
78+
"status": "available",
79+
"primaryOffer": "global-standard",
80+
"offers": [
81+
{
82+
"id": "global-standard",
83+
"currency": "USD",
84+
"region": "global",
85+
"serviceTier": "standard",
86+
"effectiveFrom": null,
87+
"effectiveTo": null,
88+
"tiers": [
89+
{
90+
"condition": null,
91+
"rates": {
92+
"input": 1,
93+
"output": 5,
94+
"cacheRead": 0.1,
95+
"cacheWrite": null
96+
}
97+
}
98+
]
99+
}
100+
]
81101
},
82102
"releaseDate": "2025-10-15",
83103
"lifecycle": "latest",

manifests/models/claude-mythos-5.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,31 @@
7373
"size": null,
7474
"contextWindow": 1000000,
7575
"maxOutput": 128000,
76-
"tokenPricing": { "input": 10, "output": 50, "cache": 1 },
76+
"tokenPricing": {
77+
"status": "available",
78+
"primaryOffer": "global-standard",
79+
"offers": [
80+
{
81+
"id": "global-standard",
82+
"currency": "USD",
83+
"region": "global",
84+
"serviceTier": "standard",
85+
"effectiveFrom": null,
86+
"effectiveTo": null,
87+
"tiers": [
88+
{
89+
"condition": null,
90+
"rates": {
91+
"input": 10,
92+
"output": 50,
93+
"cacheRead": 1,
94+
"cacheWrite": null
95+
}
96+
}
97+
]
98+
}
99+
]
100+
},
77101
"releaseDate": "2026-06-09",
78102
"lifecycle": "latest",
79103
"knowledgeCutoff": "2026-01",

0 commit comments

Comments
 (0)