metergraph-core 0.6.1__tar.gz → 0.6.4__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 (23) hide show
  1. {metergraph_core-0.6.1/src/metergraph_core.egg-info → metergraph_core-0.6.4}/PKG-INFO +1 -1
  2. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/pyproject.toml +1 -1
  3. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/catalog.py +3 -1
  4. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/data/prices.yaml +71 -8
  5. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/extractors.py +2 -1
  6. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/retrieval.py +2 -2
  7. {metergraph_core-0.6.1 → metergraph_core-0.6.4/src/metergraph_core.egg-info}/PKG-INFO +1 -1
  8. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/MANIFEST.in +0 -0
  9. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/README.md +0 -0
  10. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/setup.cfg +0 -0
  11. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/__init__.py +0 -0
  12. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/billing.py +0 -0
  13. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/catalog_delta.py +0 -0
  14. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/data/models.yaml +0 -0
  15. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/data/sources.yaml +0 -0
  16. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/loader.py +0 -0
  17. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/models.py +0 -0
  18. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/refresh.py +0 -0
  19. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core/sources.py +0 -0
  20. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core.egg-info/SOURCES.txt +0 -0
  21. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core.egg-info/dependency_links.txt +0 -0
  22. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/src/metergraph_core.egg-info/requires.txt +0 -0
  23. {metergraph_core-0.6.1 → metergraph_core-0.6.4}/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.6.1
3
+ Version: 0.6.4
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "metergraph-core"
3
- version = "0.6.1"
3
+ version = "0.6.4"
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"
@@ -522,7 +522,9 @@ def _price_tokens(
522
522
  prompt_count += cache_read_count
523
523
  if not rules.get("input_includes_cache_write"):
524
524
  prompt_count += cache_write_count
525
- if threshold is not None and prompt_count > threshold:
525
+ # Some providers publish no long-context batch rate, so batch stays flat.
526
+ applies = not batch or long_context.get("applies_to_batch", True)
527
+ if applies and threshold is not None and prompt_count > threshold:
526
528
  input_multiplier = _decimal(long_context.get("input_multiplier")) or Decimal("1")
527
529
  output_multiplier = _decimal(
528
530
  long_context.get("output_multiplier")
@@ -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-10-21"
9
+ version: "2026-10-23"
10
10
  currency: USD
11
- pricing_verified_at: "2026-10-21"
11
+ pricing_verified_at: "2026-10-23"
12
12
  models:
13
13
  - canonical_id: openai/gpt-6-sol
14
14
  publisher: openai
@@ -1824,9 +1824,12 @@ models:
1824
1824
  - {provider: google, alias: gemini-2.5-flash-image, channel: google-api}
1825
1825
  - {provider: google, alias: models/gemini-2.5-flash-image, channel: google-api}
1826
1826
  prices:
1827
+ # Google shut this model down on 2026-10-02 and now states its output
1828
+ # price per image, which no token rate can express.
1827
1829
  - channel: google-api
1828
1830
  region: global
1829
1831
  effective_from: "2025-10-02"
1832
+ effective_to: "2026-10-02"
1830
1833
  input_per_mtok: 0.30
1831
1834
  output_per_mtok: 30.00
1832
1835
  source_url: https://ai.google.dev/gemini-api/docs/pricing
@@ -2497,6 +2500,7 @@ models:
2497
2500
  - channel: perplexity-api
2498
2501
  region: global
2499
2502
  effective_from: "2025-04-18"
2503
+ effective_to: "2026-10-23"
2500
2504
  input_per_mtok: 1.00
2501
2505
  output_per_mtok: 1.00
2502
2506
  rules:
@@ -2729,6 +2733,9 @@ models:
2729
2733
  cache_read_per_mtok: 0.075
2730
2734
  source_url: https://ai-gateway.vercel.sh/v1/models
2731
2735
 
2736
+ # The pricing page stopped listing this name when Google deprecated it on
2737
+ # 2026-10-08 and began routing it to gemini-3.8-flash, whose rates these
2738
+ # rows already match.
2732
2739
  - channel: google-api
2733
2740
  region: global
2734
2741
  effective_from: "2026-08-13"
@@ -3654,6 +3661,15 @@ models:
3654
3661
  rules:
3655
3662
  long_context: {threshold: 200000, input_multiplier: 2.0, output_multiplier: 2.0}
3656
3663
  source_url: https://docs.x.ai/developers/release-notes
3664
+ - channel: xai-api
3665
+ region: us
3666
+ effective_from: "2026-08-12"
3667
+ input_per_mtok: 2.2
3668
+ output_per_mtok: 6.6
3669
+ cache_read_per_mtok: 0.55
3670
+ rules:
3671
+ long_context: {threshold: 200000, input_multiplier: 2.0, output_multiplier: 2.0}
3672
+ source_url: https://docs.x.ai/developers/advanced-api-usage/regions
3657
3673
  - canonical_id: xai/grok-4.7
3658
3674
  publisher: xai
3659
3675
  aliases:
@@ -4015,13 +4031,30 @@ models:
4015
4031
  - {provider: google, alias: gemini-omni-flash-preview, channel: google-api}
4016
4032
  - {provider: google, alias: models/gemini-omni-flash-preview, channel: google-api}
4017
4033
  prices:
4034
+ # Google shuts this preview endpoint down on 2026-10-22; its traffic moves
4035
+ # to google/gemini-omni-1.1-flash.
4018
4036
  - channel: google-api
4019
4037
  region: global
4020
4038
  effective_from: "2026-05-19"
4039
+ effective_to: "2026-10-22"
4021
4040
  input_per_mtok: 1.50
4022
4041
  output_per_mtok: 9.00
4023
4042
  source_url: https://ai.google.dev/gemini-api/docs/pricing
4024
4043
 
4044
+ - canonical_id: google/gemini-omni-1.1-flash
4045
+ publisher: google
4046
+ aliases:
4047
+ - {provider: google, alias: gemini-omni-1.1-flash, channel: google-api}
4048
+ - {provider: google, alias: models/gemini-omni-1.1-flash, channel: google-api}
4049
+ prices:
4050
+ # Uses the video output rate: video is this model's only output modality.
4051
+ - channel: google-api
4052
+ region: global
4053
+ effective_from: "2026-08-27"
4054
+ input_per_mtok: 1.50
4055
+ output_per_mtok: 17.50
4056
+ source_url: https://ai.google.dev/gemini-api/docs/pricing
4057
+
4025
4058
  # Retrieval prices: USD per 1,000 counted operations (completed searches, tool
4026
4059
  # calls, executed grounding queries), billed on the provider's direct channel.
4027
4060
  # These sit alongside the model-token catalog above but are priced per unit, not
@@ -4618,9 +4651,12 @@ models:
4618
4651
  - {provider: litellm, alias: claude-opus-5-fast, channel: anthropic-api}
4619
4652
  - {provider: unknown, alias: claude-opus-5-fast, channel: anthropic-api}
4620
4653
  prices:
4654
+ # Anthropic's own pricing and model-lifecycle pages name no
4655
+ # claude-opus-5-fast, so only the gateway offering continues.
4621
4656
  - channel: anthropic-api
4622
4657
  region: global
4623
4658
  effective_from: "2026-07-24"
4659
+ effective_to: "2026-10-22"
4624
4660
  input_per_mtok: 10
4625
4661
  output_per_mtok: 50
4626
4662
  source_url: https://ai-gateway.vercel.sh/v1/models
@@ -4921,7 +4957,9 @@ models:
4921
4957
  output_per_mtok: 180
4922
4958
  batch_input_per_mtok: 15
4923
4959
  batch_output_per_mtok: 90
4924
- source_url: https://ai-gateway.vercel.sh/v1/models
4960
+ rules:
4961
+ long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
4962
+ source_url: https://developers.openai.com/api/docs/models/gpt-5.4-pro
4925
4963
  - channel: vercel-ai-gateway
4926
4964
  region: global
4927
4965
  effective_from: "2026-10-02"
@@ -4951,7 +4989,9 @@ models:
4951
4989
  cache_read_per_mtok: 0.5
4952
4990
  batch_input_per_mtok: 2.5
4953
4991
  batch_output_per_mtok: 15
4954
- source_url: https://ai-gateway.vercel.sh/v1/models
4992
+ rules:
4993
+ long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
4994
+ source_url: https://developers.openai.com/api/docs/models/gpt-5.5
4955
4995
  - channel: vercel-ai-gateway
4956
4996
  region: global
4957
4997
  effective_from: "2026-04-24"
@@ -4983,6 +5023,7 @@ models:
4983
5023
  - {provider: unknown, alias: gpt-5.5-pro, channel: openai-api}
4984
5024
  - {provider: unknown, alias: gpt-5.5-pro-2026-04-23, channel: openai-api}
4985
5025
  prices:
5026
+ # OpenAI lists no long-context batch rate, so batch stays flat.
4986
5027
  - channel: openai-api
4987
5028
  region: global
4988
5029
  effective_from: "2026-04-24"
@@ -4990,7 +5031,9 @@ models:
4990
5031
  output_per_mtok: 180
4991
5032
  batch_input_per_mtok: 15
4992
5033
  batch_output_per_mtok: 90
4993
- source_url: https://ai-gateway.vercel.sh/v1/models
5034
+ rules:
5035
+ long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5, applies_to_batch: false}
5036
+ source_url: https://developers.openai.com/api/docs/pricing
4994
5037
  - channel: vercel-ai-gateway
4995
5038
  region: global
4996
5039
  effective_from: "2026-04-24"
@@ -8026,22 +8069,40 @@ models:
8026
8069
  - channel: vercel-ai-gateway
8027
8070
  region: global
8028
8071
  effective_from: "2026-10-20"
8072
+ effective_to: "2026-10-21"
8029
8073
  input_per_mtok: 0.14
8030
8074
  output_per_mtok: 0.28
8031
8075
  cache_read_per_mtok: 0.0028
8032
8076
  rules:
8033
8077
  varies_by_provider: true
8034
8078
  source_url: https://ai-gateway.vercel.sh/v1/models
8079
+ - channel: vercel-ai-gateway
8080
+ region: global
8081
+ effective_from: "2026-10-21"
8082
+ input_per_mtok: 0.119
8083
+ output_per_mtok: 0.238
8084
+ cache_read_per_mtok: 0.0025
8085
+ source_url: https://ai-gateway.vercel.sh/v1/models
8035
8086
 
8036
8087
  - channel: openrouter-api
8037
8088
  region: global
8038
8089
  effective_from: "2026-10-20"
8090
+ effective_to: "2026-10-21"
8039
8091
  input_per_mtok: 0.14
8040
8092
  output_per_mtok: 0.28
8041
8093
  cache_read_per_mtok: 0.0028
8042
8094
  rules:
8043
8095
  varies_by_provider: true
8044
8096
  source_url: https://openrouter.ai/api/v1/models
8097
+ - channel: openrouter-api
8098
+ region: global
8099
+ effective_from: "2026-10-21"
8100
+ input_per_mtok: 0.119
8101
+ output_per_mtok: 0.238
8102
+ cache_read_per_mtok: 0.00255
8103
+ rules:
8104
+ varies_by_provider: true
8105
+ source_url: https://openrouter.ai/api/v1/models
8045
8106
  - canonical_id: xiaomi/mimo-v2.5-pro
8046
8107
  publisher: xiaomi
8047
8108
  aliases:
@@ -11014,15 +11075,15 @@ retrieval:
11014
11075
  per_1k_usd: 14.00
11015
11076
  effective_from: "2026-01-05"
11016
11077
  source_url: https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing
11017
- # Sonar charges a request fee on top of tokens, by search context size;
11018
- # low is the default. The sonar token row keeps `uncaptured_fees` until
11019
- # callers price requests alongside tokens.
11078
+ # Historical Sonar request fees end before the new API-specific rates.
11079
+ # The current Sonar fee is unverified, so its token row stays partial.
11020
11080
  - channel: perplexity-api
11021
11081
  operation: search_request_low
11022
11082
  region: global
11023
11083
  unit: request
11024
11084
  per_1k_usd: 5.00
11025
11085
  effective_from: "2025-04-18"
11086
+ effective_to: "2026-10-23"
11026
11087
  source_url: https://docs.perplexity.ai/docs/getting-started/pricing
11027
11088
  - channel: perplexity-api
11028
11089
  operation: search_request_medium
@@ -11030,6 +11091,7 @@ retrieval:
11030
11091
  unit: request
11031
11092
  per_1k_usd: 8.00
11032
11093
  effective_from: "2025-04-18"
11094
+ effective_to: "2026-10-23"
11033
11095
  source_url: https://docs.perplexity.ai/docs/getting-started/pricing
11034
11096
  - channel: perplexity-api
11035
11097
  operation: search_request_high
@@ -11037,6 +11099,7 @@ retrieval:
11037
11099
  unit: request
11038
11100
  per_1k_usd: 12.00
11039
11101
  effective_from: "2025-04-18"
11102
+ effective_to: "2026-10-23"
11040
11103
  source_url: https://docs.perplexity.ai/docs/getting-started/pricing
11041
11104
 
11042
11105
  # Gateways whose reported amount billing declines for one publisher's models
@@ -247,7 +247,8 @@ def parse_deepseek(html_text: str, *, duplicates: list[str] | None = None) -> Ta
247
247
  section = ""
248
248
  for rows_ in page_tables(html_text):
249
249
  for cells in rows_:
250
- if cells and cells[0].upper().startswith("MODEL") and len(cells) > 1:
250
+ # MODEL VERSION is data, not a header.
251
+ if cells and cells[0].strip().upper() == "MODEL" and len(cells) > 1:
251
252
  columns = [deepseek_name(c) for c in cells[1:]]
252
253
  for column in columns:
253
254
  table[column] = {}
@@ -61,8 +61,8 @@ SEARCH_OPERATION_BY_CHANNEL: Mapping[str, str] = MappingProxyType({
61
61
  "anthropic-api": "web_search",
62
62
  "google-api": "google_search_grounding",
63
63
  "google-vertex-ai": "google_search_grounding",
64
- # Perplexity bills a request fee by search context size, which no
65
- # capture path records; the low tier is the floor every request pays.
64
+ # Historical Sonar request fees use this operation; no current fee is
65
+ # assigned until its API and billing unit can be verified.
66
66
  "perplexity-api": "search_request_low",
67
67
  })
68
68
  FETCH_OPERATION_BY_CHANNEL: Mapping[str, str] = MappingProxyType({
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metergraph-core
3
- Version: 0.6.1
3
+ Version: 0.6.4
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