diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 958593ed66b..7471840c231 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -2965,6 +2965,7 @@ "cache_read_input_token_cost": 8.5e-09, "input_cost_per_token": 4e-08, "litellm_provider": "cheaperinference", + "max_input_tokens": 131072, "mode": "chat", "output_cost_per_token": 2e-07, "source": "https://cheaperinference.com/docs", @@ -3051,18 +3052,18 @@ }, "cheaperinference/gpt-5.6-luna": { "cache_creation_input_token_cost": 1e-07, - "cache_creation_input_token_cost_above_272k_tokens": 2e-07, + "cache_creation_input_token_cost_above_271999_tokens": 2e-07, "cache_read_input_token_cost": 8e-09, - "cache_read_input_token_cost_above_272k_tokens": 1.6e-08, + "cache_read_input_token_cost_above_271999_tokens": 1.6e-08, "input_cost_per_token": 8e-08, - "input_cost_per_token_above_272k_tokens": 1.6e-07, + "input_cost_per_token_above_271999_tokens": 1.6e-07, "litellm_provider": "cheaperinference", "max_input_tokens": 1050000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", "output_cost_per_token": 4.8e-07, - "output_cost_per_token_above_272k_tokens": 7.2e-07, + "output_cost_per_token_above_271999_tokens": 7.2e-07, "source": "https://cheaperinference.com/docs", "supported_endpoints": [ "/v1/chat/completions", @@ -3077,18 +3078,18 @@ }, "cheaperinference/gpt-5.6-sol": { "cache_creation_input_token_cost": 1.25e-06, - "cache_creation_input_token_cost_above_272k_tokens": 2.5e-06, + "cache_creation_input_token_cost_above_271999_tokens": 2.5e-06, "cache_read_input_token_cost": 1e-07, - "cache_read_input_token_cost_above_272k_tokens": 2e-07, + "cache_read_input_token_cost_above_271999_tokens": 2e-07, "input_cost_per_token": 1e-06, - "input_cost_per_token_above_272k_tokens": 2e-06, + "input_cost_per_token_above_271999_tokens": 2e-06, "litellm_provider": "cheaperinference", "max_input_tokens": 1050000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", "output_cost_per_token": 5e-06, - "output_cost_per_token_above_272k_tokens": 7.5e-06, + "output_cost_per_token_above_271999_tokens": 7.5e-06, "source": "https://cheaperinference.com/docs", "supported_endpoints": [ "/v1/chat/completions", @@ -3103,18 +3104,18 @@ }, "cheaperinference/gpt-5.6-terra": { "cache_creation_input_token_cost": 1e-06, - "cache_creation_input_token_cost_above_272k_tokens": 2e-06, + "cache_creation_input_token_cost_above_271999_tokens": 2e-06, "cache_read_input_token_cost": 8e-08, - "cache_read_input_token_cost_above_272k_tokens": 1.6e-07, + "cache_read_input_token_cost_above_271999_tokens": 1.6e-07, "input_cost_per_token": 8e-07, - "input_cost_per_token_above_272k_tokens": 1.6e-06, + "input_cost_per_token_above_271999_tokens": 1.6e-06, "litellm_provider": "cheaperinference", "max_input_tokens": 1050000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", "output_cost_per_token": 4.8e-06, - "output_cost_per_token_above_272k_tokens": 7.2e-06, + "output_cost_per_token_above_271999_tokens": 7.2e-06, "source": "https://cheaperinference.com/docs", "supported_endpoints": [ "/v1/chat/completions", @@ -3573,6 +3574,7 @@ "cache_read_input_token_cost": 6.375e-08, "input_cost_per_token": 6.375e-07, "litellm_provider": "cheaperinference", + "max_input_tokens": 1048576, "mode": "chat", "output_cost_per_token": 3.1875e-06, "source": "https://cheaperinference.com/docs", @@ -3738,6 +3740,7 @@ "cache_read_input_token_cost": 2.1e-08, "input_cost_per_token": 2.1e-07, "litellm_provider": "cheaperinference", + "max_input_tokens": 1048576, "mode": "chat", "output_cost_per_token": 1.75e-06, "source": "https://cheaperinference.com/docs", @@ -3756,6 +3759,7 @@ "cache_read_input_token_cost": 8.499e-09, "input_cost_per_token": 8.5e-08, "litellm_provider": "cheaperinference", + "max_input_tokens": 1047576, "mode": "chat", "output_cost_per_token": 3.4e-07, "source": "https://cheaperinference.com/docs", @@ -3841,7 +3845,7 @@ "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", - "output_cost_per_token": 1.007109e-06, + "output_cost_per_token": 1.00711e-06, "source": "https://cheaperinference.com/docs", "supported_endpoints": [ "/v1/chat/completions", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 958593ed66b..7471840c231 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -2965,6 +2965,7 @@ "cache_read_input_token_cost": 8.5e-09, "input_cost_per_token": 4e-08, "litellm_provider": "cheaperinference", + "max_input_tokens": 131072, "mode": "chat", "output_cost_per_token": 2e-07, "source": "https://cheaperinference.com/docs", @@ -3051,18 +3052,18 @@ }, "cheaperinference/gpt-5.6-luna": { "cache_creation_input_token_cost": 1e-07, - "cache_creation_input_token_cost_above_272k_tokens": 2e-07, + "cache_creation_input_token_cost_above_271999_tokens": 2e-07, "cache_read_input_token_cost": 8e-09, - "cache_read_input_token_cost_above_272k_tokens": 1.6e-08, + "cache_read_input_token_cost_above_271999_tokens": 1.6e-08, "input_cost_per_token": 8e-08, - "input_cost_per_token_above_272k_tokens": 1.6e-07, + "input_cost_per_token_above_271999_tokens": 1.6e-07, "litellm_provider": "cheaperinference", "max_input_tokens": 1050000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", "output_cost_per_token": 4.8e-07, - "output_cost_per_token_above_272k_tokens": 7.2e-07, + "output_cost_per_token_above_271999_tokens": 7.2e-07, "source": "https://cheaperinference.com/docs", "supported_endpoints": [ "/v1/chat/completions", @@ -3077,18 +3078,18 @@ }, "cheaperinference/gpt-5.6-sol": { "cache_creation_input_token_cost": 1.25e-06, - "cache_creation_input_token_cost_above_272k_tokens": 2.5e-06, + "cache_creation_input_token_cost_above_271999_tokens": 2.5e-06, "cache_read_input_token_cost": 1e-07, - "cache_read_input_token_cost_above_272k_tokens": 2e-07, + "cache_read_input_token_cost_above_271999_tokens": 2e-07, "input_cost_per_token": 1e-06, - "input_cost_per_token_above_272k_tokens": 2e-06, + "input_cost_per_token_above_271999_tokens": 2e-06, "litellm_provider": "cheaperinference", "max_input_tokens": 1050000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", "output_cost_per_token": 5e-06, - "output_cost_per_token_above_272k_tokens": 7.5e-06, + "output_cost_per_token_above_271999_tokens": 7.5e-06, "source": "https://cheaperinference.com/docs", "supported_endpoints": [ "/v1/chat/completions", @@ -3103,18 +3104,18 @@ }, "cheaperinference/gpt-5.6-terra": { "cache_creation_input_token_cost": 1e-06, - "cache_creation_input_token_cost_above_272k_tokens": 2e-06, + "cache_creation_input_token_cost_above_271999_tokens": 2e-06, "cache_read_input_token_cost": 8e-08, - "cache_read_input_token_cost_above_272k_tokens": 1.6e-07, + "cache_read_input_token_cost_above_271999_tokens": 1.6e-07, "input_cost_per_token": 8e-07, - "input_cost_per_token_above_272k_tokens": 1.6e-06, + "input_cost_per_token_above_271999_tokens": 1.6e-06, "litellm_provider": "cheaperinference", "max_input_tokens": 1050000, "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", "output_cost_per_token": 4.8e-06, - "output_cost_per_token_above_272k_tokens": 7.2e-06, + "output_cost_per_token_above_271999_tokens": 7.2e-06, "source": "https://cheaperinference.com/docs", "supported_endpoints": [ "/v1/chat/completions", @@ -3573,6 +3574,7 @@ "cache_read_input_token_cost": 6.375e-08, "input_cost_per_token": 6.375e-07, "litellm_provider": "cheaperinference", + "max_input_tokens": 1048576, "mode": "chat", "output_cost_per_token": 3.1875e-06, "source": "https://cheaperinference.com/docs", @@ -3738,6 +3740,7 @@ "cache_read_input_token_cost": 2.1e-08, "input_cost_per_token": 2.1e-07, "litellm_provider": "cheaperinference", + "max_input_tokens": 1048576, "mode": "chat", "output_cost_per_token": 1.75e-06, "source": "https://cheaperinference.com/docs", @@ -3756,6 +3759,7 @@ "cache_read_input_token_cost": 8.499e-09, "input_cost_per_token": 8.5e-08, "litellm_provider": "cheaperinference", + "max_input_tokens": 1047576, "mode": "chat", "output_cost_per_token": 3.4e-07, "source": "https://cheaperinference.com/docs", @@ -3841,7 +3845,7 @@ "max_output_tokens": 128000, "max_tokens": 128000, "mode": "chat", - "output_cost_per_token": 1.007109e-06, + "output_cost_per_token": 1.00711e-06, "source": "https://cheaperinference.com/docs", "supported_endpoints": [ "/v1/chat/completions", diff --git a/model_prices_and_context_window.schema.json b/model_prices_and_context_window.schema.json index d1ac3e67b2b..e03d33eb104 100644 --- a/model_prices_and_context_window.schema.json +++ b/model_prices_and_context_window.schema.json @@ -104,6 +104,11 @@ "minimum": 0, "description": "Rate applied once the prompt exceeds the token threshold in the field name." }, + "cache_creation_input_token_cost_above_271999_tokens": { + "type": "number", + "minimum": 0, + "description": "Rate applied once the prompt exceeds the token threshold in the field name." + }, "cache_creation_input_token_cost_above_272k_tokens": { "type": "number", "minimum": 0, @@ -158,6 +163,11 @@ "minimum": 0, "description": "Rate applied once the prompt exceeds the token threshold in the field name." }, + "cache_read_input_token_cost_above_271999_tokens": { + "type": "number", + "minimum": 0, + "description": "Rate applied once the prompt exceeds the token threshold in the field name." + }, "cache_read_input_token_cost_above_272k_tokens": { "type": "number", "minimum": 0, @@ -317,6 +327,11 @@ "minimum": 0, "description": "Rate applied once the prompt exceeds the token threshold in the field name." }, + "input_cost_per_token_above_271999_tokens": { + "type": "number", + "minimum": 0, + "description": "Rate applied once the prompt exceeds the token threshold in the field name." + }, "input_cost_per_token_above_272k_tokens": { "type": "number", "minimum": 0, @@ -507,6 +522,11 @@ "minimum": 0, "description": "Rate applied once the prompt exceeds the token threshold in the field name." }, + "output_cost_per_token_above_271999_tokens": { + "type": "number", + "minimum": 0, + "description": "Rate applied once the prompt exceeds the token threshold in the field name." + }, "output_cost_per_token_above_272k_tokens": { "type": "number", "minimum": 0, diff --git a/scripts/sync_cheaperinference_models.py b/scripts/sync_cheaperinference_models.py index d965368b6e4..040a5675fa3 100644 --- a/scripts/sync_cheaperinference_models.py +++ b/scripts/sync_cheaperinference_models.py @@ -7,9 +7,8 @@ generated PR body; ``--write`` applies the changes to the root cost map and its Policy highlights: - Only price fields (input/output/cache read/cache write, and their long-context variants) and the two limit fields (max_input_tokens, max_output_tokens/max_tokens) are synced from the catalog. -- The catalog's own long-context threshold picks the cost-map band. A threshold that matches no band - litellm understands leaves that entry untouched and is surfaced as a warning, so a moved threshold can - never be written out under the wrong band. +- The catalog's own long-context threshold names the cost-map band, at its exact value, so a moved + threshold is never rounded to a neighbouring band. - Capability flags (supports_vision, supports_reasoning, supports_tool_choice, and so on), litellm_provider, mode, source, and supported_endpoints are curated by hand and are never touched by this script. - A catalog model with no matching registry entry is surfaced as a warning for a human to add, never @@ -82,32 +81,33 @@ BASE_PRICE_FIELDS: Final = ( "cache_read_input_token_cost", "cache_creation_input_token_cost", ) -TIERED_BANDS: Final = { +# litellm takes the threshold from the field name, in either the `_above_128k_tokens` +# or the `_above_271999_tokens` spelling (litellm/litellm_core_utils/llm_cost_calc/utils.py). +# The k-form is reused for the thresholds that already have one in the cost map, so a +# catalog threshold of any size is written out at its exact value. +CANONICAL_BANDS: Final = { 128_000: "above_128k_tokens", 200_000: "above_200k_tokens", 256_000: "above_256k_tokens", 272_000: "above_272k_tokens", 512_000: "above_512k_tokens", } -BAND_TOLERANCE_TOKENS: Final = 1 -TIERED_PRICE_FIELDS: Final = tuple( - f"{field}_{band}" for band in TIERED_BANDS.values() for field in BASE_PRICE_FIELDS -) -SYNCED_PRICE_FIELDS: Final = BASE_PRICE_FIELDS + TIERED_PRICE_FIELDS +TIERED_FIELD_PREFIXES: Final = tuple(f"{field}_above_" for field in BASE_PRICE_FIELDS) def per_token(price_per_million: str) -> float: return float(f"{float(price_per_million) / 1e6:.6g}") -def band_for_threshold(threshold: int) -> str | None: - for supported, band in TIERED_BANDS.items(): - if abs(threshold - supported) <= BAND_TOLERANCE_TOKENS: - return band - return None +def band_for_threshold(threshold: int) -> str: + return CANONICAL_BANDS.get(threshold, f"above_{threshold}_tokens") -def _price_fields(pricing: CatalogPricing) -> tuple[RegistryEntry, int | None]: +def is_tiered_price_field(name: str) -> bool: + return name.endswith("_tokens") and name.startswith(TIERED_FIELD_PREFIXES) + + +def _price_fields(pricing: CatalogPricing) -> RegistryEntry: base: Final[RegistryEntry] = { "input_cost_per_token": per_token(pricing.input_per_million), "output_cost_per_token": per_token(pricing.output_per_million), @@ -115,18 +115,16 @@ def _price_fields(pricing: CatalogPricing) -> tuple[RegistryEntry, int | None]: "cache_creation_input_token_cost": per_token(pricing.cache_write_input_per_million), } if pricing.above_threshold is None: - return base, None + return base above: Final = pricing.above_threshold band: Final = band_for_threshold(above.input_token_price_threshold) - if band is None: - return base, above.input_token_price_threshold return { **base, f"input_cost_per_token_{band}": per_token(above.input_per_million), f"output_cost_per_token_{band}": per_token(above.output_per_million), f"cache_read_input_token_cost_{band}": per_token(above.cache_read_input_per_million), f"cache_creation_input_token_cost_{band}": per_token(above.cache_write_input_per_million), - }, None + } def _limit_fields(model: CatalogModel) -> RegistryEntry: @@ -139,9 +137,8 @@ def _limit_fields(model: CatalogModel) -> RegistryEntry: return fields -def _synced_fields(model: CatalogModel) -> tuple[RegistryEntry, int | None]: - prices, unmappable_threshold = _price_fields(model.pricing) - return {**prices, **_limit_fields(model)}, unmappable_threshold +def _synced_fields(model: CatalogModel) -> RegistryEntry: + return {**_price_fields(model.pricing), **_limit_fields(model)} @dataclass(frozen=True, slots=True) @@ -150,7 +147,6 @@ class SyncOutcome: updated: tuple[str, ...] = () unpriced_new_models: tuple[str, ...] = () missing_from_catalog: tuple[str, ...] = () - unmappable_thresholds: tuple[str, ...] = () @property def has_changes(self) -> bool: @@ -161,7 +157,6 @@ class SyncOutcome: return ( tuple(f"new in the catalog, not registered: {key}" for key in self.unpriced_new_models) + tuple(f"registered but gone from the catalog: {key}" for key in self.missing_from_catalog) - + tuple(f"long-context threshold matches no cost-map band, entry left untouched: {key}" for key in self.unmappable_thresholds) ) @@ -171,7 +166,6 @@ def compute_sync(cost_map: CostMap, catalog: Sequence[CatalogModel]) -> SyncOutc updated: Final[list[str]] = [] missing: Final[list[str]] = [] - unmappable: Final[list[str]] = [] result: Final[CostMap] = dict(cost_map) for model_id, key in sorted(registry_ids.items()): @@ -182,11 +176,8 @@ def compute_sync(cost_map: CostMap, catalog: Sequence[CatalogModel]) -> SyncOutc entry = result.get(key) if not isinstance(entry, dict): continue - desired, unmappable_threshold = _synced_fields(model) - if unmappable_threshold is not None: - unmappable.append(f"{key} (threshold {unmappable_threshold})") - continue - stale_tiered: Final = tuple(f for f in TIERED_PRICE_FIELDS if f not in desired) + desired: Final = _synced_fields(model) + stale_tiered: Final = tuple(f for f in entry if is_tiered_price_field(f) and f not in desired) changes: Final = tuple( f"{name}: {entry.get(name)!r} -> {value!r}" for name, value in desired.items() if entry.get(name) != value ) + tuple(f"{name}: {entry[name]!r} removed (not priced in that band any more)" for name in stale_tiered if name in entry) @@ -205,7 +196,6 @@ def compute_sync(cost_map: CostMap, catalog: Sequence[CatalogModel]) -> SyncOutc updated=tuple(updated), unpriced_new_models=unpriced_new, missing_from_catalog=tuple(sorted(missing)), - unmappable_thresholds=tuple(sorted(unmappable)), ) @@ -224,15 +214,13 @@ def render_pr_body(outcome: SyncOutcome) -> str: f"{_section_block('New in the catalog, not yet registered (needs a human review for capabilities)', outcome.unpriced_new_models)}" "\n" f"{_section_block('Registered but missing from the catalog', outcome.missing_from_catalog)}" - "\n" - f"{_section_block('Long-context threshold with no matching cost-map band (left untouched)', outcome.unmappable_thresholds)}" ) def render_summary(outcome: SyncOutcome) -> str: return ( f"updated={len(outcome.updated)} new_unregistered={len(outcome.unpriced_new_models)} " - f"missing={len(outcome.missing_from_catalog)} unmappable_thresholds={len(outcome.unmappable_thresholds)}" + f"missing={len(outcome.missing_from_catalog)}" ) diff --git a/tests/test_litellm/fixtures/cheaperinference_sync/models.json b/tests/test_litellm/fixtures/cheaperinference_sync/models.json index 417b01ac9f8..be9d575e423 100644 --- a/tests/test_litellm/fixtures/cheaperinference_sync/models.json +++ b/tests/test_litellm/fixtures/cheaperinference_sync/models.json @@ -1,1561 +1,71 @@ { "object": "list", "data": [ - { - "id": "aion-labs.aion-2-0", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Aion Labs", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 128000, - "max_output_tokens": 32768, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.790698", - "output_per_million": "1.581396", - "cache_read_input_per_million": "0.085000", - "cache_write_input_per_million": "0.790698", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "1.000000", - "list_output_per_million": "2.000000", - "discount_percent": "20.93", - "currency": "USD" - } - }, { "id": "claude-fable-5.1", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 1000000, "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "7.000000", "output_per_million": "35.000000", "cache_read_input_per_million": "0.175000", - "cache_write_input_per_million": "8.500000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "10.000000", - "list_output_per_million": "50.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-fable-5", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "7.000000", - "output_per_million": "35.000000", - "cache_read_input_per_million": "0.700000", - "cache_write_input_per_million": "8.500000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "10.000000", - "list_output_per_million": "50.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-haiku-4.5", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 200000, - "max_output_tokens": 64000, - "capabilities": { - "vision": true, - "reasoning": false, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.700000", - "output_per_million": "3.500000", - "cache_read_input_per_million": "0.070000", - "cache_write_input_per_million": "0.850000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "1.000000", - "list_output_per_million": "5.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-opus-4-8-fast", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": false, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "8.400000", - "output_per_million": "42.000000", - "cache_read_input_per_million": "0.840000", - "cache_write_input_per_million": "10.200000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "12.000000", - "list_output_per_million": "60.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-opus-4.5", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 198000, - "max_output_tokens": 32768, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "3.500000", - "output_per_million": "17.500000", - "cache_read_input_per_million": "0.350000", - "cache_write_input_per_million": "4.250000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "5.000000", - "list_output_per_million": "25.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-opus-4.6", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "3.500000", - "output_per_million": "17.500000", - "cache_read_input_per_million": "0.350000", - "cache_write_input_per_million": "4.250000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "5.000000", - "list_output_per_million": "25.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-opus-4.7", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": false, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "3.500000", - "output_per_million": "17.500000", - "cache_read_input_per_million": "0.350000", - "cache_write_input_per_million": "4.250000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "5.000000", - "list_output_per_million": "25.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-opus-4.8", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "3.500000", - "output_per_million": "17.500000", - "cache_read_input_per_million": "0.350000", - "cache_write_input_per_million": "4.250000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "5.000000", - "list_output_per_million": "25.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-opus-5-fast", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "7.000000", - "output_per_million": "35.000000", - "cache_read_input_per_million": "0.700000", - "cache_write_input_per_million": "8.500000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "10.000000", - "list_output_per_million": "50.000000", - "discount_percent": "30.00", - "currency": "USD" + "cache_write_input_per_million": "8.500000" } }, { "id": "claude-opus-5", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 1000000, "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "3.500000", "output_per_million": "17.500000", "cache_read_input_per_million": "0.350000", - "cache_write_input_per_million": "4.250000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "5.000000", - "list_output_per_million": "25.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-sonnet-4.5", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 198000, - "max_output_tokens": 64000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "2.100000", - "output_per_million": "10.500000", - "cache_read_input_per_million": "0.210000", - "cache_write_input_per_million": "2.550000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "3.000000", - "list_output_per_million": "15.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-sonnet-4.6", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 64000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "2.100000", - "output_per_million": "10.500000", - "cache_read_input_per_million": "0.210000", - "cache_write_input_per_million": "2.550000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "3.000000", - "list_output_per_million": "15.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "claude-sonnet-5", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Anthropic", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 64000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "1.400000", - "output_per_million": "7.000000", - "cache_read_input_per_million": "0.140000", - "cache_write_input_per_million": "1.700000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "2.000000", - "list_output_per_million": "10.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "deepseek-v4-flash-0731", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "DeepSeek", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 65536, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.045600", - "output_per_million": "0.091800", - "cache_read_input_per_million": "0.006460", - "cache_write_input_per_million": "0.045600", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.076000", - "list_output_per_million": "0.153000", - "discount_percent": "40.00", - "currency": "USD" - } - }, - { - "id": "deepseek-v4-flash", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "DeepSeek", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.071388", - "output_per_million": "0.142777", - "cache_read_input_per_million": "0.011050", - "cache_write_input_per_million": "0.071388", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.130000", - "list_output_per_million": "0.260000", - "discount_percent": "45.09", - "currency": "USD" - } - }, - { - "id": "deepseek-v4-pro-0813", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "DeepSeek", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 384000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.462000", - "output_per_million": "1.386000", - "cache_read_input_per_million": "0.015410", - "cache_write_input_per_million": "0.462000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.660000", - "list_output_per_million": "1.980000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "deepseek-v4-pro", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "DeepSeek", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.462000", - "output_per_million": "1.386000", - "cache_read_input_per_million": "0.038981", - "cache_write_input_per_million": "0.462000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.660000", - "list_output_per_million": "1.980000", - "discount_percent": "30.00", - "currency": "USD" + "cache_write_input_per_million": "4.250000" } }, { "id": "deepseek-v4.1-flash", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "DeepSeek", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 1048576, "max_output_tokens": 384000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.105000", - "output_per_million": "0.420000", - "cache_read_input_per_million": "0.002100", - "cache_write_input_per_million": "0.105000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.150000", - "list_output_per_million": "0.600000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gemini-2.5-flash", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 65535, - "capabilities": { - "vision": true, - "reasoning": false, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "0.210000", - "output_per_million": "1.750000", - "cache_read_input_per_million": "0.021000", - "cache_write_input_per_million": "0.058310", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.300000", - "list_output_per_million": "2.500000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gemini-3-5-flash", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 65536, - "capabilities": { - "vision": true, - "reasoning": false, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "1.050000", - "output_per_million": "6.300000", - "cache_read_input_per_million": "0.105000", - "cache_write_input_per_million": "0.058310", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "1.500000", - "list_output_per_million": "9.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gemini-3-flash-preview", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 256000, - "max_output_tokens": 65536, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.350000", - "output_per_million": "2.100000", - "cache_read_input_per_million": "0.035000", - "cache_write_input_per_million": "0.058310", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.500000", - "list_output_per_million": "3.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gemini-3.1-flash-lite", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 65536, - "capabilities": { - "vision": true, - "reasoning": false, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.201421", - "output_per_million": "1.208530", - "cache_read_input_per_million": "0.021250", - "cache_write_input_per_million": "0.067113", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.250000", - "list_output_per_million": "1.500000", - "discount_percent": "19.43", - "currency": "USD" - } - }, - { - "id": "gemini-3.1-pro-preview", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 32768, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "1.400000", - "output_per_million": "8.400000", - "cache_read_input_per_million": "0.140000", - "cache_write_input_per_million": "0.262500", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "2.000000", - "list_output_per_million": "12.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gemini-3.1-pro", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 65536, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "1.700000", - "output_per_million": "10.200000", - "cache_read_input_per_million": "0.170000", - "cache_write_input_per_million": "1.700000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "2.000000", - "list_output_per_million": "12.000000", - "discount_percent": "15.00", - "currency": "USD" - } - }, - { - "id": "gemini-3.6-flash", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": null, - "max_output_tokens": null, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.637500", - "output_per_million": "3.187500", - "cache_read_input_per_million": "0.063750", - "cache_write_input_per_million": "0.035416", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.750000", - "list_output_per_million": "3.750000", - "discount_percent": "15.00", - "currency": "USD" - } - }, - { - "id": "gemini-3.7-flash", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 65536, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.525000", - "output_per_million": "2.625000", - "cache_read_input_per_million": "0.052500", - "cache_write_input_per_million": "0.029190", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.750000", - "list_output_per_million": "3.750000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "glm-4.5-air", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 128000, - "max_output_tokens": 32768, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.104739", - "output_per_million": "0.605000", - "cache_read_input_per_million": "0.017000", - "cache_write_input_per_million": "0.104739", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.200000", - "list_output_per_million": "1.100000", - "discount_percent": "45.00", - "currency": "USD" - } - }, - { - "id": "glm-4.5", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 128000, - "max_output_tokens": 32768, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.330000", - "output_per_million": "1.210000", - "cache_read_input_per_million": "0.051000", - "cache_write_input_per_million": "0.330000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.600000", - "list_output_per_million": "2.200000", - "discount_percent": "45.00", - "currency": "USD" - } - }, - { - "id": "glm-4.6", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 198000, - "max_output_tokens": 16384, - "capabilities": { - "vision": false, - "reasoning": false, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.330000", - "output_per_million": "1.210000", - "cache_read_input_per_million": "0.051000", - "cache_write_input_per_million": "0.330000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.600000", - "list_output_per_million": "2.200000", - "discount_percent": "45.00", - "currency": "USD" - } - }, - { - "id": "glm-4.7", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 128000, - "max_output_tokens": 32768, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.322274", - "output_per_million": "1.210000", - "cache_read_input_per_million": "0.051000", - "cache_write_input_per_million": "0.322274", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.600000", - "list_output_per_million": "2.200000", - "discount_percent": "45.00", - "currency": "USD" - } - }, - { - "id": "glm-5.1", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 200000, - "max_output_tokens": 24000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.770000", - "output_per_million": "2.420000", - "cache_read_input_per_million": "0.119000", - "cache_write_input_per_million": "0.770000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "1.400000", - "list_output_per_million": "4.400000", - "discount_percent": "45.00", - "currency": "USD" - } - }, - { - "id": "glm-5.2", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 131072, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.440000", - "output_per_million": "1.402500", - "cache_read_input_per_million": "0.068000", - "cache_write_input_per_million": "0.440000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.800000", - "list_output_per_million": "2.550000", - "discount_percent": "45.00", - "currency": "USD" - } - }, - { - "id": "glm-5.3-flash", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 131072, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.080568", - "output_per_million": "0.268535", - "cache_read_input_per_million": "0.012750", - "cache_write_input_per_million": "0.080568", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.150000", - "list_output_per_million": "0.500000", - "discount_percent": "46.29", - "currency": "USD" + "output_per_million": "0.840000", + "cache_read_input_per_million": "0.004200", + "cache_write_input_per_million": "0.210000" } }, { "id": "glm-5.3", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 1000000, "max_output_tokens": 131072, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "0.770000", "output_per_million": "2.420000", "cache_read_input_per_million": "0.119000", - "cache_write_input_per_million": "0.770000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "1.400000", - "list_output_per_million": "4.400000", - "discount_percent": "45.00", - "currency": "USD" + "cache_write_input_per_million": "0.770000" } }, { - "id": "glm-5", + "id": "glm-5.3-flash", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Z.ai", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 198000, - "max_output_tokens": 32768, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.483412", - "output_per_million": "1.546919", - "cache_read_input_per_million": "0.085000", - "cache_write_input_per_million": "0.483412", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "1.000000", - "list_output_per_million": "3.200000", - "discount_percent": "51.66", - "currency": "USD" - } - }, - { - "id": "google/gemini-3.5-flash-lite", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Google", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": null, - "max_output_tokens": null, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.210000", - "output_per_million": "1.750000", - "cache_read_input_per_million": "0.021000", - "cache_write_input_per_million": "0.078333", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.300000", - "list_output_per_million": "2.500000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gpt-4.1-nano", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": null, - "max_output_tokens": null, - "capabilities": { - "vision": true, - "reasoning": false, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.085000", - "output_per_million": "0.340000", - "cache_read_input_per_million": "0.008499", - "cache_write_input_per_million": "0.085000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.100000", - "list_output_per_million": "0.400000", - "discount_percent": "15.00", - "currency": "USD" - } - }, - { - "id": "gpt-5-mini", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 400000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.201421", - "output_per_million": "1.611374", - "cache_read_input_per_million": "0.020142", - "cache_write_input_per_million": "0.201421", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.250000", - "list_output_per_million": "2.000000", - "discount_percent": "19.43", - "currency": "USD" - } - }, - { - "id": "gpt-5-nano", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 400000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.040284", - "output_per_million": "0.322274", - "cache_read_input_per_million": "0.004028", - "cache_write_input_per_million": "0.040284", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.050000", - "list_output_per_million": "0.400000", - "discount_percent": "19.43", - "currency": "USD" - } - }, - { - "id": "gpt-5.2-codex", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 256000, - "max_output_tokens": 65536, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "1.225000", - "output_per_million": "9.800000", - "cache_read_input_per_million": "0.122500", - "cache_write_input_per_million": "1.225000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "1.750000", - "list_output_per_million": "14.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gpt-5.4-mini", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 400000, - "max_output_tokens": 128000, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.525000", - "output_per_million": "3.150000", - "cache_read_input_per_million": "0.052500", - "cache_write_input_per_million": "0.525000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.750000", - "list_output_per_million": "4.500000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gpt-5.4-nano", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 400000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.140000", - "output_per_million": "0.875000", - "cache_read_input_per_million": "0.014000", - "cache_write_input_per_million": "0.140000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.200000", - "list_output_per_million": "1.250000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gpt-5.4", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, + "context_length": 1048576, "max_output_tokens": 131072, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { - "input_per_million": "1.750000", - "output_per_million": "10.500000", - "cache_read_input_per_million": "0.175000", - "cache_write_input_per_million": "1.750000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "2.500000", - "list_output_per_million": "15.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gpt-5.5-pro", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "21.000000", - "output_per_million": "126.000000", - "cache_read_input_per_million": "2.550000", - "cache_write_input_per_million": "21.000000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "30.000000", - "list_output_per_million": "180.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gpt-5.5", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "3.500000", - "output_per_million": "21.000000", - "cache_read_input_per_million": "0.350000", - "cache_write_input_per_million": "3.500000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "5.000000", - "list_output_per_million": "30.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gpt-5.6-luna", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1050000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.080000", - "output_per_million": "0.480000", - "cache_read_input_per_million": "0.008000", - "cache_write_input_per_million": "0.100000", - "above_threshold": { - "input_token_price_threshold": 271999, - "input_per_million": "0.160000", - "output_per_million": "0.720000", - "cache_read_input_per_million": "0.016000", - "cache_write_input_per_million": "0.200000" - }, - "input_token_price_threshold": 271999, - "list_input_per_million": "0.200000", - "list_output_per_million": "1.200000", - "discount_percent": "60.00", - "currency": "USD" - } - }, - { - "id": "gpt-5.6-sol", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1050000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "1.000000", - "output_per_million": "5.000000", - "cache_read_input_per_million": "0.100000", - "cache_write_input_per_million": "1.250000", - "above_threshold": { - "input_token_price_threshold": 271999, - "input_per_million": "2.000000", - "output_per_million": "7.500000", - "cache_read_input_per_million": "0.200000", - "cache_write_input_per_million": "2.500000" - }, - "input_token_price_threshold": 271999, - "list_input_per_million": "2.000000", - "list_output_per_million": "10.000000", - "discount_percent": "50.00", - "currency": "USD" - } - }, - { - "id": "gpt-5.6-terra", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1050000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.800000", - "output_per_million": "4.800000", - "cache_read_input_per_million": "0.080000", - "cache_write_input_per_million": "1.000000", - "above_threshold": { - "input_token_price_threshold": 271999, - "input_per_million": "1.600000", - "output_per_million": "7.200000", - "cache_read_input_per_million": "0.160000", - "cache_write_input_per_million": "2.000000" - }, - "input_token_price_threshold": 271999, - "list_input_per_million": "2.000000", - "list_output_per_million": "12.000000", - "discount_percent": "60.00", - "currency": "USD" + "input_per_million": "0.072511", + "output_per_million": "0.241706", + "cache_read_input_per_million": "0.012750", + "cache_write_input_per_million": "0.072511" } }, { "id": "gpt-6-astra", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 1050000, "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "7.000000", "output_per_million": "35.000000", @@ -1567,596 +77,751 @@ "output_per_million": "52.500000", "cache_read_input_per_million": "1.400000", "cache_write_input_per_million": "17.000000" - }, - "input_token_price_threshold": 272000, - "list_input_per_million": "10.000000", - "list_output_per_million": "50.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "gpt-oss-120b", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "OpenAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": null, - "max_output_tokens": null, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.040000", - "output_per_million": "0.200000", - "cache_read_input_per_million": "0.008500", - "cache_write_input_per_million": "0.040000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.100000", - "list_output_per_million": "0.500000", - "discount_percent": "60.00", - "currency": "USD" - } - }, - { - "id": "grok-4.5", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "xAI", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 500000, - "max_output_tokens": 128000, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "1.400000", - "output_per_million": "4.200000", - "cache_read_input_per_million": "0.170000", - "cache_write_input_per_million": "1.400000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "2.000000", - "list_output_per_million": "6.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "kimi-k3", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Moonshot", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1000000, - "max_output_tokens": 131072, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "2.100000", - "output_per_million": "10.500000", - "cache_read_input_per_million": "0.239969", - "cache_write_input_per_million": "2.100000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "3.000000", - "list_output_per_million": "15.000000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "minimax-m2.7", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "MiniMax", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 198000, - "max_output_tokens": 32768, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.210000", - "output_per_million": "0.840000", - "cache_read_input_per_million": "0.025500", - "cache_write_input_per_million": "0.255000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.300000", - "list_output_per_million": "1.200000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "muse-spark-1.2", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Meta", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 1048576, - "max_output_tokens": 943718, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "1.062500", - "output_per_million": "3.612500", - "cache_read_input_per_million": "0.106250", - "cache_write_input_per_million": "1.062500", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "1.250000", - "list_output_per_million": "4.250000", - "discount_percent": "15.00", - "currency": "USD" + } } }, { "id": "qwen-3-8-27b", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Qwen", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 262144, "max_output_tokens": 65536, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "0.149800", "output_per_million": "1.785000", "cache_read_input_per_million": "0.018190", - "cache_write_input_per_million": "0.149800", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.214000", - "list_output_per_million": "2.550000", - "discount_percent": "30.00", - "currency": "USD" + "cache_write_input_per_million": "0.149800" } }, { - "id": "qwen-3-8-max", + "id": "seedance-2.0", + "type": "video", + "context_length": null, + "max_output_tokens": null, + "pricing": { + "input_per_million": "0.000000", + "output_per_million": "0.000000", + "cache_read_input_per_million": "0.000000", + "cache_write_input_per_million": "0.000000" + } + }, + { + "id": "glm-5.2", + "type": "text", + "context_length": 1048576, + "max_output_tokens": 131072, + "pricing": { + "input_per_million": "0.440000", + "output_per_million": "1.402500", + "cache_read_input_per_million": "0.068000", + "cache_write_input_per_million": "0.440000" + } + }, + { + "id": "gpt-5.6-sol", + "type": "text", + "context_length": 1050000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "1.000000", + "output_per_million": "5.000000", + "cache_read_input_per_million": "0.100000", + "cache_write_input_per_million": "1.250000", + "above_threshold": { + "input_token_price_threshold": 271999, + "input_per_million": "2.000000", + "output_per_million": "7.500000", + "cache_read_input_per_million": "0.200000", + "cache_write_input_per_million": "2.500000" + } + } + }, + { + "id": "claude-fable-5", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "7.000000", + "output_per_million": "35.000000", + "cache_read_input_per_million": "0.700000", + "cache_write_input_per_million": "8.500000" + } + }, + { + "id": "kimi-k3", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 131072, + "pricing": { + "input_per_million": "2.100000", + "output_per_million": "10.500000", + "cache_read_input_per_million": "0.239969", + "cache_write_input_per_million": "2.100000" + } + }, + { + "id": "gpt-5.6-terra", + "type": "text", + "context_length": 1050000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "0.800000", + "output_per_million": "4.800000", + "cache_read_input_per_million": "0.080000", + "cache_write_input_per_million": "1.000000", + "above_threshold": { + "input_token_price_threshold": 271999, + "input_per_million": "1.600000", + "output_per_million": "7.200000", + "cache_read_input_per_million": "0.160000", + "cache_write_input_per_million": "2.000000" + } + } + }, + { + "id": "gpt-5.6-luna", + "type": "text", + "context_length": 1050000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "0.080000", + "output_per_million": "0.480000", + "cache_read_input_per_million": "0.008000", + "cache_write_input_per_million": "0.100000", + "above_threshold": { + "input_token_price_threshold": 271999, + "input_per_million": "0.160000", + "output_per_million": "0.720000", + "cache_read_input_per_million": "0.016000", + "cache_write_input_per_million": "0.200000" + } + } + }, + { + "id": "claude-opus-4-8-fast", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "8.400000", + "output_per_million": "42.000000", + "cache_read_input_per_million": "0.840000", + "cache_write_input_per_million": "10.200000" + } + }, + { + "id": "nano-banana", + "type": "image", + "context_length": null, + "max_output_tokens": null, + "pricing": { + "input_per_million": "0.210000", + "output_per_million": "1.750000", + "cache_read_input_per_million": "0.000000", + "cache_write_input_per_million": "0.000000" + } + }, + { + "id": "claude-opus-4.8", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "3.500000", + "output_per_million": "17.500000", + "cache_read_input_per_million": "0.350000", + "cache_write_input_per_million": "4.250000" + } + }, + { + "id": "claude-opus-4.7", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "3.500000", + "output_per_million": "17.500000", + "cache_read_input_per_million": "0.350000", + "cache_write_input_per_million": "4.250000" + } + }, + { + "id": "claude-opus-4.6", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "3.500000", + "output_per_million": "17.500000", + "cache_read_input_per_million": "0.350000", + "cache_write_input_per_million": "4.250000" + } + }, + { + "id": "gpt-5.5", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "3.500000", + "output_per_million": "21.000000", + "cache_read_input_per_million": "0.350000", + "cache_write_input_per_million": "3.500000" + } + }, + { + "id": "gpt-5.4", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Alibaba", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 1000000, "max_output_tokens": 131072, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "1.750000", - "output_per_million": "5.250000", - "cache_read_input_per_million": "0.212500", - "cache_write_input_per_million": "2.125000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "2.500000", - "list_output_per_million": "7.500000", - "discount_percent": "30.00", - "currency": "USD" + "output_per_million": "10.500000", + "cache_read_input_per_million": "0.175000", + "cache_write_input_per_million": "1.750000" + } + }, + { + "id": "gemini-3.1-pro-preview", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 32768, + "pricing": { + "input_per_million": "1.400000", + "output_per_million": "8.400000", + "cache_read_input_per_million": "0.140000", + "cache_write_input_per_million": "0.262500" + } + }, + { + "id": "grok-imagine", + "type": "image", + "context_length": null, + "max_output_tokens": null, + "pricing": { + "input_per_million": "0.000000", + "output_per_million": "0.000000", + "cache_read_input_per_million": "0.000000", + "cache_write_input_per_million": "0.000000" + } + }, + { + "id": "nano-banana-pro", + "type": "image", + "context_length": null, + "max_output_tokens": null, + "pricing": { + "input_per_million": "1.400000", + "output_per_million": "8.400000", + "cache_read_input_per_million": "0.140000", + "cache_write_input_per_million": "0.352500" + } + }, + { + "id": "nano-banana-2", + "type": "image", + "context_length": null, + "max_output_tokens": null, + "pricing": { + "input_per_million": "0.350000", + "output_per_million": "2.100000", + "cache_read_input_per_million": "0.035000", + "cache_write_input_per_million": "0.350000" + } + }, + { + "id": "claude-sonnet-5", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 64000, + "pricing": { + "input_per_million": "1.400000", + "output_per_million": "7.000000", + "cache_read_input_per_million": "0.140000", + "cache_write_input_per_million": "1.700000" + } + }, + { + "id": "claude-sonnet-4.6", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 64000, + "pricing": { + "input_per_million": "2.100000", + "output_per_million": "10.500000", + "cache_read_input_per_million": "0.210000", + "cache_write_input_per_million": "2.550000" + } + }, + { + "id": "gpt-image-2", + "type": "image", + "context_length": null, + "max_output_tokens": null, + "pricing": { + "input_per_million": "3.779070", + "output_per_million": "21.000000", + "cache_read_input_per_million": "0.425000", + "cache_write_input_per_million": "3.779070" + } + }, + { + "id": "deepseek-v4-flash", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "0.071388", + "output_per_million": "0.142777", + "cache_read_input_per_million": "0.011050", + "cache_write_input_per_million": "0.071388" + } + }, + { + "id": "minimax-m2.7", + "type": "text", + "context_length": 198000, + "max_output_tokens": 32768, + "pricing": { + "input_per_million": "0.210000", + "output_per_million": "0.840000", + "cache_read_input_per_million": "0.025500", + "cache_write_input_per_million": "0.255000" + } + }, + { + "id": "grok-4.5", + "type": "text", + "context_length": 500000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "1.400000", + "output_per_million": "4.200000", + "cache_read_input_per_million": "0.170000", + "cache_write_input_per_million": "1.400000" + } + }, + { + "id": "deepseek-v4-pro", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "0.462000", + "output_per_million": "1.386000", + "cache_read_input_per_million": "0.038981", + "cache_write_input_per_million": "0.462000" + } + }, + { + "id": "gemini-3-5-flash", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 65536, + "pricing": { + "input_per_million": "1.050000", + "output_per_million": "6.300000", + "cache_read_input_per_million": "0.105000", + "cache_write_input_per_million": "0.058310" + } + }, + { + "id": "gpt-5.4-mini", + "type": "text", + "context_length": 400000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "0.525000", + "output_per_million": "3.150000", + "cache_read_input_per_million": "0.052500", + "cache_write_input_per_million": "0.525000" + } + }, + { + "id": "aion-labs.aion-2-0", + "type": "text", + "context_length": 128000, + "max_output_tokens": 32768, + "pricing": { + "input_per_million": "0.790698", + "output_per_million": "1.581396", + "cache_read_input_per_million": "0.085000", + "cache_write_input_per_million": "0.790698" + } + }, + { + "id": "claude-haiku-4.5", + "type": "text", + "context_length": 200000, + "max_output_tokens": 64000, + "pricing": { + "input_per_million": "0.700000", + "output_per_million": "3.500000", + "cache_read_input_per_million": "0.070000", + "cache_write_input_per_million": "0.850000" + } + }, + { + "id": "claude-opus-4.5", + "type": "text", + "context_length": 198000, + "max_output_tokens": 32768, + "pricing": { + "input_per_million": "3.500000", + "output_per_million": "17.500000", + "cache_read_input_per_million": "0.350000", + "cache_write_input_per_million": "4.250000" + } + }, + { + "id": "claude-sonnet-4.5", + "type": "text", + "context_length": 198000, + "max_output_tokens": 64000, + "pricing": { + "input_per_million": "2.100000", + "output_per_million": "10.500000", + "cache_read_input_per_million": "0.210000", + "cache_write_input_per_million": "2.550000" + } + }, + { + "id": "gemini-2.5-flash", + "type": "text", + "context_length": 1048576, + "max_output_tokens": 65535, + "pricing": { + "input_per_million": "0.210000", + "output_per_million": "1.750000", + "cache_read_input_per_million": "0.021000", + "cache_write_input_per_million": "0.058310" + } + }, + { + "id": "gemini-3.1-pro", + "type": "text", + "context_length": 1048576, + "max_output_tokens": 65536, + "pricing": { + "input_per_million": "1.700000", + "output_per_million": "10.200000", + "cache_read_input_per_million": "0.170000", + "cache_write_input_per_million": "1.700000" + } + }, + { + "id": "gemini-3-flash-preview", + "type": "text", + "context_length": 256000, + "max_output_tokens": 65536, + "pricing": { + "input_per_million": "0.350000", + "output_per_million": "2.100000", + "cache_read_input_per_million": "0.035000", + "cache_write_input_per_million": "0.058310" + } + }, + { + "id": "glm-4.5", + "type": "text", + "context_length": 128000, + "max_output_tokens": 32768, + "pricing": { + "input_per_million": "0.330000", + "output_per_million": "1.210000", + "cache_read_input_per_million": "0.051000", + "cache_write_input_per_million": "0.330000" + } + }, + { + "id": "glm-4.5-air", + "type": "text", + "context_length": 128000, + "max_output_tokens": 32768, + "pricing": { + "input_per_million": "0.104739", + "output_per_million": "0.605000", + "cache_read_input_per_million": "0.017000", + "cache_write_input_per_million": "0.104739" + } + }, + { + "id": "glm-4.6", + "type": "text", + "context_length": 198000, + "max_output_tokens": 16384, + "pricing": { + "input_per_million": "0.330000", + "output_per_million": "1.210000", + "cache_read_input_per_million": "0.051000", + "cache_write_input_per_million": "0.330000" + } + }, + { + "id": "glm-4.7", + "type": "text", + "context_length": 128000, + "max_output_tokens": 32768, + "pricing": { + "input_per_million": "0.322274", + "output_per_million": "1.210000", + "cache_read_input_per_million": "0.051000", + "cache_write_input_per_million": "0.322274" + } + }, + { + "id": "glm-5", + "type": "text", + "context_length": 198000, + "max_output_tokens": 32768, + "pricing": { + "input_per_million": "0.483412", + "output_per_million": "1.546919", + "cache_read_input_per_million": "0.085000", + "cache_write_input_per_million": "0.483412" + } + }, + { + "id": "glm-5.1", + "type": "text", + "context_length": 200000, + "max_output_tokens": 24000, + "pricing": { + "input_per_million": "0.770000", + "output_per_million": "2.420000", + "cache_read_input_per_million": "0.119000", + "cache_write_input_per_million": "0.770000" + } + }, + { + "id": "gemini-3.1-flash-lite", + "type": "text", + "context_length": 1048576, + "max_output_tokens": 65536, + "pricing": { + "input_per_million": "0.201421", + "output_per_million": "1.208530", + "cache_read_input_per_million": "0.021250", + "cache_write_input_per_million": "0.067113" + } + }, + { + "id": "google/gemini-3.5-flash-lite", + "type": "text", + "context_length": 1048576, + "max_output_tokens": null, + "pricing": { + "input_per_million": "0.210000", + "output_per_million": "1.750000", + "cache_read_input_per_million": "0.021000", + "cache_write_input_per_million": "0.078333" + } + }, + { + "id": "claude-opus-5-fast", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "7.000000", + "output_per_million": "35.000000", + "cache_read_input_per_million": "0.700000", + "cache_write_input_per_million": "8.500000" + } + }, + { + "id": "deepseek-v4-flash-0731", + "type": "text", + "context_length": 1048576, + "max_output_tokens": 65536, + "pricing": { + "input_per_million": "0.045600", + "output_per_million": "0.091800", + "cache_read_input_per_million": "0.006460", + "cache_write_input_per_million": "0.045600" + } + }, + { + "id": "gpt-5-nano", + "type": "text", + "context_length": 400000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "0.040284", + "output_per_million": "0.322274", + "cache_read_input_per_million": "0.004028", + "cache_write_input_per_million": "0.040284" + } + }, + { + "id": "gpt-4.1-nano", + "type": "text", + "context_length": 1047576, + "max_output_tokens": null, + "pricing": { + "input_per_million": "0.085000", + "output_per_million": "0.340000", + "cache_read_input_per_million": "0.008499", + "cache_write_input_per_million": "0.085000" + } + }, + { + "id": "gpt-5.4-nano", + "type": "text", + "context_length": 400000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "0.161137", + "output_per_million": "1.007109", + "cache_read_input_per_million": "0.016114", + "cache_write_input_per_million": "0.161137" } }, { "id": "qwen3-5-35b-a3b", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Alibaba", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 256000, "max_output_tokens": 65536, - "capabilities": { - "vision": false, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "0.218750", "output_per_million": "0.875000", "cache_read_input_per_million": "0.026562", - "cache_write_input_per_million": "0.218750", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.312500", - "list_output_per_million": "1.250000", - "discount_percent": "30.00", - "currency": "USD" - } - }, - { - "id": "qwen3-6-35b-a3b", - "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Alibaba", - "object": "model", - "is_free": false, - "available_until": null, - "context_length": 262144, - "max_output_tokens": 262144, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, - "pricing": { - "input_per_million": "0.070000", - "output_per_million": "0.700000", - "cache_read_input_per_million": "0.008500", - "cache_write_input_per_million": "0.070000", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.100000", - "list_output_per_million": "1.000000", - "discount_percent": "30.00", - "currency": "USD" + "cache_write_input_per_million": "0.218750" } }, { "id": "qwen3.6-27b", "type": "text", - "endpoint": "/v1/chat/completions", - "owned_by": "Alibaba", - "object": "model", - "is_free": false, - "available_until": null, "context_length": 256000, "max_output_tokens": 32768, - "capabilities": { - "vision": true, - "reasoning": true, - "streaming": true, - "image_generation": false, - "image_edit": false, - "video": false - }, "pricing": { "input_per_million": "0.241706", "output_per_million": "1.611374", "cache_read_input_per_million": "0.024171", - "cache_write_input_per_million": "0.241706", - "above_threshold": null, - "input_token_price_threshold": null, - "list_input_per_million": "0.600000", - "list_output_per_million": "3.600000", - "discount_percent": "55.24", - "currency": "USD" + "cache_write_input_per_million": "0.241706" } }, { - "id": "seedance-2.0", - "context_length": null, - "max_output_tokens": null, - "object": "model", - "owned_by": "Bytedance", - "provider": "Bytedance", - "type": "video", - "endpoint": "/v1/videos/generations", - "capabilities": { - "vision": false, - "video": true, - "reasoning": false, - "streaming": true, - "image_generation": true, - "image_edit": false - }, - "is_free": false, - "available_until": null, + "id": "qwen3-6-35b-a3b", + "type": "text", + "context_length": 262144, + "max_output_tokens": 262144, "pricing": { - "currency": "USD", - "input_per_million": "0.000000", - "cache_read_input_per_million": "0.000000", - "cache_write_input_per_million": "0.000000", - "output_per_million": "0.000000", - "image_output_per_million": null, - "media_input_unit_price": null, - "media_unit_price": "0.128520", - "media_unit": "second", - "resolution_prices": { - "4K": "0.660960", - "480P": "0.057171", - "720P": "0.128520", - "1080P": "0.318070" - }, - "reference_resolution_prices": { - "4K": "0.777600", - "480P": "0.067260", - "720P": "0.151200", - "1080P": "0.374200" - }, - "image_pricing_unit": "second", - "discount_percent": "15.00", - "input_token_price_threshold": null, - "above_threshold": null, - "source": "catalog", - "list_input_per_million": "0.000000", - "list_output_per_million": "0.000000", - "zero_data_retention": false, - "zero_data_retention_route": null + "input_per_million": "0.070000", + "output_per_million": "0.700000", + "cache_read_input_per_million": "0.008500", + "cache_write_input_per_million": "0.070000" } }, { - "id": "nano-banana", - "context_length": null, + "id": "gemini-3.6-flash", + "type": "text", + "context_length": 1048576, "max_output_tokens": null, - "object": "model", - "owned_by": "Google", - "provider": "Google", - "type": "image", - "endpoint": "/v1/images/generations", - "capabilities": { - "vision": false, - "video": false, - "reasoning": false, - "streaming": false, - "image_generation": true, - "image_edit": false - }, - "is_free": false, - "available_until": null, "pricing": { - "currency": "USD", - "input_per_million": "0.210000", - "cache_read_input_per_million": "0.000000", - "cache_write_input_per_million": "0.000000", - "output_per_million": "1.750000", - "image_output_per_million": null, - "media_input_unit_price": null, - "media_unit_price": "0.031200", - "media_unit": "image", - "resolution_prices": { - "1K": "0.031200", - "2K": "0.031200", - "4K": "0.055715" - }, - "reference_resolution_prices": { - "1K": "0.039000", - "2K": "0.039000", - "4K": "0.069643" - }, - "image_pricing_unit": "image", - "discount_percent": "20.00", - "input_token_price_threshold": null, - "above_threshold": null, - "source": "catalog", - "list_input_per_million": "0.300000", - "list_output_per_million": "2.500000", - "zero_data_retention": false, - "zero_data_retention_route": null + "input_per_million": "0.637500", + "output_per_million": "3.187500", + "cache_read_input_per_million": "0.063750", + "cache_write_input_per_million": "0.035416" } }, { - "id": "grok-imagine", - "context_length": null, - "max_output_tokens": null, - "object": "model", - "owned_by": "xAI", - "provider": "xAI", - "type": "image", - "endpoint": "/v1/images/generations", - "capabilities": { - "vision": false, - "video": false, - "reasoning": false, - "streaming": false, - "image_generation": true, - "image_edit": false - }, - "is_free": false, - "available_until": null, + "id": "qwen-3-8-max", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 131072, "pricing": { - "currency": "USD", - "input_per_million": "0.000000", - "cache_read_input_per_million": "0.000000", - "cache_write_input_per_million": "0.000000", - "output_per_million": "0.000000", - "image_output_per_million": "10.179640", - "media_input_unit_price": "0.007000", - "media_unit_price": "0.035000", - "media_unit": "image", - "resolution_prices": {}, - "reference_resolution_prices": {}, - "image_pricing_unit": "image", - "discount_percent": "30.00", - "input_token_price_threshold": null, - "above_threshold": null, - "source": "catalog", - "list_input_per_million": "0.000000", - "list_output_per_million": "0.000000", - "zero_data_retention": false, - "zero_data_retention_route": null + "input_per_million": "1.750000", + "output_per_million": "5.250000", + "cache_read_input_per_million": "0.212500", + "cache_write_input_per_million": "2.125000" } }, { - "id": "nano-banana-pro", - "context_length": null, - "max_output_tokens": null, - "object": "model", - "owned_by": "Google", - "provider": "Google", - "type": "image", - "endpoint": "/v1/images/generations", - "capabilities": { - "vision": false, - "video": false, - "reasoning": false, - "streaming": false, - "image_generation": true, - "image_edit": false - }, - "is_free": false, - "available_until": null, + "id": "gpt-5.2-codex", + "type": "text", + "context_length": 256000, + "max_output_tokens": 65536, "pricing": { - "currency": "USD", - "input_per_million": "1.400000", - "cache_read_input_per_million": "0.140000", - "cache_write_input_per_million": "0.352500", - "output_per_million": "8.400000", - "image_output_per_million": "84.000000", - "media_input_unit_price": null, - "media_unit_price": null, - "media_unit": null, - "resolution_prices": {}, - "reference_resolution_prices": {}, - "image_pricing_unit": "token", - "discount_percent": "30.00", - "input_token_price_threshold": null, - "above_threshold": null, - "source": "catalog", - "list_input_per_million": "2.000000", - "list_output_per_million": "12.000000", - "zero_data_retention": false, - "zero_data_retention_route": null + "input_per_million": "1.225000", + "output_per_million": "9.800000", + "cache_read_input_per_million": "0.122500", + "cache_write_input_per_million": "1.225000" } }, { - "id": "nano-banana-2", - "context_length": null, - "max_output_tokens": null, - "object": "model", - "owned_by": "Google", - "provider": "Google", - "type": "image", - "endpoint": "/v1/images/generations", - "capabilities": { - "vision": false, - "video": false, - "reasoning": false, - "streaming": false, - "image_generation": true, - "image_edit": false - }, - "is_free": false, - "available_until": null, + "id": "gpt-5.5-pro", + "type": "text", + "context_length": 1000000, + "max_output_tokens": 128000, "pricing": { - "currency": "USD", - "input_per_million": "0.350000", - "cache_read_input_per_million": "0.035000", - "cache_write_input_per_million": "0.350000", - "output_per_million": "2.100000", - "image_output_per_million": "42.000000", - "media_input_unit_price": null, - "media_unit_price": null, - "media_unit": null, - "resolution_prices": {}, - "reference_resolution_prices": {}, - "image_pricing_unit": "token", - "discount_percent": "30.00", - "input_token_price_threshold": null, - "above_threshold": null, - "source": "catalog", - "list_input_per_million": "0.500000", - "list_output_per_million": "3.000000", - "zero_data_retention": false, - "zero_data_retention_route": null + "input_per_million": "21.000000", + "output_per_million": "126.000000", + "cache_read_input_per_million": "2.550000", + "cache_write_input_per_million": "21.000000" } }, { - "id": "gpt-image-2", - "context_length": null, + "id": "gpt-oss-120b", + "type": "text", + "context_length": 131072, "max_output_tokens": null, - "object": "model", - "owned_by": "OpenAI", - "provider": "OpenAI", - "type": "image", - "endpoint": "/v1/images/generations", - "capabilities": { - "vision": false, - "video": false, - "reasoning": false, - "streaming": false, - "image_generation": true, - "image_edit": false - }, - "is_free": false, - "available_until": null, "pricing": { - "currency": "USD", - "input_per_million": "3.779070", - "cache_read_input_per_million": "0.425000", - "cache_write_input_per_million": "3.779070", - "output_per_million": "21.000000", - "image_output_per_million": "22.674420", - "media_input_unit_price": null, - "media_unit_price": null, - "media_unit": null, - "resolution_prices": {}, - "reference_resolution_prices": {}, - "image_pricing_unit": "token", - "discount_percent": "24.42", - "input_token_price_threshold": null, - "above_threshold": null, - "source": "catalog", - "list_input_per_million": "5.000000", - "list_output_per_million": "30.000000", - "zero_data_retention": false, - "zero_data_retention_route": null + "input_per_million": "0.040000", + "output_per_million": "0.200000", + "cache_read_input_per_million": "0.008500", + "cache_write_input_per_million": "0.040000" + } + }, + { + "id": "muse-spark-1.2", + "type": "text", + "context_length": 1048576, + "max_output_tokens": 943718, + "pricing": { + "input_per_million": "0.875000", + "output_per_million": "2.975000", + "cache_read_input_per_million": "0.105000", + "cache_write_input_per_million": "0.875000" + } + }, + { + "id": "gpt-5-mini", + "type": "text", + "context_length": 400000, + "max_output_tokens": 128000, + "pricing": { + "input_per_million": "0.201421", + "output_per_million": "1.611374", + "cache_read_input_per_million": "0.020142", + "cache_write_input_per_million": "0.201421" + } + }, + { + "id": "deepseek-v4-pro-0813", + "type": "text", + "context_length": 1048576, + "max_output_tokens": 384000, + "pricing": { + "input_per_million": "0.462000", + "output_per_million": "1.386000", + "cache_read_input_per_million": "0.015410", + "cache_write_input_per_million": "0.462000" + } + }, + { + "id": "gemini-3.7-flash", + "type": "text", + "context_length": 1048576, + "max_output_tokens": 65536, + "pricing": { + "input_per_million": "0.525000", + "output_per_million": "2.625000", + "cache_read_input_per_million": "0.052500", + "cache_write_input_per_million": "0.029190" } } ], - "pricing_version": "sha256:1099de72e567e1c8877a7086234c1f2a1a365b43f8f0e7aca1d92f49bda46026", - "pricing_checked_at": "2026-09-16T08:00:58.592Z", - "pricing_updated_at": "2026-08-05T00:00:00.000Z" + "pricing_version": "sha256:6d2520b91e2b8513a36cd8bb75129b43e440b81fdfe745430f6733ab7a9c7b46", + "pricing_checked_at": "2026-09-17T10:00:38.588Z" } diff --git a/tests/test_litellm/test_sync_cheaperinference_models.py b/tests/test_litellm/test_sync_cheaperinference_models.py index 093b3639346..7fb9fc16c36 100644 --- a/tests/test_litellm/test_sync_cheaperinference_models.py +++ b/tests/test_litellm/test_sync_cheaperinference_models.py @@ -1,9 +1,18 @@ +"""Tests for scripts/sync_cheaperinference_models.py. + +``fixtures/cheaperinference_sync/models.json`` is a recorded ``GET /v1/models`` +response, trimmed to the fields the sync reads, with the gateway's own +``pricing_version`` and ``pricing_checked_at`` kept for provenance. +""" + import importlib.util import json from pathlib import Path import pytest +from litellm.litellm_core_utils.llm_cost_calc.utils import _parse_above_token_threshold + ROOT = Path(__file__).resolve().parents[2] SCRIPT = ROOT / "scripts" / "sync_cheaperinference_models.py" FIXTURES = Path(__file__).resolve().parent / "fixtures" / "cheaperinference_sync" @@ -88,39 +97,44 @@ def test_a_new_catalog_model_is_flagged_but_never_auto_added() -> None: assert "cheaperinference/seedance-2.0" not in outcome.cost_map -def test_a_model_losing_its_pricing_tier_drops_the_above_272k_fields() -> None: +def test_a_model_losing_its_pricing_tier_drops_its_above_threshold_fields() -> None: with_stale_tier = json.loads(json.dumps(REGISTERED_CHEAPERINFERENCE)) with_stale_tier["cheaperinference/kimi-k3"]["input_cost_per_token_above_272k_tokens"] = 5.0 outcome = sync.compute_sync(with_stale_tier, RECORDED_CATALOG) assert "input_cost_per_token_above_272k_tokens" not in outcome.cost_map["cheaperinference/kimi-k3"] -def test_null_context_length_and_max_output_tokens_do_not_overwrite_curated_limits() -> None: - """gpt-oss-120b reports null limits in the live catalog, so the curated ones must survive.""" +def test_a_null_limit_in_the_catalog_never_overwrites_the_registry() -> None: + """gpt-oss-120b reports a null max_output_tokens, so no output limit may appear.""" registered = json.loads(json.dumps(REGISTERED_CHEAPERINFERENCE)) - assert "cheaperinference/gpt-oss-120b" in registered - curated_max_input = registered["cheaperinference/gpt-oss-120b"].get("max_input_tokens") + assert "max_output_tokens" not in registered["cheaperinference/gpt-oss-120b"] + outcome = sync.compute_sync(registered, RECORDED_CATALOG) - assert outcome.cost_map["cheaperinference/gpt-oss-120b"].get("max_input_tokens") == curated_max_input + + assert "max_output_tokens" not in outcome.cost_map["cheaperinference/gpt-oss-120b"] + assert "max_tokens" not in outcome.cost_map["cheaperinference/gpt-oss-120b"] @pytest.mark.parametrize( "threshold,band", [ (272_000, "above_272k_tokens"), - (271_999, "above_272k_tokens"), (200_000, "above_200k_tokens"), (128_000, "above_128k_tokens"), (512_000, "above_512k_tokens"), + (271_999, "above_271999_tokens"), + (300_000, "above_300000_tokens"), ], ) -def test_catalog_thresholds_map_to_the_matching_cost_map_band(threshold: int, band: str) -> None: +def test_a_catalog_threshold_names_its_own_band(threshold: int, band: str) -> None: assert sync.band_for_threshold(threshold) == band -@pytest.mark.parametrize("threshold", [0, 100_000, 300_000, 999_999]) -def test_a_threshold_outside_every_band_maps_to_nothing(threshold: int) -> None: - assert sync.band_for_threshold(threshold) is None +@pytest.mark.parametrize("threshold", [100_000, 128_000, 200_000, 271_999, 272_000, 300_000, 512_000, 999_999]) +def test_litellm_reads_back_the_exact_threshold_from_the_generated_field(threshold: int) -> None: + field = f"input_cost_per_token_{sync.band_for_threshold(threshold)}" + + assert _parse_above_token_threshold(field) == threshold def _catalog_with_threshold(model_id: str, threshold: int) -> list: @@ -134,16 +148,14 @@ def _catalog_with_threshold(model_id: str, threshold: int) -> list: return sync.load_catalog(json.dumps(entries).encode()) -def test_a_threshold_with_no_band_leaves_the_entry_untouched_and_is_flagged() -> None: +def test_a_threshold_outside_the_k_form_bands_is_written_at_its_exact_value() -> None: catalog = _catalog_with_threshold("gpt-5.6-luna", 300_000) - perturbed = json.loads(json.dumps(REGISTERED_CHEAPERINFERENCE)) - perturbed["cheaperinference/gpt-5.6-luna"]["input_cost_per_token"] = 999.0 - outcome = sync.compute_sync(perturbed, catalog) + outcome = sync.compute_sync(REGISTERED_CHEAPERINFERENCE, catalog) - assert outcome.unmappable_thresholds == ("cheaperinference/gpt-5.6-luna (threshold 300000)",) - assert outcome.updated == () - assert outcome.cost_map["cheaperinference/gpt-5.6-luna"]["input_cost_per_token"] == 999.0 + entry = outcome.cost_map["cheaperinference/gpt-5.6-luna"] + assert entry["input_cost_per_token_above_300000_tokens"] == pytest.approx(0.16e-06) + assert "input_cost_per_token_above_271999_tokens" not in entry def test_a_moved_threshold_rewrites_the_band_and_drops_the_old_one() -> None: @@ -153,8 +165,7 @@ def test_a_moved_threshold_rewrites_the_band_and_drops_the_old_one() -> None: entry = outcome.cost_map["cheaperinference/gpt-5.6-luna"] assert entry["input_cost_per_token_above_200k_tokens"] == pytest.approx(0.16e-06) - assert "input_cost_per_token_above_272k_tokens" not in entry - assert outcome.unmappable_thresholds == () + assert "input_cost_per_token_above_271999_tokens" not in entry def test_warnings_name_every_kind_of_catalog_drift() -> None: @@ -162,13 +173,11 @@ def test_warnings_name_every_kind_of_catalog_drift() -> None: cost_map={}, unpriced_new_models=("cheaperinference/brand-new",), missing_from_catalog=("cheaperinference/retired",), - unmappable_thresholds=("cheaperinference/odd (threshold 300000)",), ) assert outcome.warnings == ( "new in the catalog, not registered: cheaperinference/brand-new", "registered but gone from the catalog: cheaperinference/retired", - "long-context threshold matches no cost-map band, entry left untouched: cheaperinference/odd (threshold 300000)", )