AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(llm-registry): correct OpenRouter price drift for 3 models (#14904)
Nicholas Tindle623b63d1dbf0
diff --git a/autogpt_platform/backend/backend/copilot/moonshot_test.py b/autogpt_platform/backend/backend/copilot/moonshot_test.pyindex 3f997ce970..63a84ae3dc 100644--- a/autogpt_platform/backend/backend/copilot/moonshot_test.py+++ b/autogpt_platform/backend/backend/copilot/moonshot_test.py@@ -62,9 +62,9 @@ class TestRateCardUsd:# win over the shared K2.x default. Sourced from the catalog# entry's provider_*_usd_per_1m, which tracks OpenRouter's# published price for moonshotai/kimi-k3 (/api/v1/models,- # re-checked 2026-09-22). It briefly dropped to $1.70/$8.50 after- # SECRT-2701, but OpenRouter's live default route repriced back up- # to $3/$15 — this pin follows the current default-route price.+ # re-checked 2026-09-25). A same-day snapshot had briefly shown+ # $0.8845/$10.5346, but that had already drifted back to the+ # pinned $3.00/$15.00 rate by the time of this check.assert rate_card_usd("moonshotai/kimi-k3") == (3.00, 15.00)def test_future_moonshot_sku_inherits_default(self) -> None:diff --git a/autogpt_platform/backend/backend/data/llm_registry/catalog.py b/autogpt_platform/backend/backend/data/llm_registry/catalog.pyindex 076ce40780..9ee2b4e97c 100644--- a/autogpt_platform/backend/backend/data/llm_registry/catalog.py+++ b/autogpt_platform/backend/backend/data/llm_registry/catalog.py@@ -529,13 +529,15 @@ def _build_catalog() -> CatalogPayload:context_window=1048576,max_output_tokens=384000,price_tier=1,- # Live OpenRouter rate as of 2026-09-24: $0.14/$0.42 per 1M,- # cache read $0.01/1M (drifted again since the prior fix).+ # Live OpenRouter rate as of 2026-09-25: $0.14/$0.42 per 1M,+ # cache read $0.0042/1M. OpenRouter reprices this route+ # continuously (by design); this is the latest snapshot+ # at PR time, re-checked immediately before merge.cost=CatalogModelCost(run_credits=1,input_credits_per_1m=21.0,output_credits_per_1m=63.0,- cache_read_credits_per_1m=1.5,+ cache_read_credits_per_1m=0.63,),),CatalogModel(@@ -795,10 +797,12 @@ def _build_catalog() -> CatalogPayload:creator="mistral-ai",context_window=262144,price_tier=2,+ # Live OpenRouter rate as of 2026-09-25: $0.50/$1.50 per 1M+ # (dropped from $2.00/$6.00; verified via check_openrouter_prices.py).cost=CatalogModelCost(run_credits=2,- input_credits_per_1m=300.0,- output_credits_per_1m=900.0,+ input_credits_per_1m=75.0,+ output_credits_per_1m=225.0,),),CatalogModel(@@ -884,13 +888,19 @@ def _build_catalog() -> CatalogPayload:price_tier=3,supports_tools=True,supports_reasoning=True,- # Moonshot's premium tier — $3.00/$15.00 per Mtok on- # OpenRouter (repriced from $1.70/$8.50; verified live- # 2026-09-22), credit rates at the standard 1.5x margin.+ # Moonshot's premium tier — re-checked live 2026-09-25:+ # the $0.8845/$10.5346 rate this entry was briefly moved to+ # was itself a same-day snapshot that had already drifted;+ # OpenRouter's default route is back to $3.00/$15.00 per+ # Mtok (verified via check_openrouter_prices.py), so this+ # reverts to the pinned $3/$15 rate. Cache read is now+ # live at $0.30/1M (previously unset) so that's authored+ # here for the first time.cost=CatalogModelCost(run_credits=9,input_credits_per_1m=450.0,output_credits_per_1m=2250.0,+ cache_read_credits_per_1m=45.0,provider_input_usd_per_1m=3.00,provider_output_usd_per_1m=15.00,),diff --git a/autogpt_platform/backend/backend/data/llm_registry/catalog_test.py b/autogpt_platform/backend/backend/data/llm_registry/catalog_test.pyindex dc96a34902..41db09d008 100644--- a/autogpt_platform/backend/backend/data/llm_registry/catalog_test.py+++ b/autogpt_platform/backend/backend/data/llm_registry/catalog_test.py@@ -142,14 +142,15 @@ def test_kimi_k3_bills_at_authored_rates():"""The flagship catalog-native model's billing projections — flat tierand per-1M token rates — must match its authored catalog entry.- Pin updated for a live OpenRouter reprice ($1.70/$8.50 -> $3.00/$15.00- per Mtok, verified 2026-09-22)."""+ Re-checked live against OpenRouter on 2026-09-25: still $3.00/$15.00+ per Mtok, no drift. Cache read is newly authored at $0.30/1M (was+ previously unpublished/unset)."""k3 = LLMModel("moonshotai/kimi-k3")assert MODEL_COST[k3] == 9assert TOKEN_COST[k3].model_dump() == {"input": 450.0,"output": 2250.0,- "cache_read": 0.0,+ "cache_read": 45.0,"cache_creation": 0.0,}@@ -395,14 +396,15 @@ def test_qwen3_8_flash_bills_at_authored_rates():def test_deepseek_v4_1_flash_bills_at_authored_rates():"""DeepSeek V4.1 Flash (OpenRouter live rate $0.14/$0.42 per 1M,- $0.01/1M cached input as of 2026-09-24) — flat tier and per-1M- projections must match the authored catalog entry."""+ $0.0042/1M cached input as of 2026-09-25 — this route reprices+ continuously by design) — flat tier and per-1M projections must+ match the authored catalog entry."""flash = LLMModel("deepseek/deepseek-v4.1-flash")assert MODEL_COST[flash] == 1assert TOKEN_COST[flash].model_dump() == {"input": 21.0,"output": 63.0,- "cache_read": 1.5,+ "cache_read": 0.63,"cache_creation": 0.0,}assert MODEL_METADATA[flash].max_output_tokens == 384000