metergraph-core 0.6.0__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.0/src/metergraph_core.egg-info → metergraph_core-0.6.4}/PKG-INFO +1 -1
  2. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/pyproject.toml +1 -1
  3. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/catalog.py +3 -1
  4. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/data/prices.yaml +87 -8
  5. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/extractors.py +2 -1
  6. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/retrieval.py +2 -2
  7. {metergraph_core-0.6.0 → metergraph_core-0.6.4/src/metergraph_core.egg-info}/PKG-INFO +1 -1
  8. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/MANIFEST.in +0 -0
  9. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/README.md +0 -0
  10. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/setup.cfg +0 -0
  11. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/__init__.py +0 -0
  12. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/billing.py +0 -0
  13. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/catalog_delta.py +0 -0
  14. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/data/models.yaml +0 -0
  15. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/data/sources.yaml +0 -0
  16. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/loader.py +0 -0
  17. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/models.py +0 -0
  18. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/refresh.py +0 -0
  19. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core/sources.py +0 -0
  20. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core.egg-info/SOURCES.txt +0 -0
  21. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core.egg-info/dependency_links.txt +0 -0
  22. {metergraph_core-0.6.0 → metergraph_core-0.6.4}/src/metergraph_core.egg-info/requires.txt +0 -0
  23. {metergraph_core-0.6.0 → 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.0
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.0"
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"
@@ -3022,6 +3029,22 @@ models:
3022
3029
  cache_read_per_mtok: 0.15
3023
3030
  source_url: https://vercel.com/ai-gateway/models/muse-spark-1.3
3024
3031
 
3032
+ - canonical_id: typesafe-ai/jev-1.13.0
3033
+ publisher: typesafe-ai
3034
+ aliases:
3035
+ - {provider: typesafe-ai, alias: typesafe-ai/jev-1.13.0, channel: vercel-ai-gateway}
3036
+ - {provider: vercel, alias: typesafe-ai/jev-1.13.0, channel: vercel-ai-gateway}
3037
+ - {provider: unknown, alias: typesafe/jev-1.13.0, channel: vercel-ai-gateway}
3038
+ - {provider: unknown, alias: jev-1.13.0, channel: vercel-ai-gateway}
3039
+ prices:
3040
+ # Vercel lists an input rate and no output fee for this decision model.
3041
+ - channel: vercel-ai-gateway
3042
+ region: global
3043
+ effective_from: "2026-09-15"
3044
+ input_per_mtok: 0.04
3045
+ output_per_mtok: 0
3046
+ source_url: https://vercel.com/ai-gateway/models/jev-1.13.0
3047
+
3025
3048
  - canonical_id: thinkingmachines/inkling
3026
3049
  publisher: thinkingmachines
3027
3050
  aliases:
@@ -3638,6 +3661,15 @@ models:
3638
3661
  rules:
3639
3662
  long_context: {threshold: 200000, input_multiplier: 2.0, output_multiplier: 2.0}
3640
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
3641
3673
  - canonical_id: xai/grok-4.7
3642
3674
  publisher: xai
3643
3675
  aliases:
@@ -3999,13 +4031,30 @@ models:
3999
4031
  - {provider: google, alias: gemini-omni-flash-preview, channel: google-api}
4000
4032
  - {provider: google, alias: models/gemini-omni-flash-preview, channel: google-api}
4001
4033
  prices:
4034
+ # Google shuts this preview endpoint down on 2026-10-22; its traffic moves
4035
+ # to google/gemini-omni-1.1-flash.
4002
4036
  - channel: google-api
4003
4037
  region: global
4004
4038
  effective_from: "2026-05-19"
4039
+ effective_to: "2026-10-22"
4005
4040
  input_per_mtok: 1.50
4006
4041
  output_per_mtok: 9.00
4007
4042
  source_url: https://ai.google.dev/gemini-api/docs/pricing
4008
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
+
4009
4058
  # Retrieval prices: USD per 1,000 counted operations (completed searches, tool
4010
4059
  # calls, executed grounding queries), billed on the provider's direct channel.
4011
4060
  # These sit alongside the model-token catalog above but are priced per unit, not
@@ -4602,9 +4651,12 @@ models:
4602
4651
  - {provider: litellm, alias: claude-opus-5-fast, channel: anthropic-api}
4603
4652
  - {provider: unknown, alias: claude-opus-5-fast, channel: anthropic-api}
4604
4653
  prices:
4654
+ # Anthropic's own pricing and model-lifecycle pages name no
4655
+ # claude-opus-5-fast, so only the gateway offering continues.
4605
4656
  - channel: anthropic-api
4606
4657
  region: global
4607
4658
  effective_from: "2026-07-24"
4659
+ effective_to: "2026-10-22"
4608
4660
  input_per_mtok: 10
4609
4661
  output_per_mtok: 50
4610
4662
  source_url: https://ai-gateway.vercel.sh/v1/models
@@ -4905,7 +4957,9 @@ models:
4905
4957
  output_per_mtok: 180
4906
4958
  batch_input_per_mtok: 15
4907
4959
  batch_output_per_mtok: 90
4908
- 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
4909
4963
  - channel: vercel-ai-gateway
4910
4964
  region: global
4911
4965
  effective_from: "2026-10-02"
@@ -4935,7 +4989,9 @@ models:
4935
4989
  cache_read_per_mtok: 0.5
4936
4990
  batch_input_per_mtok: 2.5
4937
4991
  batch_output_per_mtok: 15
4938
- 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
4939
4995
  - channel: vercel-ai-gateway
4940
4996
  region: global
4941
4997
  effective_from: "2026-04-24"
@@ -4967,6 +5023,7 @@ models:
4967
5023
  - {provider: unknown, alias: gpt-5.5-pro, channel: openai-api}
4968
5024
  - {provider: unknown, alias: gpt-5.5-pro-2026-04-23, channel: openai-api}
4969
5025
  prices:
5026
+ # OpenAI lists no long-context batch rate, so batch stays flat.
4970
5027
  - channel: openai-api
4971
5028
  region: global
4972
5029
  effective_from: "2026-04-24"
@@ -4974,7 +5031,9 @@ models:
4974
5031
  output_per_mtok: 180
4975
5032
  batch_input_per_mtok: 15
4976
5033
  batch_output_per_mtok: 90
4977
- 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
4978
5037
  - channel: vercel-ai-gateway
4979
5038
  region: global
4980
5039
  effective_from: "2026-04-24"
@@ -8010,22 +8069,40 @@ models:
8010
8069
  - channel: vercel-ai-gateway
8011
8070
  region: global
8012
8071
  effective_from: "2026-10-20"
8072
+ effective_to: "2026-10-21"
8013
8073
  input_per_mtok: 0.14
8014
8074
  output_per_mtok: 0.28
8015
8075
  cache_read_per_mtok: 0.0028
8016
8076
  rules:
8017
8077
  varies_by_provider: true
8018
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
8019
8086
 
8020
8087
  - channel: openrouter-api
8021
8088
  region: global
8022
8089
  effective_from: "2026-10-20"
8090
+ effective_to: "2026-10-21"
8023
8091
  input_per_mtok: 0.14
8024
8092
  output_per_mtok: 0.28
8025
8093
  cache_read_per_mtok: 0.0028
8026
8094
  rules:
8027
8095
  varies_by_provider: true
8028
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
8029
8106
  - canonical_id: xiaomi/mimo-v2.5-pro
8030
8107
  publisher: xiaomi
8031
8108
  aliases:
@@ -10998,15 +11075,15 @@ retrieval:
10998
11075
  per_1k_usd: 14.00
10999
11076
  effective_from: "2026-01-05"
11000
11077
  source_url: https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing
11001
- # Sonar charges a request fee on top of tokens, by search context size;
11002
- # low is the default. The sonar token row keeps `uncaptured_fees` until
11003
- # 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.
11004
11080
  - channel: perplexity-api
11005
11081
  operation: search_request_low
11006
11082
  region: global
11007
11083
  unit: request
11008
11084
  per_1k_usd: 5.00
11009
11085
  effective_from: "2025-04-18"
11086
+ effective_to: "2026-10-23"
11010
11087
  source_url: https://docs.perplexity.ai/docs/getting-started/pricing
11011
11088
  - channel: perplexity-api
11012
11089
  operation: search_request_medium
@@ -11014,6 +11091,7 @@ retrieval:
11014
11091
  unit: request
11015
11092
  per_1k_usd: 8.00
11016
11093
  effective_from: "2025-04-18"
11094
+ effective_to: "2026-10-23"
11017
11095
  source_url: https://docs.perplexity.ai/docs/getting-started/pricing
11018
11096
  - channel: perplexity-api
11019
11097
  operation: search_request_high
@@ -11021,6 +11099,7 @@ retrieval:
11021
11099
  unit: request
11022
11100
  per_1k_usd: 12.00
11023
11101
  effective_from: "2025-04-18"
11102
+ effective_to: "2026-10-23"
11024
11103
  source_url: https://docs.perplexity.ai/docs/getting-started/pricing
11025
11104
 
11026
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.0
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