metergraph-core 0.8.30__tar.gz → 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {metergraph_core-0.8.30/src/metergraph_core.egg-info → metergraph_core-0.9.0}/PKG-INFO +6 -1
  2. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/README.md +5 -0
  3. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/pyproject.toml +1 -1
  4. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/__init__.py +8 -0
  5. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/calls.py +14 -2
  6. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/catalog.py +96 -3
  7. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/data/prices.yaml +365 -16
  8. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/loader.py +57 -1
  9. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/models.py +17 -1
  10. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/reliability.py +24 -0
  11. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/responses.py +2 -1
  12. {metergraph_core-0.8.30 → metergraph_core-0.9.0/src/metergraph_core.egg-info}/PKG-INFO +6 -1
  13. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/MANIFEST.in +0 -0
  14. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/setup.cfg +0 -0
  15. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/billing.py +0 -0
  16. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/catalog_delta.py +0 -0
  17. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/catalogs.py +0 -0
  18. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/data/models.yaml +0 -0
  19. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/data/sources.yaml +0 -0
  20. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/extractors.py +0 -0
  21. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/families.py +0 -0
  22. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/providers/__init__.py +0 -0
  23. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/providers/anthropic.py +0 -0
  24. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/providers/google.py +0 -0
  25. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/refresh.py +0 -0
  26. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/retrieval.py +0 -0
  27. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core/sources.py +0 -0
  28. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core.egg-info/SOURCES.txt +0 -0
  29. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core.egg-info/dependency_links.txt +0 -0
  30. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core.egg-info/requires.txt +0 -0
  31. {metergraph_core-0.8.30 → metergraph_core-0.9.0}/src/metergraph_core.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metergraph-core
3
- Version: 0.8.30
3
+ Version: 0.9.0
4
4
  Summary: Open, effective-dated LLM pricing catalog and deterministic cost calculator for popular models across major providers and gateways, including OpenAI, Anthropic, Google Gemini, AWS Bedrock, OpenRouter, Vercel AI Gateway, and more.
5
5
  Author: Metergraph
6
6
  License-Expression: Apache-2.0
@@ -61,6 +61,11 @@ The result identifies the applied model and price. Check `status` before using
61
61
  its cost as a complete total: missing usage or unsupported rates can make a
62
62
  result `partial` or `unpriced`.
63
63
 
64
+ Served OpenAI `priority`/`fast` and Vertex `priority` calls use model-specific
65
+ catalog rates where verified. Priority coverage starts on November 22, 2026.
66
+ Requested Priority that falls back to standard uses standard pricing. Search
67
+ fees are priced separately from the token tier.
68
+
64
69
  ## Choose the API for your input
65
70
 
66
71
  | You have… | Start with… |
@@ -31,6 +31,11 @@ The result identifies the applied model and price. Check `status` before using
31
31
  its cost as a complete total: missing usage or unsupported rates can make a
32
32
  result `partial` or `unpriced`.
33
33
 
34
+ Served OpenAI `priority`/`fast` and Vertex `priority` calls use model-specific
35
+ catalog rates where verified. Priority coverage starts on November 22, 2026.
36
+ Requested Priority that falls back to standard uses standard pricing. Search
37
+ fees are priced separately from the token tier.
38
+
34
39
  ## Choose the API for your input
35
40
 
36
41
  | You have… | Start with… |
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "metergraph-core"
3
- version = "0.8.30"
3
+ version = "0.9.0"
4
4
  description = "Open, effective-dated LLM pricing catalog and deterministic cost calculator for popular models across major providers and gateways, including OpenAI, Anthropic, Google Gemini, AWS Bedrock, OpenRouter, Vercel AI Gateway, and more."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -1,6 +1,10 @@
1
1
  """Reusable MeterGraph catalog and deterministic token-cost pricing core."""
2
2
 
3
3
  from .catalog import (
4
+ DECISION,
5
+ DEFAULT_MODEL_CLASS,
6
+ GENERATIVE,
7
+ MODEL_CLASSES,
4
8
  CostComponents,
5
9
  Alias,
6
10
  CatalogSnapshot,
@@ -91,6 +95,10 @@ from .sources import (
91
95
  )
92
96
 
93
97
  __all__ = [
98
+ "DECISION",
99
+ "DEFAULT_MODEL_CLASS",
100
+ "GENERATIVE",
101
+ "MODEL_CLASSES",
94
102
  "CatalogDelta",
95
103
  "CATALOG_DELTA_SCHEMA_VERSION",
96
104
  "CatalogDeltaConflict",
@@ -117,6 +117,17 @@ def compose_call_cost(
117
117
  resolved_channel = token_cost.price.pricing_channel if token_cost.price else (channel or direct_channel_for_provider(provider))
118
118
  publisher = token_cost.publisher or normalize_provider(provider or '')
119
119
  missing = list(token_cost.missing_dimensions)
120
+ fee_operation = token_cost.price.rules.get('uncaptured_fee_operation') if token_cost.price else None
121
+ if fee_operation and 'uncaptured_fees' in token_cost.reasons and any(
122
+ item.operation == fee_operation and type(item.units) is int and item.units >= 0
123
+ for item in retrieval
124
+ ):
125
+ fee = catalog.price_retrieval(channel=resolved_channel, operation=fee_operation,
126
+ units=next(item.units for item in retrieval if item.operation == fee_operation),
127
+ at=token_cost.effective_at, region=region)
128
+ if fee.status == 'priced':
129
+ reasons = tuple(reason for reason in token_cost.reasons if reason != 'uncaptured_fees')
130
+ token_cost = replace(token_cost, reasons=reasons, status='partial' if reasons or missing else 'priced')
120
131
  token_basis = ('exact' if token_cost.status == 'priced' else
121
132
  'fallback_estimate' if token_cost.cost_usd is not None else 'unknown')
122
133
  # Retrieval rates are USD. Do not add them to a different currency.
@@ -285,7 +296,7 @@ def price_call_from_record(
285
296
  if agent:
286
297
  channel = 'perplexity-agent-api'
287
298
  tier = row.get('service_tier')
288
- if token_cost is None or token_cost.effective_at is None or agent or identity_changed or tier == 'flex':
299
+ if token_cost is None or token_cost.effective_at is None or agent or identity_changed or tier in ('flex', 'priority', 'fast'):
289
300
  values = {key: row.get(key) for key in ('input_tokens', 'output_tokens', 'cache_read_tokens',
290
301
  'cache_write_tokens', 'cache_write_5m_tokens', 'cache_write_1h_tokens')}
291
302
  def cost(**usage):
@@ -305,7 +316,8 @@ def price_call_from_record(
305
316
  token_cost = replace(token_cost, status='partial',
306
317
  missing_dimensions=tuple(dict.fromkeys((*token_cost.missing_dimensions, 'incomplete_usage'))))
307
318
  flex_priced = tier == 'flex' and _supports_flex(token_cost.price)
308
- if tier is not None and tier not in ('standard', 'default', 'auto', 'batch') and not flex_priced:
319
+ priority_priced = tier in ('priority', 'fast') and 'unsupported_service_tier' not in token_cost.reasons
320
+ if tier is not None and tier not in ('standard', 'default', 'auto', 'batch') and not (flex_priced or priority_priced):
309
321
  token_cost = replace(token_cost, status='partial',
310
322
  missing_dimensions=tuple(dict.fromkeys((*token_cost.missing_dimensions, 'service_tier'))))
311
323
  model = token_cost.canonical_model or row.get('model')
@@ -61,6 +61,8 @@ _DIRECT_CHANNEL_BY_PROVIDER = {
61
61
  "mistral": "mistral-api",
62
62
  "moonshotai": "moonshot-api",
63
63
  "zai": "zai-api",
64
+ "typesafe": "typesafe-api",
65
+ "typesafe-ai": "typesafe-api",
64
66
  }
65
67
 
66
68
 
@@ -111,6 +113,18 @@ MODEL_NOT_IN_EFFECT = "model_not_in_effect"
111
113
  MODEL_NOT_IN_REGION = "model_not_in_region"
112
114
  PRICE_NOT_IN_EFFECT = "price_not_in_effect"
113
115
 
116
+ # What kind of model a catalog entry prices. A ``generative`` model writes
117
+ # output (an LLM); a ``decision`` model answers typed questions and is billed
118
+ # on input only. An entry that states none is ``generative``. The set is
119
+ # closed: a value outside it is a catalog error, never a guess.
120
+ GENERATIVE = "generative"
121
+ DECISION = "decision"
122
+ MODEL_CLASSES = (GENERATIVE, DECISION)
123
+ DEFAULT_MODEL_CLASS = GENERATIVE
124
+ # A call with no recorded provider resolves through the aliases a catalog
125
+ # lists for a provider it cannot name.
126
+ _UNKNOWN_PROVIDER_KEY = "unknown"
127
+
114
128
 
115
129
  def _bedrock_fallback_ids(model_key: str) -> tuple[tuple[str, bool], ...]:
116
130
  """Candidate ids for an unmatched Bedrock model, most specific first.
@@ -204,6 +218,8 @@ class Alias:
204
218
  source_url: str | None = None
205
219
  # Limits an identifier to matching regions; global matches every snapshot.
206
220
  price_region: tuple[str, ...] = ()
221
+ # The class of the model this alias resolves to; see MODEL_CLASSES.
222
+ model_class: str = DEFAULT_MODEL_CLASS
207
223
 
208
224
 
209
225
  def _crosses_price_region(alias: Alias) -> bool:
@@ -334,6 +350,9 @@ class CostResult:
334
350
  # Why an unpriced result is unpriced, when the cause is a value the
335
351
  # caller sent. Empty otherwise.
336
352
  warnings: tuple["PricingWarning", ...] = ()
353
+ # The class of the resolved catalog entry (see MODEL_CLASSES), or None
354
+ # when no entry resolved.
355
+ model_class: str | None = None
337
356
 
338
357
  @property
339
358
  def model_id(self) -> str | None:
@@ -413,6 +432,8 @@ class ResolvedPrice:
413
432
  rules: Mapping[str, Any]
414
433
  # The last known price: it ended before the resolved time, unreplaced.
415
434
  ended: bool = False
435
+ # The class of the resolved catalog entry; see MODEL_CLASSES.
436
+ model_class: str = DEFAULT_MODEL_CLASS
416
437
 
417
438
 
418
439
  def _billed_terms(resolved: ResolvedPrice) -> tuple[Any, ...]:
@@ -543,6 +564,17 @@ def _supports_flex(price: Price | None) -> bool:
543
564
  )
544
565
 
545
566
 
567
+ def _priority_rates(price: Price | None, at: datetime) -> Mapping[str, Any] | None:
568
+ if price is None or (price.publisher, price.pricing_channel) not in {
569
+ ("openai", "openai-api"), ("google", "google-vertex-ai"),
570
+ }:
571
+ return None
572
+ rates = price.rules.get("priority")
573
+ if not isinstance(rates, Mapping) or at < _coerce_datetime(rates["effective_from"]):
574
+ return None
575
+ return rates
576
+
577
+
546
578
  def _price_tokens(
547
579
  price: Price,
548
580
  rules: Mapping[str, Any],
@@ -578,10 +610,16 @@ def _price_tokens(
578
610
  _cached_count(cache_write_1h_tokens, "cache_write_1h_tokens", reasons) or 0
579
611
  )
580
612
  cache_write_count = cache_write_5m_count + cache_write_1h_count
613
+ # A missing count is a reason only when its rate is not exactly zero,
614
+ # which is known once the effective rates are; its place among the
615
+ # reasons is kept so results read as they always have.
616
+ input_missing_at = output_missing_at = None
581
617
  if input_count is None:
618
+ input_missing_at = len(reasons)
582
619
  reasons.append("missing_input_tokens")
583
620
  input_count = 0
584
621
  if output_count is None:
622
+ output_missing_at = len(reasons)
585
623
  reasons.append("missing_output_tokens")
586
624
  output_count = 0
587
625
 
@@ -614,7 +652,20 @@ def _price_tokens(
614
652
  "google-api", "google-vertex-ai",
615
653
  }
616
654
  openai_flex = flex and price.publisher == "openai" and price.pricing_channel == "openai-api"
617
- if service_tier not in (None, "standard", "default", "standard_only", "auto", "on_demand", "batch") and not (google_flex or openai_flex):
655
+ priority = service_tier in ("priority", "fast")
656
+ priority_rates = _priority_rates(price, at) if priority and not batch else None
657
+ if priority_rates is not None:
658
+ limit = priority_rates.get("max_input_tokens")
659
+ if limit is not None and input_count > limit:
660
+ priority_rates = None
661
+ else:
662
+ input_rate, output_rate, cache_read_rate, cache_write_5m_rate, cache_write_1h_rate = (
663
+ _decimal(priority_rates.get(key)) for key in (
664
+ "input_per_mtok", "output_per_mtok", "cache_read_per_mtok",
665
+ "cache_write_5m_per_mtok", "cache_write_1h_per_mtok",
666
+ )
667
+ )
668
+ if service_tier not in (None, "standard", "default", "standard_only", "auto", "on_demand", "batch") and not (google_flex or openai_flex or priority_rates is not None):
618
669
  reasons.append("unsupported_service_tier")
619
670
  if google_flex:
620
671
  # Google publishes Flex at half the standard token rates, including cache reads.
@@ -684,6 +735,24 @@ def _price_tokens(
684
735
  input_multiplier *= off_peak
685
736
  output_multiplier *= off_peak
686
737
 
738
+ # A usage component whose effective rate is exactly zero costs nothing
739
+ # whatever its count, so an absent count leaves the figure complete: a
740
+ # model billed on input alone is priced without output usage. An
741
+ # unknown rate (None) never qualifies. Missing input also keeps its
742
+ # reason when a long-context tier would read the count it lacks.
743
+ exempt = []
744
+ if output_missing_at is not None and output_rate is not None and output_rate == 0:
745
+ exempt.append(output_missing_at)
746
+ if (
747
+ input_missing_at is not None
748
+ and input_rate is not None
749
+ and input_rate == 0
750
+ and threshold is None
751
+ ):
752
+ exempt.append(input_missing_at)
753
+ for index in sorted(exempt, reverse=True):
754
+ del reasons[index]
755
+
687
756
  input_usd = output_usd = cache_read_usd = cache_write_usd = Decimal("0")
688
757
  if input_rate is None:
689
758
  if billable_input:
@@ -792,6 +861,7 @@ def _cost_result(
792
861
  currency=resolved.price.currency,
793
862
  effective_at=at,
794
863
  missing_dimensions=missing,
864
+ model_class=resolved.model_class,
795
865
  )
796
866
 
797
867
 
@@ -993,6 +1063,7 @@ class CatalogSnapshot:
993
1063
  price=price,
994
1064
  rules=MappingProxyType({**price.rules, **alias.rules}),
995
1065
  ended=ended,
1066
+ model_class=alias.model_class,
996
1067
  )
997
1068
 
998
1069
  def _lookup(
@@ -1009,7 +1080,13 @@ class CatalogSnapshot:
1009
1080
  some region prices is unpriced with ``region`` missing.
1010
1081
  """
1011
1082
  if channel is None or not str(channel).strip():
1012
- channel = direct_channel_for_provider(provider)
1083
+ if provider is None or not str(provider).strip():
1084
+ # No recorded provider is as much as an unknown one: such a
1085
+ # call resolves only through the aliases listed for provider
1086
+ # "unknown", as in :meth:`cost`.
1087
+ channel = self._unknown_provider_channel(model, at)
1088
+ else:
1089
+ channel = direct_channel_for_provider(provider)
1013
1090
  if channel is None:
1014
1091
  return None, ("channel",)
1015
1092
  stated = str(region or "").strip().lower() or None
@@ -1030,6 +1107,14 @@ class CatalogSnapshot:
1030
1107
  return resolved, ("region",)
1031
1108
  return resolved, ()
1032
1109
 
1110
+ def _unknown_provider_channel(self, model: Any, at: Any) -> str | None:
1111
+ """The pricing channel of the alias listed for provider "unknown"
1112
+ that names ``model`` at ``at``, or None when there is none."""
1113
+ model_key = str(model or "").strip().lower()
1114
+ candidates = self._aliases.get((_UNKNOWN_PROVIDER_KEY, model_key), ())
1115
+ alias = self._alias_for(candidates, _coerce_datetime(at))
1116
+ return alias.pricing_channel if alias is not None else None
1117
+
1033
1118
  def _explain(
1034
1119
  self, *, model: Any, channel: Any, provider: Any, at: Any, region: Any
1035
1120
  ) -> tuple[PricingWarning, ...]:
@@ -1187,6 +1272,9 @@ class CatalogSnapshot:
1187
1272
  ) -> CostResult:
1188
1273
  provider_key = str(provider or "").strip().lower()
1189
1274
  provider_key = _PROVIDER_ALIASES.get(provider_key, provider_key)
1275
+ # No recorded provider is as much as an unknown one: such a call
1276
+ # resolves only through the aliases listed for provider "unknown".
1277
+ provider_key = provider_key or _UNKNOWN_PROVIDER_KEY
1190
1278
  model_key = str(model or "").strip().lower()
1191
1279
  when = _coerce_datetime(at)
1192
1280
  candidates = self._aliases.get((provider_key, model_key), ())
@@ -1220,10 +1308,15 @@ class CatalogSnapshot:
1220
1308
  None,
1221
1309
  "unpriced",
1222
1310
  ("no_effective_price",),
1311
+ model_class=alias.model_class,
1223
1312
  )
1224
1313
  return _cost_result(
1225
1314
  ResolvedPrice(
1226
- alias.canonical_id, price, {**price.rules, **alias.rules}, ended=ended
1315
+ alias.canonical_id,
1316
+ price,
1317
+ {**price.rules, **alias.rules},
1318
+ ended=ended,
1319
+ model_class=alias.model_class,
1227
1320
  ),
1228
1321
  at=when,
1229
1322
  usage=ModelUsage(
@@ -6,9 +6,9 @@
6
6
  #
7
7
  # Community updates welcome: add an alias or price entry with its provider
8
8
  # source_url and open a PR. CI validates structure and date overlaps.
9
- version: "2026-11-20"
9
+ version: "2026-11-22.1"
10
10
  currency: USD
11
- pricing_verified_at: "2026-11-20"
11
+ pricing_verified_at: "2026-11-22"
12
12
  models:
13
13
  - canonical_id: openai/gpt-6-sol
14
14
  publisher: openai
@@ -48,7 +48,17 @@ models:
48
48
  batch_output_per_mtok: 5.00
49
49
  rules:
50
50
  input_includes_cache_read: true
51
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
51
+ long_context:
52
+ threshold: 272000
53
+ input_multiplier: 2
54
+ output_multiplier: 1.5
55
+ priority:
56
+ effective_from: '2026-11-22'
57
+ input_per_mtok: 4.0
58
+ output_per_mtok: 20.0
59
+ cache_read_per_mtok: 0.4
60
+ cache_write_5m_per_mtok: 5.0
61
+ cache_write_1h_per_mtok: 10.0
52
62
  source_url: https://developers.openai.com/api/docs/models/gpt-6-sol
53
63
  - channel: vercel-ai-gateway
54
64
  region: global
@@ -142,7 +152,17 @@ models:
142
152
  batch_output_per_mtok: 0.25
143
153
  rules:
144
154
  input_includes_cache_read: true
145
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
155
+ long_context:
156
+ threshold: 272000
157
+ input_multiplier: 2
158
+ output_multiplier: 1.5
159
+ priority:
160
+ effective_from: '2026-11-22'
161
+ input_per_mtok: 0.2
162
+ output_per_mtok: 1.0
163
+ cache_read_per_mtok: 0.02
164
+ cache_write_5m_per_mtok: 0.25
165
+ cache_write_1h_per_mtok: 0.5
146
166
  source_url: https://developers.openai.com/api/docs/models/gpt-6-luna
147
167
  - channel: vercel-ai-gateway
148
168
  region: global
@@ -236,7 +256,17 @@ models:
236
256
  batch_output_per_mtok: 25.00
237
257
  rules:
238
258
  input_includes_cache_read: true
239
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
259
+ long_context:
260
+ threshold: 272000
261
+ input_multiplier: 2
262
+ output_multiplier: 1.5
263
+ priority:
264
+ effective_from: '2026-11-22'
265
+ input_per_mtok: 20.0
266
+ output_per_mtok: 100.0
267
+ cache_read_per_mtok: 2.0
268
+ cache_write_5m_per_mtok: 25.0
269
+ cache_write_1h_per_mtok: 50.0
240
270
  source_url: https://developers.openai.com/api/docs/models/gpt-6-astra
241
271
  - channel: vercel-ai-gateway
242
272
  region: global
@@ -341,7 +371,17 @@ models:
341
371
  batch_input_per_mtok: 1.00
342
372
  batch_output_per_mtok: 5.00
343
373
  rules:
344
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
374
+ long_context:
375
+ threshold: 272000
376
+ input_multiplier: 2
377
+ output_multiplier: 1.5
378
+ priority:
379
+ effective_from: '2026-11-22'
380
+ input_per_mtok: 4.0
381
+ output_per_mtok: 20.0
382
+ cache_read_per_mtok: 0.2
383
+ cache_write_5m_per_mtok: 5.0
384
+ cache_write_1h_per_mtok: 10.0
345
385
  source_url: https://developers.openai.com/api/docs/models/gpt-6.1-sol
346
386
  # The 5m field stores AWS's unsplit cache-write rate.
347
387
  - channel: aws-bedrock-geo
@@ -426,7 +466,17 @@ models:
426
466
  rules:
427
467
  input_includes_cache_read: true
428
468
  input_includes_cache_write: true
429
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
469
+ long_context:
470
+ threshold: 272000
471
+ input_multiplier: 2
472
+ output_multiplier: 1.5
473
+ priority:
474
+ effective_from: '2026-11-22'
475
+ input_per_mtok: 2.0
476
+ output_per_mtok: 10.0
477
+ cache_read_per_mtok: 0.1
478
+ cache_write_5m_per_mtok: 2.5
479
+ cache_write_1h_per_mtok: 5.0
430
480
  source_url: https://developers.openai.com/api/docs/models/gpt-6.1-terra
431
481
  - channel: openrouter-api
432
482
  region: global
@@ -481,7 +531,17 @@ models:
481
531
  rules:
482
532
  input_includes_cache_read: true
483
533
  input_includes_cache_write: true
484
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
534
+ long_context:
535
+ threshold: 272000
536
+ input_multiplier: 2
537
+ output_multiplier: 1.5
538
+ priority:
539
+ effective_from: '2026-11-22'
540
+ input_per_mtok: 4.0
541
+ output_per_mtok: 20.0
542
+ cache_read_per_mtok: 0.2
543
+ cache_write_5m_per_mtok: 5.0
544
+ cache_write_1h_per_mtok: 10.0
485
545
  source_url: https://developers.openai.com/api/docs/models/gpt-6.2-sol
486
546
  - channel: vercel-ai-gateway
487
547
  region: global
@@ -525,7 +585,17 @@ models:
525
585
  rules:
526
586
  input_includes_cache_read: true
527
587
  input_includes_cache_write: true
528
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
588
+ long_context:
589
+ threshold: 272000
590
+ input_multiplier: 2
591
+ output_multiplier: 1.5
592
+ priority:
593
+ effective_from: '2026-11-22'
594
+ input_per_mtok: 16.0
595
+ output_per_mtok: 80.0
596
+ cache_read_per_mtok: 0.8
597
+ cache_write_5m_per_mtok: 20.0
598
+ cache_write_1h_per_mtok: 40.0
529
599
  source_url: https://developers.openai.com/api/docs/models/gpt-6.2-astra
530
600
  - channel: vercel-ai-gateway
531
601
  region: global
@@ -593,7 +663,17 @@ models:
593
663
  batch_output_per_mtok: 10.00
594
664
  rules:
595
665
  input_includes_cache_read: true
596
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
666
+ long_context:
667
+ threshold: 272000
668
+ input_multiplier: 2
669
+ output_multiplier: 1.5
670
+ priority:
671
+ effective_from: '2026-11-22'
672
+ input_per_mtok: 8.0
673
+ output_per_mtok: 40.0
674
+ cache_read_per_mtok: 0.8
675
+ cache_write_5m_per_mtok: 10.0
676
+ cache_write_1h_per_mtok: 20.0
597
677
  source_url: https://developers.openai.com/api/docs/models/gpt-5.6-sol
598
678
  - channel: vercel-ai-gateway
599
679
  region: global
@@ -702,7 +782,17 @@ models:
702
782
  batch_output_per_mtok: 6.00
703
783
  rules:
704
784
  input_includes_cache_read: true
705
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
785
+ long_context:
786
+ threshold: 272000
787
+ input_multiplier: 2
788
+ output_multiplier: 1.5
789
+ priority:
790
+ effective_from: '2026-11-22'
791
+ input_per_mtok: 4.0
792
+ output_per_mtok: 24.0
793
+ cache_read_per_mtok: 0.4
794
+ cache_write_5m_per_mtok: 5.0
795
+ cache_write_1h_per_mtok: 10.0
706
796
  source_url: https://developers.openai.com/api/docs/pricing
707
797
  - channel: vercel-ai-gateway
708
798
  region: global
@@ -786,7 +876,17 @@ models:
786
876
  batch_output_per_mtok: 0.60
787
877
  rules:
788
878
  input_includes_cache_read: true
789
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
879
+ long_context:
880
+ threshold: 272000
881
+ input_multiplier: 2
882
+ output_multiplier: 1.5
883
+ priority:
884
+ effective_from: '2026-11-22'
885
+ input_per_mtok: 0.4
886
+ output_per_mtok: 2.4
887
+ cache_read_per_mtok: 0.04
888
+ cache_write_5m_per_mtok: 0.5
889
+ cache_write_1h_per_mtok: 1.0
790
890
  source_url: https://developers.openai.com/api/docs/pricing
791
891
  - channel: vercel-ai-gateway
792
892
  region: global
@@ -863,6 +963,11 @@ models:
863
963
  batch_output_per_mtok: 2.25
864
964
  rules:
865
965
  input_includes_cache_read: true
966
+ priority:
967
+ effective_from: '2026-11-22'
968
+ input_per_mtok: 1.5
969
+ output_per_mtok: 9.0
970
+ cache_read_per_mtok: 0.15
866
971
  source_url: https://developers.openai.com/api/docs/models/gpt-5.4-mini
867
972
  - channel: vercel-ai-gateway
868
973
  region: global
@@ -908,7 +1013,16 @@ models:
908
1013
  batch_output_per_mtok: 7.50
909
1014
  rules:
910
1015
  input_includes_cache_read: true
911
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
1016
+ long_context:
1017
+ threshold: 272000
1018
+ input_multiplier: 2
1019
+ output_multiplier: 1.5
1020
+ priority:
1021
+ effective_from: '2026-11-22'
1022
+ input_per_mtok: 5.0
1023
+ output_per_mtok: 30.0
1024
+ cache_read_per_mtok: 0.5
1025
+ max_input_tokens: 272000
912
1026
  source_url: https://developers.openai.com/api/docs/models/gpt-5.4
913
1027
 
914
1028
  - channel: vercel-ai-gateway
@@ -1021,6 +1135,11 @@ models:
1021
1135
  batch_output_per_mtok: 0.30
1022
1136
  rules:
1023
1137
  input_includes_cache_read: true
1138
+ priority:
1139
+ effective_from: '2026-11-22'
1140
+ input_per_mtok: 0.25
1141
+ output_per_mtok: 1.0
1142
+ cache_read_per_mtok: 0.125
1024
1143
  source_url: https://developers.openai.com/api/docs/models/gpt-4o-mini
1025
1144
  - channel: vercel-ai-gateway
1026
1145
  region: global
@@ -1078,6 +1197,11 @@ models:
1078
1197
  batch_output_per_mtok: 5.00
1079
1198
  rules:
1080
1199
  input_includes_cache_read: true
1200
+ priority:
1201
+ effective_from: '2026-11-22'
1202
+ input_per_mtok: 4.25
1203
+ output_per_mtok: 17.0
1204
+ cache_read_per_mtok: 2.125
1081
1205
  source_url: https://developers.openai.com/api/docs/models/gpt-4o
1082
1206
  - channel: vercel-ai-gateway
1083
1207
  region: global
@@ -1123,6 +1247,11 @@ models:
1123
1247
  batch_output_per_mtok: 4.00
1124
1248
  rules:
1125
1249
  input_includes_cache_read: true
1250
+ priority:
1251
+ effective_from: '2026-11-22'
1252
+ input_per_mtok: 3.5
1253
+ output_per_mtok: 14.0
1254
+ cache_read_per_mtok: 0.875
1126
1255
  source_url: https://developers.openai.com/api/docs/models/gpt-4.1
1127
1256
 
1128
1257
  - channel: vercel-ai-gateway
@@ -1166,6 +1295,11 @@ models:
1166
1295
  batch_output_per_mtok: 0.80
1167
1296
  rules:
1168
1297
  input_includes_cache_read: true
1298
+ priority:
1299
+ effective_from: '2026-11-22'
1300
+ input_per_mtok: 0.7
1301
+ output_per_mtok: 2.8
1302
+ cache_read_per_mtok: 0.175
1169
1303
  source_url: https://developers.openai.com/api/docs/models/gpt-4.1-mini
1170
1304
  - channel: vercel-ai-gateway
1171
1305
  region: global
@@ -1254,6 +1388,11 @@ models:
1254
1388
  batch_output_per_mtok: 7.00
1255
1389
  rules:
1256
1390
  input_includes_cache_read: true
1391
+ priority:
1392
+ effective_from: '2026-11-22'
1393
+ input_per_mtok: 3.5
1394
+ output_per_mtok: 28.0
1395
+ cache_read_per_mtok: 0.35
1257
1396
  source_url: https://developers.openai.com/api/docs/models/gpt-5.2
1258
1397
  - channel: vercel-ai-gateway
1259
1398
  region: global
@@ -2203,7 +2342,15 @@ models:
2203
2342
  batch_input_per_mtok: 1.00
2204
2343
  batch_output_per_mtok: 6.00
2205
2344
  rules:
2206
- long_context: {threshold: 200000, input_multiplier: 2, output_multiplier: 1.5}
2345
+ long_context:
2346
+ threshold: 200000
2347
+ input_multiplier: 2
2348
+ output_multiplier: 1.5
2349
+ priority:
2350
+ effective_from: '2026-11-22'
2351
+ input_per_mtok: 3.6
2352
+ output_per_mtok: 21.6
2353
+ cache_read_per_mtok: 0.36
2207
2354
  source_url: https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing
2208
2355
  - channel: vercel-ai-gateway
2209
2356
  region: global
@@ -2241,6 +2388,12 @@ models:
2241
2388
  batch_input_per_mtok: 1.00
2242
2389
  batch_output_per_mtok: 5.00
2243
2390
  batch_cache_read_per_mtok: 0.05
2391
+ rules:
2392
+ priority:
2393
+ effective_from: '2026-11-22'
2394
+ input_per_mtok: 3.6
2395
+ output_per_mtok: 18.0
2396
+ cache_read_per_mtok: 0.18
2244
2397
  source_url: https://cloud.google.com/model-garden/pricing
2245
2398
  - channel: google-vertex-ai
2246
2399
  region: global
@@ -2251,6 +2404,12 @@ models:
2251
2404
  batch_input_per_mtok: 2.00
2252
2405
  batch_output_per_mtok: 10.00
2253
2406
  batch_cache_read_per_mtok: 0.10
2407
+ rules:
2408
+ priority:
2409
+ effective_from: '2026-11-22'
2410
+ input_per_mtok: 7.2
2411
+ output_per_mtok: 36.0
2412
+ cache_read_per_mtok: 0.36
2254
2413
  source_url: https://cloud.google.com/model-garden/pricing
2255
2414
  - channel: google-api
2256
2415
  region: global
@@ -2360,6 +2519,12 @@ models:
2360
2519
  cache_read_per_mtok: 0.15
2361
2520
  batch_input_per_mtok: 0.75
2362
2521
  batch_output_per_mtok: 4.50
2522
+ rules:
2523
+ priority:
2524
+ effective_from: '2026-11-22'
2525
+ input_per_mtok: 2.7
2526
+ output_per_mtok: 16.2
2527
+ cache_read_per_mtok: 0.27
2363
2528
  source_url: https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing
2364
2529
 
2365
2530
  # Direct API only: no Vertex rate is published for this model.
@@ -3331,7 +3496,13 @@ models:
3331
3496
  cache_read_per_mtok: 0.025
3332
3497
  batch_input_per_mtok: 0.125
3333
3498
  batch_output_per_mtok: 1.00
3334
- rules: {input_includes_cache_read: true}
3499
+ rules:
3500
+ input_includes_cache_read: true
3501
+ priority:
3502
+ effective_from: '2026-11-22'
3503
+ input_per_mtok: 0.45
3504
+ output_per_mtok: 3.6
3505
+ cache_read_per_mtok: 0.045
3335
3506
  source_url: https://developers.openai.com/api/docs/models/gpt-5-mini
3336
3507
  - channel: vercel-ai-gateway
3337
3508
  region: global
@@ -3425,6 +3596,12 @@ models:
3425
3596
  input_per_mtok: 0.75
3426
3597
  output_per_mtok: 3.75
3427
3598
  cache_read_per_mtok: 0.075
3599
+ rules:
3600
+ priority:
3601
+ effective_from: '2026-11-22'
3602
+ input_per_mtok: 1.35
3603
+ output_per_mtok: 6.75
3604
+ cache_read_per_mtok: 0.135
3428
3605
  source_url: https://cloud.google.com/vertex-ai/generative-ai/pricing
3429
3606
  - channel: google-vertex-ai
3430
3607
  region: global
@@ -3432,6 +3609,12 @@ models:
3432
3609
  input_per_mtok: 1.50
3433
3610
  output_per_mtok: 7.50
3434
3611
  cache_read_per_mtok: 0.15
3612
+ rules:
3613
+ priority:
3614
+ effective_from: '2026-11-22'
3615
+ input_per_mtok: 2.7
3616
+ output_per_mtok: 13.5
3617
+ cache_read_per_mtok: 0.27
3435
3618
  source_url: https://cloud.google.com/vertex-ai/generative-ai/pricing
3436
3619
  - channel: google-api
3437
3620
  region: global
@@ -3524,6 +3707,12 @@ models:
3524
3707
  input_per_mtok: 0.75
3525
3708
  output_per_mtok: 3.75
3526
3709
  cache_read_per_mtok: 0.075
3710
+ rules:
3711
+ priority:
3712
+ effective_from: '2026-11-22'
3713
+ input_per_mtok: 1.35
3714
+ output_per_mtok: 6.75
3715
+ cache_read_per_mtok: 0.135
3527
3716
  source_url: https://cloud.google.com/vertex-ai/generative-ai/pricing
3528
3717
  - channel: google-vertex-ai
3529
3718
  region: global
@@ -3531,6 +3720,12 @@ models:
3531
3720
  input_per_mtok: 1.50
3532
3721
  output_per_mtok: 7.50
3533
3722
  cache_read_per_mtok: 0.15
3723
+ rules:
3724
+ priority:
3725
+ effective_from: '2026-11-22'
3726
+ input_per_mtok: 2.7
3727
+ output_per_mtok: 13.5
3728
+ cache_read_per_mtok: 0.27
3534
3729
  source_url: https://cloud.google.com/vertex-ai/generative-ai/pricing
3535
3730
  - channel: vercel-ai-gateway
3536
3731
  region: global
@@ -3596,6 +3791,12 @@ models:
3596
3791
  input_per_mtok: 0.75
3597
3792
  output_per_mtok: 3.75
3598
3793
  cache_read_per_mtok: 0.075
3794
+ rules:
3795
+ priority:
3796
+ effective_from: '2026-11-22'
3797
+ input_per_mtok: 1.35
3798
+ output_per_mtok: 6.75
3799
+ cache_read_per_mtok: 0.135
3599
3800
  source_url: https://cloud.google.com/vertex-ai/generative-ai/pricing
3600
3801
  - channel: google-vertex-ai
3601
3802
  region: global
@@ -3603,6 +3804,12 @@ models:
3603
3804
  input_per_mtok: 1.50
3604
3805
  output_per_mtok: 7.50
3605
3806
  cache_read_per_mtok: 0.15
3807
+ rules:
3808
+ priority:
3809
+ effective_from: '2026-11-22'
3810
+ input_per_mtok: 2.7
3811
+ output_per_mtok: 13.5
3812
+ cache_read_per_mtok: 0.27
3606
3813
  source_url: https://cloud.google.com/vertex-ai/generative-ai/pricing
3607
3814
  # The gateway publishes no end date for this rate. Google's direct rate
3608
3815
  # doubles on 2027-01-01; if the gateway follows, this row needs an
@@ -3851,19 +4058,127 @@ models:
3851
4058
 
3852
4059
  - canonical_id: typesafe-ai/jev-1.13.0
3853
4060
  publisher: typesafe-ai
4061
+ family: {id: typesafe-ai/jev, display_name: Jev}
4062
+ model_class: decision
4063
+ # A decision model: billed per input token, output is free. Its calls
4064
+ # usually report no output usage, which a zero output rate does not need.
3854
4065
  aliases:
3855
4066
  - {provider: typesafe-ai, alias: typesafe-ai/jev-1.13.0, channel: vercel-ai-gateway}
3856
4067
  - {provider: vercel, alias: typesafe-ai/jev-1.13.0, channel: vercel-ai-gateway}
3857
4068
  - {provider: unknown, alias: typesafe/jev-1.13.0, channel: vercel-ai-gateway}
3858
4069
  - {provider: unknown, alias: jev-1.13.0, channel: vercel-ai-gateway}
4070
+ - {provider: vercel, alias: typesafe/jev-1.13.0, channel: vercel-ai-gateway}
4071
+ - {provider: vercel, alias: jev-1.13.0, channel: vercel-ai-gateway}
4072
+ - {provider: gateway, alias: typesafe-ai/jev-1.13.0, channel: vercel-ai-gateway}
4073
+ - {provider: gateway, alias: typesafe/jev-1.13.0, channel: vercel-ai-gateway}
4074
+ - {provider: gateway, alias: jev-1.13.0, channel: vercel-ai-gateway}
4075
+ - {provider: typesafe, alias: jev-1.13.0, channel: typesafe-api}
4076
+ - {provider: typesafe, alias: typesafe/jev-1.13.0, channel: typesafe-api}
4077
+ - {provider: typesafe, alias: typesafe-ai/jev-1.13.0, channel: typesafe-api}
4078
+ - {provider: typesafe-ai, alias: jev-1.13.0, channel: typesafe-api}
4079
+ - {provider: typesafe-ai, alias: typesafe/jev-1.13.0, channel: typesafe-api}
4080
+ - {provider: unknown, alias: typesafe-ai/jev-1.13.0, channel: vercel-ai-gateway}
3859
4081
  prices:
3860
4082
  # Vercel lists an input rate and no output fee for this decision model.
3861
4083
  - channel: vercel-ai-gateway
3862
4084
  region: global
3863
4085
  effective_from: "2026-09-15"
4086
+ effective_to: "2026-11-21"
3864
4087
  input_per_mtok: 0.04
3865
4088
  output_per_mtok: 0
3866
4089
  source_url: https://vercel.com/ai-gateway/models/jev-1.13.0
4090
+ - channel: vercel-ai-gateway
4091
+ region: global
4092
+ effective_from: "2026-11-21"
4093
+ input_per_mtok: 0.042
4094
+ output_per_mtok: 0
4095
+ source_url: https://vercel.com/ai-gateway/models/typesafe-ai/jev
4096
+ - channel: typesafe-api
4097
+ region: global
4098
+ effective_from: "2026-11-21"
4099
+ input_per_mtok: 0.042
4100
+ output_per_mtok: 0
4101
+ source_url: https://docs.typesafe.ai/models
4102
+
4103
+ - canonical_id: typesafe-ai/jev-1.14.0
4104
+ publisher: typesafe-ai
4105
+ family: {id: typesafe-ai/jev, display_name: Jev}
4106
+ model_class: decision
4107
+ aliases:
4108
+ - {provider: vercel, alias: typesafe-ai/jev-1.14.0, channel: vercel-ai-gateway}
4109
+ - {provider: vercel, alias: typesafe/jev-1.14.0, channel: vercel-ai-gateway}
4110
+ - {provider: vercel, alias: jev-1.14.0, channel: vercel-ai-gateway}
4111
+ - {provider: gateway, alias: typesafe-ai/jev-1.14.0, channel: vercel-ai-gateway}
4112
+ - {provider: gateway, alias: typesafe/jev-1.14.0, channel: vercel-ai-gateway}
4113
+ - {provider: gateway, alias: jev-1.14.0, channel: vercel-ai-gateway}
4114
+ - {provider: typesafe, alias: jev-1.14.0, channel: typesafe-api}
4115
+ - {provider: typesafe, alias: typesafe/jev-1.14.0, channel: typesafe-api}
4116
+ - {provider: typesafe, alias: typesafe-ai/jev-1.14.0, channel: typesafe-api}
4117
+ - {provider: typesafe-ai, alias: typesafe-ai/jev-1.14.0, channel: vercel-ai-gateway}
4118
+ - {provider: typesafe-ai, alias: jev-1.14.0, channel: typesafe-api}
4119
+ - {provider: typesafe-ai, alias: typesafe/jev-1.14.0, channel: typesafe-api}
4120
+ - {provider: unknown, alias: typesafe-ai/jev-1.14.0, channel: vercel-ai-gateway}
4121
+ - {provider: unknown, alias: typesafe/jev-1.14.0, channel: vercel-ai-gateway}
4122
+ - {provider: unknown, alias: jev-1.14.0, channel: vercel-ai-gateway}
4123
+ prices:
4124
+ - channel: vercel-ai-gateway
4125
+ region: global
4126
+ effective_from: "2026-11-21"
4127
+ input_per_mtok: 0.042
4128
+ output_per_mtok: 0
4129
+ source_url: https://vercel.com/ai-gateway/models/typesafe-ai/jev
4130
+ - channel: typesafe-api
4131
+ region: global
4132
+ effective_from: "2026-11-21"
4133
+ input_per_mtok: 0.042
4134
+ output_per_mtok: 0
4135
+ source_url: https://docs.typesafe.ai/models
4136
+
4137
+ - canonical_id: typesafe-ai/jev
4138
+ publisher: typesafe-ai
4139
+ family: {id: typesafe-ai/jev, display_name: Jev}
4140
+ model_class: decision
4141
+ # The version-neutral ids: the gateway's typesafe-ai/jev, and the
4142
+ # direct API's moving aliases. Every version is listed at one price.
4143
+ aliases:
4144
+ - {provider: vercel, alias: typesafe-ai/jev, channel: vercel-ai-gateway}
4145
+ - {provider: vercel, alias: typesafe/jev, channel: vercel-ai-gateway}
4146
+ - {provider: vercel, alias: jev, channel: vercel-ai-gateway}
4147
+ - {provider: vercel, alias: jev-latest, channel: vercel-ai-gateway}
4148
+ - {provider: vercel, alias: jev-preview, channel: vercel-ai-gateway}
4149
+ - {provider: gateway, alias: typesafe-ai/jev, channel: vercel-ai-gateway}
4150
+ - {provider: gateway, alias: typesafe/jev, channel: vercel-ai-gateway}
4151
+ - {provider: gateway, alias: jev, channel: vercel-ai-gateway}
4152
+ - {provider: gateway, alias: jev-latest, channel: vercel-ai-gateway}
4153
+ - {provider: gateway, alias: jev-preview, channel: vercel-ai-gateway}
4154
+ - {provider: typesafe, alias: jev, channel: typesafe-api}
4155
+ - {provider: typesafe, alias: jev-latest, channel: typesafe-api}
4156
+ - {provider: typesafe, alias: jev-preview, channel: typesafe-api}
4157
+ - {provider: typesafe, alias: typesafe/jev, channel: typesafe-api}
4158
+ - {provider: typesafe, alias: typesafe-ai/jev, channel: typesafe-api}
4159
+ - {provider: typesafe-ai, alias: typesafe-ai/jev, channel: vercel-ai-gateway}
4160
+ - {provider: typesafe-ai, alias: jev, channel: typesafe-api}
4161
+ - {provider: typesafe-ai, alias: jev-latest, channel: typesafe-api}
4162
+ - {provider: typesafe-ai, alias: jev-preview, channel: typesafe-api}
4163
+ - {provider: typesafe-ai, alias: typesafe/jev, channel: typesafe-api}
4164
+ - {provider: unknown, alias: typesafe-ai/jev, channel: vercel-ai-gateway}
4165
+ - {provider: unknown, alias: typesafe/jev, channel: vercel-ai-gateway}
4166
+ - {provider: unknown, alias: jev, channel: vercel-ai-gateway}
4167
+ - {provider: unknown, alias: jev-latest, channel: vercel-ai-gateway}
4168
+ - {provider: unknown, alias: jev-preview, channel: vercel-ai-gateway}
4169
+ prices:
4170
+ - channel: vercel-ai-gateway
4171
+ region: global
4172
+ effective_from: "2026-11-21"
4173
+ input_per_mtok: 0.042
4174
+ output_per_mtok: 0
4175
+ source_url: https://vercel.com/ai-gateway/models/typesafe-ai/jev
4176
+ - channel: typesafe-api
4177
+ region: global
4178
+ effective_from: "2026-11-21"
4179
+ input_per_mtok: 0.042
4180
+ output_per_mtok: 0
4181
+ source_url: https://docs.typesafe.ai/models
3867
4182
 
3868
4183
  - canonical_id: thinkingmachines/inkling
3869
4184
  publisher: thinkingmachines
@@ -6174,6 +6489,12 @@ models:
6174
6489
  cache_read_per_mtok: 0.125
6175
6490
  batch_input_per_mtok: 0.625
6176
6491
  batch_output_per_mtok: 5
6492
+ rules:
6493
+ priority:
6494
+ effective_from: '2026-11-22'
6495
+ input_per_mtok: 2.5
6496
+ output_per_mtok: 20.0
6497
+ cache_read_per_mtok: 0.25
6177
6498
  source_url: https://developers.openai.com/api/docs/models/gpt-5
6178
6499
  - channel: vercel-ai-gateway
6179
6500
  region: global
@@ -6308,7 +6629,16 @@ models:
6308
6629
  batch_input_per_mtok: 2.5
6309
6630
  batch_output_per_mtok: 15
6310
6631
  rules:
6311
- long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
6632
+ long_context:
6633
+ threshold: 272000
6634
+ input_multiplier: 2
6635
+ output_multiplier: 1.5
6636
+ priority:
6637
+ effective_from: '2026-11-22'
6638
+ input_per_mtok: 12.5
6639
+ output_per_mtok: 75.0
6640
+ cache_read_per_mtok: 1.25
6641
+ max_input_tokens: 272000
6312
6642
  source_url: https://developers.openai.com/api/docs/models/gpt-5.5
6313
6643
  - channel: vercel-ai-gateway
6314
6644
  region: global
@@ -12848,6 +13178,12 @@ models:
12848
13178
  batch_input_per_mtok: 0.625
12849
13179
  batch_output_per_mtok: 5
12850
13180
  batch_cache_read_per_mtok: 0.0625
13181
+ rules:
13182
+ priority:
13183
+ effective_from: '2026-11-22'
13184
+ input_per_mtok: 2.5
13185
+ output_per_mtok: 20.0
13186
+ cache_read_per_mtok: 0.25
12851
13187
  source_url: https://developers.openai.com/api/docs/models/gpt-5.1
12852
13188
  - channel: vercel-ai-gateway
12853
13189
  region: global
@@ -13005,6 +13341,12 @@ models:
13005
13341
  batch_input_per_mtok: 1
13006
13342
  batch_output_per_mtok: 4
13007
13343
  batch_cache_read_per_mtok: 0.25
13344
+ rules:
13345
+ priority:
13346
+ effective_from: '2026-11-22'
13347
+ input_per_mtok: 3.5
13348
+ output_per_mtok: 14.0
13349
+ cache_read_per_mtok: 0.875
13008
13350
  source_url: https://developers.openai.com/api/docs/models/o3
13009
13351
  - channel: vercel-ai-gateway
13010
13352
  region: global
@@ -13224,6 +13566,7 @@ models:
13224
13566
  cache_read_per_mtok: 0.125
13225
13567
  rules:
13226
13568
  uncaptured_fees: true
13569
+ uncaptured_fee_operation: web_search
13227
13570
  source_url: https://developers.openai.com/api/docs/pricing
13228
13571
 
13229
13572
  - canonical_id: openai/gpt-5-codex
@@ -13977,6 +14320,12 @@ models:
13977
14320
  batch_input_per_mtok: 0.75
13978
14321
  batch_output_per_mtok: 3.75
13979
14322
  batch_cache_read_per_mtok: 0.0375
14323
+ rules:
14324
+ priority:
14325
+ effective_from: '2026-11-22'
14326
+ input_per_mtok: 2.7
14327
+ output_per_mtok: 13.5
14328
+ cache_read_per_mtok: 0.135
13980
14329
  source_url: https://cloud.google.com/model-garden/pricing
13981
14330
  - channel: google-api
13982
14331
  region: global
@@ -14,6 +14,8 @@ from typing import Any, Mapping
14
14
  import yaml
15
15
 
16
16
  from .catalog import (
17
+ DEFAULT_MODEL_CLASS,
18
+ MODEL_CLASSES,
17
19
  Alias,
18
20
  PRICE_ENDED,
19
21
  CatalogSnapshot,
@@ -48,6 +50,28 @@ def _freeze(value: Any) -> Any:
48
50
  return value
49
51
 
50
52
 
53
+ def _model_class(entry: Mapping[str, Any], canonical: str) -> str:
54
+ """An entry's ``model_class``: one of MODEL_CLASSES, ``generative`` when
55
+ absent. Any other value is refused rather than read as a default."""
56
+ if "model_class" not in entry:
57
+ return DEFAULT_MODEL_CLASS
58
+ value = entry["model_class"]
59
+ if not isinstance(value, str) or value not in MODEL_CLASSES:
60
+ raise CatalogError(
61
+ f"{canonical}: model_class must be one of {', '.join(MODEL_CLASSES)}, not {value!r}"
62
+ )
63
+ return value
64
+
65
+
66
+ def parse_model_classes(document: Mapping[str, Any]) -> dict[str, str]:
67
+ """Each model's class by canonical id, defaulted as :func:`_model_class`."""
68
+ return {
69
+ str(entry.get("canonical_id")): _model_class(entry, str(entry.get("canonical_id")))
70
+ for entry in document.get("models") or []
71
+ if entry.get("canonical_id")
72
+ }
73
+
74
+
51
75
  def _canonical_index(document: dict[str, Any]) -> dict[tuple[str, str], str]:
52
76
  """Map every ``(provider, name)`` -- for each declared alias and, under the
53
77
  providers that publish it, the canonical id itself -- to its canonical id,
@@ -93,6 +117,19 @@ class LoadedCatalog:
93
117
  families: Mapping[str, ModelFamily] = field(
94
118
  default_factory=lambda: MappingProxyType({})
95
119
  )
120
+ # Each model's class by canonical id; see MODEL_CLASSES.
121
+ model_classes: Mapping[str, str] = field(
122
+ default_factory=lambda: MappingProxyType({})
123
+ )
124
+
125
+ def model_class(self, canonical_id: Any) -> str | None:
126
+ """The class the catalog declares for ``canonical_id``
127
+ (``generative`` when the entry states none), or None when no entry
128
+ has that canonical id. Aliases are not canonical ids: a priced
129
+ call's class is on its result, ``CostResult.model_class``."""
130
+ if not isinstance(canonical_id, str):
131
+ return None
132
+ return self.model_classes.get(canonical_id)
96
133
 
97
134
  def model_family(self, canonical_id: Any) -> ModelFamily | None:
98
135
  """The product line the catalog declares for ``canonical_id``, or
@@ -188,7 +225,8 @@ class LoadedCatalog:
188
225
  """The price a call to ``model`` at ``at`` is billed at.
189
226
 
190
227
  ``channel`` is authoritative; without one, ``provider`` supplies its
191
- direct channel. ``region`` overrides the region the catalog was
228
+ direct channel, and with neither the aliases listed for provider
229
+ ``unknown`` do. ``region`` overrides the region the catalog was
192
230
  loaded with. A result that depends on a dimension the caller left out
193
231
  lists it in ``missing_dimensions``."""
194
232
  when = _coerce_datetime(at)
@@ -353,6 +391,7 @@ def parse_catalog(
353
391
  raise CatalogError(f"duplicate model entry {canonical!r}")
354
392
  seen_models.add(canonical)
355
393
  publisher = str(entry.get("publisher") or "").strip().lower() or None
394
+ model_class = _model_class(entry, canonical)
356
395
  for alias in entry.get("aliases") or []:
357
396
  provider = str(alias.get("provider") or "").lower()
358
397
  name = str(alias.get("alias") or "").lower()
@@ -402,6 +441,7 @@ def parse_catalog(
402
441
  price_region=_price_region(
403
442
  alias.get("price_region"), model=f"{canonical} alias {name}"
404
443
  ),
444
+ model_class=model_class,
405
445
  )
406
446
  keys = [(provider, name)]
407
447
  for synonym in _PROVIDER_SYNONYMS.get(provider, ()):
@@ -473,6 +513,21 @@ def parse_catalog(
473
513
  f"{canonical}: invalid batch_cache_write_1h_per_mtok "
474
514
  f"{batch_cache_write_1h!r}"
475
515
  )
516
+ priority = (price.get("rules") or {}).get("priority")
517
+ if priority is not None:
518
+ if not isinstance(priority, Mapping):
519
+ raise CatalogError(f"{canonical}: priority rates must be a mapping")
520
+ _date(priority.get("effective_from"), field="priority.effective_from", model=canonical)
521
+ for field in ("input_per_mtok", "output_per_mtok", "cache_read_per_mtok",
522
+ "cache_write_5m_per_mtok", "cache_write_1h_per_mtok"):
523
+ if field not in priority and field not in ("input_per_mtok", "output_per_mtok"):
524
+ continue
525
+ value = _decimal(priority.get(field))
526
+ if value is None or not value.is_finite() or value < 0:
527
+ raise CatalogError(f"{canonical}: invalid priority {field}")
528
+ limit = priority.get("max_input_tokens")
529
+ if limit is not None and (type(limit) is not int or limit <= 0):
530
+ raise CatalogError(f"{canonical}: invalid priority max_input_tokens")
476
531
  prices.append(
477
532
  Price(
478
533
  id=f"{canonical}:{channel}:{region}:{_id_date(effective_from)}",
@@ -659,6 +714,7 @@ def _build_loaded_catalog(
659
714
  retrieval=RetrievalCatalog(parse_retrieval(document)),
660
715
  disputes=tuple(parse_disputes(document)),
661
716
  families=MappingProxyType(families),
717
+ model_classes=MappingProxyType(parse_model_classes(document)),
662
718
  )
663
719
 
664
720
 
@@ -12,7 +12,7 @@ from typing import Any, Iterable, Mapping
12
12
 
13
13
  import yaml
14
14
 
15
- from .catalog import _iso_text
15
+ from .catalog import DEFAULT_MODEL_CLASS, MODEL_CLASSES, _iso_text
16
16
  from .loader import LoadedCatalog
17
17
 
18
18
 
@@ -176,6 +176,8 @@ class ModelDefinition:
176
176
  training_policy_overrides: Mapping[str, Mapping[str, TrainingPolicy]] = field(
177
177
  default_factory=lambda: _NO_POLICIES, hash=False
178
178
  )
179
+ # The same closed set as a prices entry's ``model_class``.
180
+ model_class: str = DEFAULT_MODEL_CLASS
179
181
 
180
182
 
181
183
  @dataclass(frozen=True, slots=True)
@@ -494,6 +496,12 @@ def parse_model_registry(document: Any) -> ModelRegistry:
494
496
  f"{canonical_id}: publisher {publisher!r} does not match canonical id"
495
497
  )
496
498
  released = _optional_date(model.get("released"), f"{canonical_id}: released")
499
+ model_class = model.get("model_class", DEFAULT_MODEL_CLASS)
500
+ if not isinstance(model_class, str) or model_class not in MODEL_CLASSES:
501
+ raise ModelRegistryError(
502
+ f"{canonical_id}: model_class must be one of "
503
+ f"{', '.join(MODEL_CLASSES)}, not {model_class!r}"
504
+ )
497
505
  _reject_misspelled_policy_fields(
498
506
  model, "training_policy_overrides", canonical_id
499
507
  )
@@ -587,6 +595,7 @@ def parse_model_registry(document: Any) -> ModelRegistry:
587
595
  routes=tuple(model_routes),
588
596
  released=released,
589
597
  training_policy_overrides=training_policy_overrides,
598
+ model_class=model_class,
590
599
  )
591
600
 
592
601
  execution_profiles: dict[str, tuple[str, ...]] = {}
@@ -701,6 +710,13 @@ def validate_model_registry(
701
710
  entry.get("canonical_id"): entry
702
711
  for entry in catalog.document.get("models", [])
703
712
  }
713
+ for model in registry.models.values():
714
+ declared = catalog.model_class(model.canonical_id)
715
+ if declared is not None and declared != model.model_class:
716
+ raise ModelRegistryError(
717
+ f"{model.canonical_id}: model_class {model.model_class!r} differs "
718
+ f"from the pricing catalog's {declared!r}"
719
+ )
704
720
  for route in registry.routes.values():
705
721
  catalog_model = catalog_models.get(route.canonical_id)
706
722
  if catalog_model is None:
@@ -214,6 +214,11 @@ def classify_recorded_call(row: Mapping[str, Any]) -> ModelReliability:
214
214
  if received is True or native.availability == 'available':
215
215
  return ModelReliability(native.http_status_code, 'available',
216
216
  signal if received is not False else None)
217
+ if (received is None and native.availability is None
218
+ and _succeeded_decision(row, error)):
219
+ # A recorded decision success is response evidence (see below),
220
+ # so the refusal signal it carries is kept.
221
+ return ModelReliability(native.http_status_code, 'available', signal)
217
222
  return native
218
223
  # Fresh response/finish/error observations are authoritative even if their
219
224
  # refusal coverage is unknown. HTTP-only legacy rows retain compatibility.
@@ -234,4 +239,23 @@ def classify_recorded_call(row: Mapping[str, Any]) -> ModelReliability:
234
239
  availability = native.availability
235
240
  if availability in {'unavailable', 'excluded'}:
236
241
  refused = None
242
+ if availability is None and _succeeded_decision(row, error):
243
+ # A decision model answers typed questions and reports no finish
244
+ # reason, so for it a recorded success is the response evidence a
245
+ # generative model's finish reason would be. Refusal stays unknown.
246
+ availability = 'available'
237
247
  return ModelReliability(native.http_status_code, availability, refused)
248
+
249
+
250
+ _SUCCESS_STATUSES = frozenset({'success', 'succeeded', 'ok', 'complete', 'completed'})
251
+
252
+
253
+ def _succeeded_decision(row: Mapping[str, Any], error: Mapping[str, Any]) -> bool:
254
+ """Whether ``row`` records a successful call to a decision-class model:
255
+ ``model_class`` is ``decision``, ``status`` is a success value, and no
256
+ error flag or error type is recorded."""
257
+ status = row.get('status')
258
+ return (row.get('model_class') == 'decision'
259
+ and isinstance(status, str) and status.strip().lower() in _SUCCESS_STATUSES
260
+ and row.get('error') in (None, False, 0)
261
+ and not error)
@@ -351,7 +351,8 @@ def cost_from_response(
351
351
  if facts.input_includes_cache:
352
352
  usage["input_tokens"] = _native_input_tokens(usage, cost)
353
353
  result = cost(**usage)
354
- if tier is None or tier in _STANDARD_TIERS or batch or (tier == "flex" and _supports_flex(result.price)) or result.status == "unpriced":
354
+ priority_priced = tier in ("priority", "fast") and "unsupported_service_tier" not in result.reasons
355
+ if tier is None or tier in _STANDARD_TIERS or batch or (tier == "flex" and _supports_flex(result.price)) or priority_priced or result.status == "unpriced":
355
356
  return result
356
357
  return replace(
357
358
  result,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metergraph-core
3
- Version: 0.8.30
3
+ Version: 0.9.0
4
4
  Summary: Open, effective-dated LLM pricing catalog and deterministic cost calculator for popular models across major providers and gateways, including OpenAI, Anthropic, Google Gemini, AWS Bedrock, OpenRouter, Vercel AI Gateway, and more.
5
5
  Author: Metergraph
6
6
  License-Expression: Apache-2.0
@@ -61,6 +61,11 @@ The result identifies the applied model and price. Check `status` before using
61
61
  its cost as a complete total: missing usage or unsupported rates can make a
62
62
  result `partial` or `unpriced`.
63
63
 
64
+ Served OpenAI `priority`/`fast` and Vertex `priority` calls use model-specific
65
+ catalog rates where verified. Priority coverage starts on November 22, 2026.
66
+ Requested Priority that falls back to standard uses standard pricing. Search
67
+ fees are priced separately from the token tier.
68
+
64
69
  ## Choose the API for your input
65
70
 
66
71
  | You have… | Start with… |