From 68bf16fdf7942a1f45e9664598774c824ef101a1 Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Tue, 10 Nov 2026 15:29:44 -0600 Subject: [PATCH] Price refresh 2026-11-10: DeepSeek's own prices, f-router's local classifier, OpenRouter sync - DeepSeek sells its models directly but not on OpenRouter, so its own published prices are set by hand (sync: false): V4 Pro 1.32/3.96 and V4.1 Flash 0.30/1.20 (standard, peak-hour rates); V3.2 keeps 0.28/0.42, its last DeepSeek price, since DeepSeek no longer sells it. - f-router's routing classifier (Qwen3-4B-Instruct-2507, 4-bit, run locally) is priced by the local-model rule (#266): not listed on OpenRouter, so the size curve at 4B x0.8 = 0.084/0.267. - scripts/pricing/sync_openrouter.py with OpenRouter's data of 2026-11-10: 5 small changes (gemma-4-31b-it, qwen3-235b-a22b-2507 output, gpt-oss-120b, deepseek-v4-flash-0731, llama-3.3-70b); snapshot written. Co-Authored-By: Claude Opus 5.5 --- model_cost/model_cost.json | 44 +-- model_cost/model_profiles.yaml | 53 +-- model_cost/price_snapshots/2026-11-10.json | 439 +++++++++++++++++++++ 3 files changed, 491 insertions(+), 45 deletions(-) create mode 100644 model_cost/price_snapshots/2026-11-10.json diff --git a/model_cost/model_cost.json b/model_cost/model_cost.json index 04f30101..414d4997 100644 --- a/model_cost/model_cost.json +++ b/model_cost/model_cost.json @@ -116,28 +116,28 @@ "output_token_price_per_million": 0.42 }, "deepseek/deepseek-v3.2": { - "input_token_price_per_million": 0.295, - "output_token_price_per_million": 0.88 + "input_token_price_per_million": 0.28, + "output_token_price_per_million": 0.42 }, "deepseek-v3.2": { - "input_token_price_per_million": 0.295, - "output_token_price_per_million": 0.88 + "input_token_price_per_million": 0.28, + "output_token_price_per_million": 0.42 }, "deepseek/deepseek-v4-flash": { "input_token_price_per_million": 0.14, "output_token_price_per_million": 0.28 }, "deepseek/deepseek-v4-flash-0731": { - "input_token_price_per_million": 0.176, + "input_token_price_per_million": 0.15, "output_token_price_per_million": 0.528 }, "deepseek-ai/DeepSeek-V4-Flash-0731": { - "input_token_price_per_million": 0.176, + "input_token_price_per_million": 0.15, "output_token_price_per_million": 0.528 }, "deepseek/deepseek-v4-pro": { - "input_token_price_per_million": 1.6, - "output_token_price_per_million": 3.2 + "input_token_price_per_million": 1.32, + "output_token_price_per_million": 3.96 }, "deepseek/deepseek-v4.1-flash": { "input_token_price_per_million": 0.3, @@ -240,7 +240,7 @@ "output_token_price_per_million": 0.04 }, "google/gemma-4-31b-it": { - "input_token_price_per_million": 0.15, + "input_token_price_per_million": 0.175, "output_token_price_per_million": 0.4 }, "gpt-5-chat": { @@ -268,12 +268,12 @@ "output_token_price_per_million": 1 }, "meta-llama/llama-3.3-70b-instruct": { - "input_token_price_per_million": 0.4415, - "output_token_price_per_million": 0.715 + "input_token_price_per_million": 0.59, + "output_token_price_per_million": 0.72 }, "meta-llama_llama-3.3-70b-instruct": { - "input_token_price_per_million": 0.4415, - "output_token_price_per_million": 0.715 + "input_token_price_per_million": 0.59, + "output_token_price_per_million": 0.72 }, "meta-llama_llama-3.1-405b-instruct": { "input_token_price_per_million": 3.5, @@ -516,15 +516,15 @@ "output_token_price_per_million": 10 }, "openai/gpt-oss-120b": { - "input_token_price_per_million": 0.15, + "input_token_price_per_million": 0.145, "output_token_price_per_million": 0.6 }, "gpt-oss-120b": { - "input_token_price_per_million": 0.15, + "input_token_price_per_million": 0.145, "output_token_price_per_million": 0.6 }, "openai_gpt-oss-120b": { - "input_token_price_per_million": 0.15, + "input_token_price_per_million": 0.145, "output_token_price_per_million": 0.6 }, "openai/gpt-oss-20b": { @@ -537,19 +537,19 @@ }, "qwen/qwen3-235b-a22b-2507": { "input_token_price_per_million": 0.145, - "output_token_price_per_million": 0.775 + "output_token_price_per_million": 0.675 }, "alibaba/qwen3-235b-a22b-instruct-2507": { "input_token_price_per_million": 0.145, - "output_token_price_per_million": 0.775 + "output_token_price_per_million": 0.675 }, "qwen3-235b-a22b-instruct-2507": { "input_token_price_per_million": 0.145, - "output_token_price_per_million": 0.775 + "output_token_price_per_million": 0.675 }, "qwen_qwen3-235b-a22b-2507": { "input_token_price_per_million": 0.145, - "output_token_price_per_million": 0.775 + "output_token_price_per_million": 0.675 }, "qwen/qwen3-30b-a3b-instruct-2507": { "input_token_price_per_million": 0.09, @@ -596,8 +596,8 @@ "output_token_price_per_million": 1.9 }, "qwen/qwen3-4b-instruct-2507": { - "input_token_price_per_million": 0.17, - "output_token_price_per_million": 0.25 + "input_token_price_per_million": 0.084, + "output_token_price_per_million": 0.267 }, "qwen/qwen3.5-9b": { "input_token_price_per_million": 0.1, diff --git a/model_cost/model_profiles.yaml b/model_cost/model_profiles.yaml index 8337e48f..184a86de 100644 --- a/model_cost/model_profiles.yaml +++ b/model_cost/model_profiles.yaml @@ -113,28 +113,34 @@ models: note: "DeepSeek's API name; the model behind it changed over time, so it is not synced." sync: false "deepseek/deepseek-v3.2": - price: {input: 0.295, output: 0.88} + price: {input: 0.28, output: 0.42} aliases: ["deepseek-v3.2"] - as_of: "2026-10-31" - source: "https://openrouter.ai/deepseek/deepseek-v3.2" + as_of: "2026-11-10" + source: "https://api-docs.deepseek.com/quick_start/pricing" + note: "DeepSeek's last price for V3.2 (input, cache miss / output). DeepSeek no longer sells V3.2 itself (its API names now serve V4.1), so the price is kept fixed." + sync: false "deepseek/deepseek-v4-flash": price: {input: 0.14, output: 0.28} as_of: "2026-10-31" source: "https://openrouter.ai/deepseek/deepseek-v4-flash" "deepseek/deepseek-v4-flash-0731": - price: {input: 0.176, output: 0.528} + price: {input: 0.15, output: 0.528} aliases: ["deepseek-ai/DeepSeek-V4-Flash-0731"] - as_of: "2026-10-31" + as_of: "2026-11-10" source: "https://openrouter.ai/deepseek/deepseek-v4-flash-0731" "deepseek/deepseek-v4-pro": - price: {input: 1.6, output: 3.2} - as_of: "2026-10-31" - source: "https://openrouter.ai/deepseek/deepseek-v4-pro" + price: {input: 1.32, output: 3.96} + as_of: "2026-11-10" + source: "https://api-docs.deepseek.com/quick_start/pricing" + note: "DeepSeek's own price (standard, peak-hour rate; off-peak hours are half price). DeepSeek sells the model directly but not on OpenRouter, so the price is set by hand." + sync: false "deepseek/deepseek-v4.1-flash": price: {input: 0.3, output: 1.2} aliases: ["deepseek/deepseek-v4.1-flash@high", "deepseek/deepseek-v4.1-flash@low"] - as_of: "2026-10-31" - source: "https://openrouter.ai/deepseek/deepseek-v4.1-flash" + as_of: "2026-11-10" + source: "https://api-docs.deepseek.com/quick_start/pricing" + note: "DeepSeek's own price for deepseek-flash (DeepSeek-V4.1-Flash; standard, peak-hour rate). DeepSeek sells the model directly but not on OpenRouter, so the price is set by hand." + sync: false "gemini-2.0-flash-001": price: {input: 0.1, output: 0.4} as_of: "2026-09-27" @@ -205,8 +211,8 @@ models: as_of: "2026-09-27" source: null "google/gemma-4-31b-it": - price: {input: 0.15, output: 0.4} - as_of: "2026-10-31" + price: {input: 0.175, output: 0.4} + as_of: "2026-11-10" source: "https://openrouter.ai/google/gemma-4-31b-it" "gpt-5-chat": price: {input: 1.25, output: 10} @@ -231,9 +237,9 @@ models: as_of: "2026-09-27" source: null "meta-llama/llama-3.3-70b-instruct": - price: {input: 0.4415, output: 0.715} + price: {input: 0.59, output: 0.72} aliases: ["meta-llama_llama-3.3-70b-instruct"] - as_of: "2026-10-31" + as_of: "2026-11-10" source: "https://openrouter.ai/meta-llama/llama-3.3-70b-instruct" "meta-llama_llama-3.1-405b-instruct": price: {input: 3.5, output: 3.5} @@ -395,19 +401,19 @@ models: as_of: null source: null "openai/gpt-oss-120b": - price: {input: 0.15, output: 0.6} + price: {input: 0.145, output: 0.6} aliases: ["gpt-oss-120b", "openai_gpt-oss-120b"] - as_of: "2026-09-27" - source: null + as_of: "2026-11-10" + source: "https://openrouter.ai/openai/gpt-oss-120b" "openai/gpt-oss-20b": price: {input: 0.04, output: 0.15} aliases: ["gpt-oss-20b"] as_of: "2026-10-31" source: "https://openrouter.ai/openai/gpt-oss-20b" "qwen/qwen3-235b-a22b-2507": - price: {input: 0.145, output: 0.775} + price: {input: 0.145, output: 0.675} aliases: ["alibaba/qwen3-235b-a22b-instruct-2507", "qwen3-235b-a22b-instruct-2507", "qwen_qwen3-235b-a22b-2507"] - as_of: "2026-10-31" + as_of: "2026-11-10" source: "https://openrouter.ai/qwen/qwen3-235b-a22b-2507" note: "Unified spellings; previous prices: qwen3-235b-a22b-instruct-2507 0.5/2. alibaba/qwen3-235b-a22b-instruct-2507: same model, Alibaba's spelling." "qwen/qwen3-30b-a3b-instruct-2507": @@ -440,10 +446,11 @@ models: as_of: "2026-10-31" source: "https://openrouter.ai/qwen/qwen3-vl-235b-a22b-instruct" "qwen/qwen3-4b-instruct-2507": - price: {input: 0.17, output: 0.25} - as_of: "2026-11-03" - source: "https://openrouter.ai/qwen/qwen3.5-9b" - note: "f-router's routing classifier, run locally (4-bit MLX). No published API price; priced conservatively at the nearest larger listed Qwen (qwen/qwen3.5-9b)." + price: {input: 0.084, output: 0.267} + local: {active_params_b: 4, bits: 4} + as_of: "2026-11-10" + source: "local-model rule (model_cost/local_pricing.yaml)" + note: "f-router's routing classifier, run locally (4-bit MLX). Not listed on OpenRouter, so priced from the size curve (#266)." sync: false "qwen/qwen3.5-9b": price: {input: 0.1, output: 0.15} diff --git a/model_cost/price_snapshots/2026-11-10.json b/model_cost/price_snapshots/2026-11-10.json new file mode 100644 index 00000000..ae1efb2c --- /dev/null +++ b/model_cost/price_snapshots/2026-11-10.json @@ -0,0 +1,439 @@ +{ + "date": "2026-11-10", + "source": "https://openrouter.ai/api/v1/models//endpoints", + "rule": "standard price: the lab's own standard-tier price, else the median over hosts (no 4-bit); promotional discounts undone", + "prices": { + "anthropic/claude-haiku-4.5": { + "input": 1.0, + "output": 5.0, + "basis": "Anthropic (the lab's own price)", + "discount_removed": 0.0 + }, + "anthropic/claude-haiku-5.5": { + "input": 0.1, + "output": 0.5, + "basis": "Anthropic (the lab's own price)", + "discount_removed": 0.0 + }, + "anthropic/claude-opus-4.1": { + "input": 15.0, + "output": 75.0, + "basis": "median of 1 host(s)", + "discount_removed": 0.0 + }, + "anthropic/claude-opus-4.6": { + "input": 5.0, + "output": 25.0, + "basis": "Anthropic (the lab's own price)", + "discount_removed": 0.0 + }, + "anthropic/claude-opus-4.7": { + "input": 5.0, + "output": 25.0, + "basis": "Anthropic (the lab's own price)", + "discount_removed": 0.0 + }, + "anthropic/claude-opus-5.5": { + "input": 4.0, + "output": 20.0, + "basis": "Anthropic (the lab's own price)", + "discount_removed": 0.0 + }, + "anthropic/claude-sonnet-4.5": { + "input": 3.0, + "output": 15.0, + "basis": "Anthropic (the lab's own price)", + "discount_removed": 0.0 + }, + "anthropic/claude-sonnet-5.5": { + "input": 2.0, + "output": 10.0, + "basis": "Anthropic (the lab's own price)", + "discount_removed": 0.0 + }, + "deepseek/deepseek-chat": { + "input": 0.286, + "output": 1.143, + "basis": "median of 1 host(s)", + "discount_removed": 0.1 + }, + "deepseek/deepseek-v4-flash": { + "input": 0.14, + "output": 0.28, + "basis": "median of 10 host(s)", + "discount_removed": 0.727 + }, + "deepseek/deepseek-v4-flash-0731": { + "input": 0.15, + "output": 0.528, + "basis": "median of 19 host(s)", + "discount_removed": 0.864 + }, + "google/gemini-2.5-flash": { + "input": 0.3, + "output": 2.5, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.0 + }, + "google/gemini-2.5-flash-lite": { + "input": 0.1, + "output": 0.4, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.0 + }, + "google/gemini-2.5-pro": { + "input": 1.25, + "output": 10.0, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.0 + }, + "google/gemini-3-flash-preview": { + "input": 0.5, + "output": 3.0, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.0 + }, + "google/gemini-3.1-flash-lite": { + "input": 0.25, + "output": 1.5, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.0 + }, + "google/gemini-3.1-flash-lite-preview": { + "input": 0.25, + "output": 1.5, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.0 + }, + "google/gemini-3.1-pro-preview": { + "input": 2.0, + "output": 12.0, + "basis": "Google (the lab's own price)", + "discount_removed": 0.0 + }, + "google/gemini-3.5-flash-lite": { + "input": 0.3, + "output": 2.5, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.0 + }, + "google/gemini-3.7-flash": { + "input": 1.5, + "output": 7.5, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.5 + }, + "google/gemini-3.8-flash": { + "input": 1.5, + "output": 7.5, + "basis": "Google AI Studio (the lab's own price)", + "discount_removed": 0.5 + }, + "google/gemma-4-31b-it": { + "input": 0.175, + "output": 0.4, + "basis": "median of 8 host(s)", + "discount_removed": 0.05 + }, + "inclusionai/ling-3.0-flash": { + "input": 0.06, + "output": 0.18, + "basis": "median of 2 host(s)", + "discount_removed": 0.65 + }, + "meta-llama/llama-3.3-70b-instruct": { + "input": 0.59, + "output": 0.72, + "basis": "median of 9 host(s)", + "discount_removed": 0.0 + }, + "minimax/minimax-m3": { + "input": 0.3, + "output": 1.2, + "basis": "Minimax (the lab's own price)", + "discount_removed": 0.0 + }, + "mistralai/ministral-3b-2512": { + "input": 0.1, + "output": 0.1, + "basis": "Mistral (the lab's own price)", + "discount_removed": 0.0 + }, + "mistralai/ministral-8b-2512": { + "input": 0.15, + "output": 0.15, + "basis": "Mistral (the lab's own price)", + "discount_removed": 0.0 + }, + "moonshotai/kimi-k2.5": { + "input": 0.6, + "output": 3.0, + "basis": "median of 3 host(s)", + "discount_removed": 0.05 + }, + "moonshotai/kimi-k2.6": { + "input": 0.95, + "output": 4.0, + "basis": "Moonshot AI (the lab's own price)", + "discount_removed": 0.0 + }, + "moonshotai/kimi-k3": { + "input": 3.0, + "output": 15.0, + "basis": "Moonshot AI (the lab's own price)", + "discount_removed": 0.0 + }, + "nvidia/nemotron-3-nano-30b-a3b": { + "input": 0.06, + "output": 0.24, + "basis": "median of 1 host(s)", + "discount_removed": 0.0 + }, + "openai/gpt-4.1": { + "input": 2.0, + "output": 8.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-4.1-mini": { + "input": 0.4, + "output": 1.6, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-4.1-nano": { + "input": 0.105, + "output": 0.42, + "basis": "median of 2 host(s)", + "discount_removed": 0.0 + }, + "openai/gpt-4o": { + "input": 2.5, + "output": 10.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-4o-mini": { + "input": 0.15, + "output": 0.6, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5": { + "input": 1.25, + "output": 10.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5-mini": { + "input": 0.25, + "output": 2.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5-nano": { + "input": 0.05, + "output": 0.4, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.1": { + "input": 1.25, + "output": 10.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.2": { + "input": 1.75, + "output": 14.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.2-chat": { + "input": 1.75, + "output": 14.0, + "basis": "median of 1 host(s)", + "discount_removed": 0.0 + }, + "openai/gpt-5.4": { + "input": 2.5, + "output": 15.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.4-mini": { + "input": 0.75, + "output": 4.5, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.4-nano": { + "input": 0.2, + "output": 1.25, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.5": { + "input": 5.0, + "output": 30.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.6-luna": { + "input": 0.2, + "output": 1.2, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.6-sol": { + "input": 4.0, + "output": 20.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-5.6-terra": { + "input": 2.0, + "output": 12.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-6-luna": { + "input": 0.1, + "output": 0.5, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-6-sol": { + "input": 2.0, + "output": 10.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-6.1-sol": { + "input": 2.0, + "output": 10.0, + "basis": "OpenAI (the lab's own price)", + "discount_removed": 0.0 + }, + "openai/gpt-oss-120b": { + "input": 0.145, + "output": 0.6, + "basis": "median of 12 host(s)", + "discount_removed": 0.0 + }, + "openai/gpt-oss-20b": { + "input": 0.04, + "output": 0.15, + "basis": "median of 7 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3-235b-a22b-2507": { + "input": 0.145, + "output": 0.675, + "basis": "median of 4 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3-30b-a3b-instruct-2507": { + "input": 0.09, + "output": 0.3, + "basis": "median of 3 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3-coder": { + "input": 0.35, + "output": 1.5, + "basis": "median of 1 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3-coder-30b-a3b-instruct": { + "input": 0.11, + "output": 0.44, + "basis": "median of 2 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3-coder-next": { + "input": 0.12, + "output": 0.8, + "basis": "median of 1 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3-next-80b-a3b-instruct": { + "input": 0.095, + "output": 1.1, + "basis": "median of 2 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3-vl-235b-a22b-instruct": { + "input": 0.21, + "output": 1.9, + "basis": "median of 3 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3.5-9b": { + "input": 0.1, + "output": 0.15, + "basis": "median of 5 host(s)", + "discount_removed": 0.0 + }, + "qwen/qwen3.5-flash-02-23": { + "input": 0.065, + "output": 0.26, + "basis": "Alibaba (the lab's own price)", + "discount_removed": 0.0 + }, + "upstage/solar-pro4": { + "input": 0.3, + "output": 1.2, + "basis": "Upstage (the lab's own price)", + "discount_removed": 0.5 + }, + "x-ai/grok-4.3": { + "input": 1.25, + "output": 2.5, + "basis": "xAI (the lab's own price)", + "discount_removed": 0.0 + }, + "xiaomi/mimo-v2.5": { + "input": 0.4, + "output": 2.0, + "basis": "median of 1 host(s)", + "discount_removed": 0.0 + }, + "z-ai/glm-4.5-air": { + "input": 0.2, + "output": 1.1, + "basis": "Z.AI (the lab's own price)", + "discount_removed": 0.0 + }, + "z-ai/glm-4.6": { + "input": 0.6, + "output": 2.2, + "basis": "Z.AI (the lab's own price)", + "discount_removed": 0.0 + }, + "z-ai/glm-4.7": { + "input": 0.6, + "output": 2.2, + "basis": "Z.AI (the lab's own price)", + "discount_removed": 0.0 + }, + "z-ai/glm-5": { + "input": 1.0, + "output": 3.2, + "basis": "Z.AI (the lab's own price)", + "discount_removed": 0.0 + }, + "z-ai/glm-5.3": { + "input": 1.4, + "output": 4.4, + "basis": "Z.AI (the lab's own price)", + "discount_removed": 0.0 + }, + "z-ai/glm-5.3-flash": { + "input": 0.15, + "output": 0.5, + "basis": "Z.AI (the lab's own price)", + "discount_removed": 0.0 + } + } +}