metergraph-core 0.8.26__tar.gz → 0.8.28__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.
- {metergraph_core-0.8.26/src/metergraph_core.egg-info → metergraph_core-0.8.28}/PKG-INFO +10 -1
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/README.md +9 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/pyproject.toml +1 -1
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/calls.py +12 -1
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/data/prices.yaml +32 -2
- metergraph_core-0.8.28/src/metergraph_core/providers/anthropic.py +29 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28/src/metergraph_core.egg-info}/PKG-INFO +10 -1
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core.egg-info/SOURCES.txt +1 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/MANIFEST.in +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/setup.cfg +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/__init__.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/billing.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/catalog.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/catalog_delta.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/data/models.yaml +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/data/sources.yaml +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/extractors.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/families.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/loader.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/models.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/providers/__init__.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/providers/google.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/refresh.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/reliability.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/responses.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/retrieval.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core/sources.py +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core.egg-info/dependency_links.txt +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core.egg-info/requires.txt +0 -0
- {metergraph_core-0.8.26 → metergraph_core-0.8.28}/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.
|
|
3
|
+
Version: 0.8.28
|
|
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
|
|
@@ -336,6 +336,15 @@ rate, count, search type, or processing tier stays partial or unpriced.
|
|
|
336
336
|
`search_units` and `retrieval_cost_usd` expose the resolved components for storage.
|
|
337
337
|
`known_subtotal_usd` remains separate from a complete total.
|
|
338
338
|
|
|
339
|
+
For failed calls, missing usage is not evidence of a free request. Anthropic
|
|
340
|
+
Messages HTTP rejections with no observed usage are priced at zero with reason
|
|
341
|
+
`provider_failure_not_billable`. This rule excludes batch operations and unknown
|
|
342
|
+
endpoints: a failed result download can follow already-billed inference. Failed
|
|
343
|
+
streams or `usage_complete: false` remain partial; any observed-usage estimate is
|
|
344
|
+
separate from the final charge. Qualified gateway billing evidence retains its
|
|
345
|
+
existing precedence.
|
|
346
|
+
|
|
347
|
+
|
|
339
348
|
A receiver that already resolved tokens against the same catalog may pass
|
|
340
349
|
`token_cost=`. Explicit API identity can select a different token channel; other
|
|
341
350
|
resolved token results are preserved. Qualified gateway totals can still be
|
|
@@ -306,6 +306,15 @@ rate, count, search type, or processing tier stays partial or unpriced.
|
|
|
306
306
|
`search_units` and `retrieval_cost_usd` expose the resolved components for storage.
|
|
307
307
|
`known_subtotal_usd` remains separate from a complete total.
|
|
308
308
|
|
|
309
|
+
For failed calls, missing usage is not evidence of a free request. Anthropic
|
|
310
|
+
Messages HTTP rejections with no observed usage are priced at zero with reason
|
|
311
|
+
`provider_failure_not_billable`. This rule excludes batch operations and unknown
|
|
312
|
+
endpoints: a failed result download can follow already-billed inference. Failed
|
|
313
|
+
streams or `usage_complete: false` remain partial; any observed-usage estimate is
|
|
314
|
+
separate from the final charge. Qualified gateway billing evidence retains its
|
|
315
|
+
existing precedence.
|
|
316
|
+
|
|
317
|
+
|
|
309
318
|
A receiver that already resolved tokens against the same catalog may pass
|
|
310
319
|
`token_cost=`. Explicit API identity can select a different token channel; other
|
|
311
320
|
resolved token results are preserved. Qualified gateway totals can still be
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "metergraph-core"
|
|
3
|
-
version = "0.8.
|
|
3
|
+
version = "0.8.28"
|
|
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"
|
|
@@ -6,9 +6,10 @@ from decimal import Decimal
|
|
|
6
6
|
import re
|
|
7
7
|
from typing import Any, Mapping, Sequence
|
|
8
8
|
|
|
9
|
-
from .catalog import CostResult, ModelUsage, direct_channel_for_provider, normalize_provider, _supports_flex
|
|
9
|
+
from .catalog import CostComponents, CostResult, ModelUsage, direct_channel_for_provider, normalize_provider, _supports_flex
|
|
10
10
|
from .loader import LoadedCatalog
|
|
11
11
|
from .providers import model_identity
|
|
12
|
+
from .providers.anthropic import rejected_without_usage
|
|
12
13
|
from .responses import _as_mapping, _bundled_catalog, _first, cost_from_response, response_format, _native_input_tokens
|
|
13
14
|
|
|
14
15
|
_ZERO = Decimal('0')
|
|
@@ -293,6 +294,16 @@ def price_call_from_record(
|
|
|
293
294
|
if row.get('input_tokens_include_cache') is True:
|
|
294
295
|
values['input_tokens'] = _native_input_tokens(values, cost)
|
|
295
296
|
token_cost = cost(**values)
|
|
297
|
+
if normalize_provider(provider or '') == 'anthropic' and rejected_without_usage(row):
|
|
298
|
+
free = replace(token_cost, cost_usd=_ZERO, status='priced',
|
|
299
|
+
reasons=('provider_failure_not_billable',), missing_dimensions=(),
|
|
300
|
+
components=CostComponents(_ZERO, _ZERO, _ZERO, _ZERO))
|
|
301
|
+
return CallCostResult(free, (), _ZERO, _ZERO, None, 'priced', 'exact', (), loaded.content_hash)
|
|
302
|
+
failed_stream = row.get('stream') is True and (
|
|
303
|
+
row.get('error') is True or row.get('status') in {'error', 'failed', 'abandoned'})
|
|
304
|
+
if row.get('usage_complete') is False or failed_stream:
|
|
305
|
+
token_cost = replace(token_cost, status='partial',
|
|
306
|
+
missing_dimensions=tuple(dict.fromkeys((*token_cost.missing_dimensions, 'incomplete_usage'))))
|
|
296
307
|
flex_priced = tier == 'flex' and _supports_flex(token_cost.price)
|
|
297
308
|
if tier is not None and tier not in ('standard', 'default', 'auto', 'batch') and not flex_priced:
|
|
298
309
|
token_cost = replace(token_cost, status='partial',
|
|
@@ -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-
|
|
9
|
+
version: "2026-11-19"
|
|
10
10
|
currency: USD
|
|
11
|
-
pricing_verified_at: "2026-11-
|
|
11
|
+
pricing_verified_at: "2026-11-19"
|
|
12
12
|
models:
|
|
13
13
|
- canonical_id: openai/gpt-6-sol
|
|
14
14
|
publisher: openai
|
|
@@ -13931,6 +13931,36 @@ models:
|
|
|
13931
13931
|
cache_read_per_mtok: 0.075
|
|
13932
13932
|
source_url: https://ai-gateway.vercel.sh/v1/models
|
|
13933
13933
|
|
|
13934
|
+
- canonical_id: google/gemini-4-neon
|
|
13935
|
+
publisher: google
|
|
13936
|
+
aliases:
|
|
13937
|
+
- {provider: google, alias: gemini-4-neon, channel: google-api}
|
|
13938
|
+
- {provider: google, alias: models/gemini-4-neon, channel: google-api}
|
|
13939
|
+
- {provider: litellm, alias: gemini-4-neon, channel: google-api}
|
|
13940
|
+
- {provider: litellm, alias: models/gemini-4-neon, channel: google-api}
|
|
13941
|
+
- {provider: unknown, alias: gemini-4-neon, channel: google-api}
|
|
13942
|
+
- {provider: unknown, alias: models/gemini-4-neon, channel: google-api}
|
|
13943
|
+
- {provider: google, alias: google/gemini-4-neon, channel: vercel-ai-gateway, rules: {input_includes_cache_read: true}}
|
|
13944
|
+
- {provider: vercel, alias: google/gemini-4-neon, channel: vercel-ai-gateway, rules: {input_includes_cache_read: true}}
|
|
13945
|
+
prices:
|
|
13946
|
+
- channel: google-api
|
|
13947
|
+
region: global
|
|
13948
|
+
effective_from: "2026-11-18"
|
|
13949
|
+
input_per_mtok: 3.00
|
|
13950
|
+
output_per_mtok: 15.00
|
|
13951
|
+
cache_read_per_mtok: 0.15
|
|
13952
|
+
batch_input_per_mtok: 1.50
|
|
13953
|
+
batch_output_per_mtok: 7.50
|
|
13954
|
+
batch_cache_read_per_mtok: 0.075
|
|
13955
|
+
source_url: https://aistudio.google.com/docs/pricing
|
|
13956
|
+
- channel: vercel-ai-gateway
|
|
13957
|
+
region: global
|
|
13958
|
+
effective_from: "2026-11-18"
|
|
13959
|
+
input_per_mtok: 3.00
|
|
13960
|
+
output_per_mtok: 15.00
|
|
13961
|
+
cache_read_per_mtok: 0.15
|
|
13962
|
+
source_url: https://vercel.com/ai-gateway/models/google/gemini-4-neon
|
|
13963
|
+
|
|
13934
13964
|
- canonical_id: google/gemini-omni-1.2-flash
|
|
13935
13965
|
publisher: google
|
|
13936
13966
|
family: {id: google/gemini-omni-flash, display_name: Gemini Omni Flash}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Anthropic failure billing evidence, independent of model token rates."""
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Provider HTTP rejections are free; client disconnects/timeouts can still be
|
|
7
|
+
# charged. Never infer a free call from an exception name or absent counters.
|
|
8
|
+
# https://support.claude.com/en/articles/8977456-how-do-i-pay-for-my-claude-api-usage
|
|
9
|
+
|
|
10
|
+
def rejected_without_usage(row: Mapping[str, Any]) -> bool:
|
|
11
|
+
# A rejected result download says nothing about the already-submitted job.
|
|
12
|
+
if row.get('batch') is True or row.get('endpoint') not in {'messages', 'messages.create', 'messages.stream'}:
|
|
13
|
+
return False
|
|
14
|
+
status = row.get('http_status_code')
|
|
15
|
+
if not (row.get('error') is True or row.get('status') in {'error', 'failed'}):
|
|
16
|
+
return False
|
|
17
|
+
if type(status) is not int or not 400 <= status <= 599:
|
|
18
|
+
return False
|
|
19
|
+
counters = [row.get(key) for key in (
|
|
20
|
+
'input_tokens', 'output_tokens', 'cache_read_tokens', 'cache_write_tokens',
|
|
21
|
+
'cache_write_5m_tokens', 'cache_write_1h_tokens', 'reasoning_tokens',
|
|
22
|
+
'web_search_calls', 'grounding_queries', 'search_queries', 'search_units',
|
|
23
|
+
)]
|
|
24
|
+
native = row.get('server_tool_use')
|
|
25
|
+
if native is not None:
|
|
26
|
+
if not isinstance(native, Mapping):
|
|
27
|
+
return False
|
|
28
|
+
counters.extend(native.values())
|
|
29
|
+
return all(value is None or (type(value) is int and value == 0) for value in counters)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: metergraph-core
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.28
|
|
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
|
|
@@ -336,6 +336,15 @@ rate, count, search type, or processing tier stays partial or unpriced.
|
|
|
336
336
|
`search_units` and `retrieval_cost_usd` expose the resolved components for storage.
|
|
337
337
|
`known_subtotal_usd` remains separate from a complete total.
|
|
338
338
|
|
|
339
|
+
For failed calls, missing usage is not evidence of a free request. Anthropic
|
|
340
|
+
Messages HTTP rejections with no observed usage are priced at zero with reason
|
|
341
|
+
`provider_failure_not_billable`. This rule excludes batch operations and unknown
|
|
342
|
+
endpoints: a failed result download can follow already-billed inference. Failed
|
|
343
|
+
streams or `usage_complete: false` remain partial; any observed-usage estimate is
|
|
344
|
+
separate from the final charge. Qualified gateway billing evidence retains its
|
|
345
|
+
existing precedence.
|
|
346
|
+
|
|
347
|
+
|
|
339
348
|
A receiver that already resolved tokens against the same catalog may pass
|
|
340
349
|
`token_cost=`. Explicit API identity can select a different token channel; other
|
|
341
350
|
resolved token results are preserved. Qualified gateway totals can still be
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{metergraph_core-0.8.26 → metergraph_core-0.8.28}/src/metergraph_core.egg-info/top_level.txt
RENAMED
|
File without changes
|