From d52ee8f8596b07fe53d7c428c2e4a601caeed8c0 Mon Sep 17 00:00:00 2001 From: stimQQ Date: Mon, 19 Oct 2026 18:41:09 +0900 Subject: [PATCH] feat(apimodels): add apimodels.app chat model prices to the cost map Adds 36 apimodels/ chat rows to model_prices_and_context_window.json and the backup copy, so spend tracking prices apimodels calls instead of logging them at zero Rates are the per token prices apimodels.app bills, as listed on https://apimodels.app/pricing and on each model page linked in the row's source field. Context limits and the function calling, vision, reasoning and prompt caching flags are copied from the model vendor's own row The rows carry the same long prompt and off-peak rules the gateway bills with. The gpt-6 and gpt-5.6 rows rebill the whole request at 2x input and cache read and 1.5x output above 272k prompt tokens, claude-haiku-5-5 bills every rate at 5x above 100k, qwen3.7-plus bills 3x above 262,144 tokens through tiered_pricing, and the two DeepSeek Flash rows bill half rate outside 01:00-04:00 and 06:00-10:00 UTC on weekdays Two cost tests check that an apimodels row bills cached tokens at its cache read rate and that a prompt over 272k tokens moves the whole request to the long context rates --- ...odel_prices_and_context_window_backup.json | 640 ++++++++++++++++++ model_prices_and_context_window.json | 640 ++++++++++++++++++ .../openai_like/test_apimodels_provider.py | 49 ++ 3 files changed, 1329 insertions(+) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index d570e49bf6c..6b58e6e1640 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -71337,6 +71337,646 @@ "supports_reasoning": true, "supports_vision": true }, + "apimodels/claude-fable-5-1": { + "cache_creation_input_token_cost": 5.778e-06, + "cache_read_input_token_cost": 2.2e-07, + "input_cost_per_token": 5e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "source": "https://apimodels.app/models/claude-fable-5-1", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-fable-5": { + "cache_creation_input_token_cost": 8.824e-06, + "cache_read_input_token_cost": 8.82e-07, + "input_cost_per_token": 5e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "source": "https://apimodels.app/models/claude-fable-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-5-5": { + "cache_creation_input_token_cost": 3e-06, + "cache_read_input_token_cost": 1.2e-07, + "input_cost_per_token": 2.4e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.2e-05, + "source": "https://apimodels.app/models/claude-opus-5-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-5": { + "cache_creation_input_token_cost": 4.891e-06, + "cache_read_input_token_cost": 3.91e-07, + "input_cost_per_token": 3e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.5e-05, + "source": "https://apimodels.app/models/claude-opus-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-4-8": { + "cache_creation_input_token_cost": 1.765e-06, + "cache_read_input_token_cost": 3e-07, + "input_cost_per_token": 3e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.3e-05, + "source": "https://apimodels.app/models/claude-opus-4-8", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-4-7": { + "cache_creation_input_token_cost": 4.595e-06, + "cache_read_input_token_cost": 3.676e-07, + "input_cost_per_token": 3.676e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.8382e-05, + "source": "https://apimodels.app/models/claude-opus-4-7", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-4-6": { + "cache_creation_input_token_cost": 2.206e-06, + "cache_read_input_token_cost": 1.765e-07, + "input_cost_per_token": 1.765e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 8.824e-06, + "source": "https://apimodels.app/models/claude-opus-4-6", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-4-5-20251101": { + "cache_creation_input_token_cost": 2.206e-06, + "cache_read_input_token_cost": 1.765e-07, + "input_cost_per_token": 1.765e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 200000, + "max_output_tokens": 64000, + "max_tokens": 64000, + "mode": "chat", + "output_cost_per_token": 8.824e-06, + "source": "https://apimodels.app/models/claude-opus-4-5-20251101", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-sonnet-5-5": { + "cache_creation_input_token_cost": 1.5e-06, + "cache_read_input_token_cost": 1.2e-07, + "input_cost_per_token": 1.2e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 6e-06, + "source": "https://apimodels.app/models/claude-sonnet-5-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-sonnet-5": { + "cache_creation_input_token_cost": 1.4e-06, + "cache_read_input_token_cost": 1e-07, + "input_cost_per_token": 1.6e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 8e-06, + "source": "https://apimodels.app/models/claude-sonnet-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-sonnet-4-6": { + "cache_creation_input_token_cost": 1.324e-06, + "cache_read_input_token_cost": 1.059e-07, + "input_cost_per_token": 1.059e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 5.295e-06, + "source": "https://apimodels.app/models/claude-sonnet-4-6", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-haiku-5-5": { + "cache_creation_input_token_cost": 1.125e-07, + "cache_creation_input_token_cost_above_100k_tokens": 5.625e-07, + "cache_read_input_token_cost": 9e-09, + "cache_read_input_token_cost_above_100k_tokens": 4.5e-08, + "input_cost_per_token": 9e-08, + "input_cost_per_token_above_100k_tokens": 4.5e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.5e-07, + "output_cost_per_token_above_100k_tokens": 2.25e-06, + "source": "https://apimodels.app/models/claude-haiku-5-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-haiku-4-5-20251001": { + "cache_creation_input_token_cost": 4.41e-07, + "cache_read_input_token_cost": 3.53e-08, + "input_cost_per_token": 3.53e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 200000, + "max_output_tokens": 64000, + "max_tokens": 64000, + "mode": "chat", + "output_cost_per_token": 1.765e-06, + "source": "https://apimodels.app/models/claude-haiku-4-5-20251001", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gemini-3.8-flash": { + "cache_read_input_token_cost": 1.72e-07, + "input_cost_per_token": 4.5e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 2.25e-06, + "source": "https://apimodels.app/models/gemini-3.8-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gemini-3.6-flash": { + "cache_read_input_token_cost": 6.62e-08, + "input_cost_per_token": 6.62e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 3.302e-06, + "source": "https://apimodels.app/models/gemini-3.6-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gemini-3.5-flash": { + "cache_read_input_token_cost": 6.62e-08, + "input_cost_per_token": 6.62e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 3.971e-06, + "source": "https://apimodels.app/models/gemini-3.5-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gemini-3.1-flash-lite": { + "cache_read_input_token_cost": 2.5e-08, + "input_cost_per_token": 3.75e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 2.25e-06, + "source": "https://apimodels.app/models/gemini-3.1-flash-lite", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-6-astra": { + "cache_read_input_token_cost": 2.4e-07, + "cache_read_input_token_cost_above_272k_tokens": 4.8e-07, + "input_cost_per_token": 2.4e-06, + "input_cost_per_token_above_272k_tokens": 4.8e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.2e-05, + "output_cost_per_token_above_272k_tokens": 1.8e-05, + "source": "https://apimodels.app/models/gpt-6-astra", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-6.1-sol": { + "cache_read_input_token_cost": 5e-08, + "cache_read_input_token_cost_above_272k_tokens": 1e-07, + "input_cost_per_token": 1e-06, + "input_cost_per_token_above_272k_tokens": 2e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "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, + "source": "https://apimodels.app/models/gpt-6.1-sol", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-6-sol": { + "cache_read_input_token_cost": 1e-07, + "cache_read_input_token_cost_above_272k_tokens": 2e-07, + "input_cost_per_token": 1e-06, + "input_cost_per_token_above_272k_tokens": 2e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "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, + "source": "https://apimodels.app/models/gpt-6-sol", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-6-luna": { + "cache_read_input_token_cost": 9e-09, + "cache_read_input_token_cost_above_272k_tokens": 1.8e-08, + "input_cost_per_token": 9e-08, + "input_cost_per_token_above_272k_tokens": 1.8e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.5e-07, + "output_cost_per_token_above_272k_tokens": 6.75e-07, + "source": "https://apimodels.app/models/gpt-6-luna", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5.6-sol": { + "cache_read_input_token_cost": 1.32e-07, + "cache_read_input_token_cost_above_272k_tokens": 2.64e-07, + "input_cost_per_token": 1.324e-06, + "input_cost_per_token_above_272k_tokens": 2.648e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 6.618e-06, + "output_cost_per_token_above_272k_tokens": 9.927e-06, + "source": "https://apimodels.app/models/gpt-5-6-sol", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5.6-terra": { + "cache_read_input_token_cost": 5.5e-08, + "cache_read_input_token_cost_above_272k_tokens": 1.1e-07, + "input_cost_per_token": 5.51e-07, + "input_cost_per_token_above_272k_tokens": 1.102e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 3.309e-06, + "output_cost_per_token_above_272k_tokens": 4.9635e-06, + "source": "https://apimodels.app/models/gpt-5-6-terra", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5.6-luna": { + "cache_read_input_token_cost": 1.8e-08, + "cache_read_input_token_cost_above_272k_tokens": 3.6e-08, + "input_cost_per_token": 1.8e-07, + "input_cost_per_token_above_272k_tokens": 3.6e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 9.6e-07, + "output_cost_per_token_above_272k_tokens": 1.44e-06, + "source": "https://apimodels.app/models/gpt-5-6-luna", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5-5": { + "cache_read_input_token_cost": 5e-07, + "input_cost_per_token": 3e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.8e-05, + "source": "https://apimodels.app/models/gpt-5-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5-4": { + "cache_read_input_token_cost": 2.5e-07, + "input_cost_per_token": 1.8e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.08e-05, + "source": "https://apimodels.app/models/gpt-5-4", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/grok-4.6": { + "cache_read_input_token_cost": 3.75e-07, + "input_cost_per_token": 1.5e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 500000, + "max_output_tokens": 500000, + "max_tokens": 500000, + "mode": "chat", + "output_cost_per_token": 4.5e-06, + "source": "https://apimodels.app/models/grok-4.6", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/grok-4.5": { + "cache_read_input_token_cost": 3e-07, + "input_cost_per_token": 1.275e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 500000, + "max_output_tokens": 500000, + "max_tokens": 500000, + "mode": "chat", + "output_cost_per_token": 4.25e-06, + "source": "https://apimodels.app/models/grok-4.5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/glm-5.3": { + "cache_read_input_token_cost": 2.47e-07, + "input_cost_per_token": 1.33e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.18e-06, + "source": "https://apimodels.app/models/glm-5.3", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/glm-5.2": { + "cache_read_input_token_cost": 2.6e-07, + "input_cost_per_token": 1.26e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 3.96e-06, + "source": "https://apimodels.app/models/glm-5.2", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/deepseek-v4.1-flash": { + "cache_read_input_token_cost": 5.4e-09, + "input_cost_per_token": 2.7e-07, + "litellm_provider": "apimodels", + "mode": "chat", + "off_peak_pricing": { + "cache_read_input_token_cost": 2.7e-09, + "input_cost_per_token": 1.35e-07, + "output_cost_per_token": 5.4e-07, + "windows": [ + { + "hours_utc": [ + "00:00-01:00", + "04:00-06:00", + "10:00-00:00" + ], + "weekdays": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + { + "hours_utc": "00:00-00:00", + "weekdays": [ + 6, + 7 + ] + } + ] + }, + "output_cost_per_token": 1.08e-06, + "source": "https://apimodels.app/models/deepseek-v4.1-flash" + }, + "apimodels/deepseek-v4-flash": { + "cache_read_input_token_cost": 5.4e-09, + "input_cost_per_token": 2.7e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 393216, + "max_tokens": 393216, + "mode": "chat", + "off_peak_pricing": { + "cache_read_input_token_cost": 2.7e-09, + "input_cost_per_token": 1.35e-07, + "output_cost_per_token": 5.4e-07, + "windows": [ + { + "hours_utc": [ + "00:00-01:00", + "04:00-06:00", + "10:00-00:00" + ], + "weekdays": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + { + "hours_utc": "00:00-00:00", + "weekdays": [ + 6, + 7 + ] + } + ] + }, + "output_cost_per_token": 1.08e-06, + "source": "https://apimodels.app/models/deepseek-v4-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/qwen3.8-max": { + "cache_read_input_token_cost": 2.5e-07, + "input_cost_per_token": 2e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 991808, + "max_output_tokens": 131072, + "max_tokens": 131072, + "mode": "chat", + "output_cost_per_token": 6e-06, + "source": "https://apimodels.app/models/qwen3.8-max", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/qwen3.8-flash": { + "cache_read_input_token_cost": 1.6e-08, + "input_cost_per_token": 1.5e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 991808, + "max_output_tokens": 131072, + "max_tokens": 131072, + "mode": "chat", + "output_cost_per_token": 4.7e-07, + "source": "https://apimodels.app/models/qwen3.8-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/qwen3.7-max": { + "cache_read_input_token_cost": 4.5e-07, + "input_cost_per_token": 2.25e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 991808, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 6.75e-06, + "source": "https://apimodels.app/models/qwen3.7-max", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/qwen3.7-plus": { + "cache_read_input_token_cost": 7.2e-08, + "input_cost_per_token": 3.6e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 991808, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 1.44e-06, + "source": "https://apimodels.app/models/qwen3.7-plus", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "tiered_pricing": [ + { + "cache_read_input_token_cost": 7.2e-08, + "input_cost_per_token": 3.6e-07, + "output_cost_per_token": 1.44e-06, + "range": [ + 0, + 262144 + ] + }, + { + "cache_read_input_token_cost": 2.16e-07, + "input_cost_per_token": 1.08e-06, + "output_cost_per_token": 4.32e-06, + "range": [ + 262144, + 1000000 + ] + } + ] + }, "bespoke/nimble-latest": { "input_cost_per_token": 0.0, "litellm_provider": "bespoke", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index d570e49bf6c..6b58e6e1640 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -71337,6 +71337,646 @@ "supports_reasoning": true, "supports_vision": true }, + "apimodels/claude-fable-5-1": { + "cache_creation_input_token_cost": 5.778e-06, + "cache_read_input_token_cost": 2.2e-07, + "input_cost_per_token": 5e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "source": "https://apimodels.app/models/claude-fable-5-1", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-fable-5": { + "cache_creation_input_token_cost": 8.824e-06, + "cache_read_input_token_cost": 8.82e-07, + "input_cost_per_token": 5e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "source": "https://apimodels.app/models/claude-fable-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-5-5": { + "cache_creation_input_token_cost": 3e-06, + "cache_read_input_token_cost": 1.2e-07, + "input_cost_per_token": 2.4e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.2e-05, + "source": "https://apimodels.app/models/claude-opus-5-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-5": { + "cache_creation_input_token_cost": 4.891e-06, + "cache_read_input_token_cost": 3.91e-07, + "input_cost_per_token": 3e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.5e-05, + "source": "https://apimodels.app/models/claude-opus-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-4-8": { + "cache_creation_input_token_cost": 1.765e-06, + "cache_read_input_token_cost": 3e-07, + "input_cost_per_token": 3e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.3e-05, + "source": "https://apimodels.app/models/claude-opus-4-8", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-4-7": { + "cache_creation_input_token_cost": 4.595e-06, + "cache_read_input_token_cost": 3.676e-07, + "input_cost_per_token": 3.676e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.8382e-05, + "source": "https://apimodels.app/models/claude-opus-4-7", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-4-6": { + "cache_creation_input_token_cost": 2.206e-06, + "cache_read_input_token_cost": 1.765e-07, + "input_cost_per_token": 1.765e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 8.824e-06, + "source": "https://apimodels.app/models/claude-opus-4-6", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-opus-4-5-20251101": { + "cache_creation_input_token_cost": 2.206e-06, + "cache_read_input_token_cost": 1.765e-07, + "input_cost_per_token": 1.765e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 200000, + "max_output_tokens": 64000, + "max_tokens": 64000, + "mode": "chat", + "output_cost_per_token": 8.824e-06, + "source": "https://apimodels.app/models/claude-opus-4-5-20251101", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-sonnet-5-5": { + "cache_creation_input_token_cost": 1.5e-06, + "cache_read_input_token_cost": 1.2e-07, + "input_cost_per_token": 1.2e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 6e-06, + "source": "https://apimodels.app/models/claude-sonnet-5-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-sonnet-5": { + "cache_creation_input_token_cost": 1.4e-06, + "cache_read_input_token_cost": 1e-07, + "input_cost_per_token": 1.6e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 8e-06, + "source": "https://apimodels.app/models/claude-sonnet-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-sonnet-4-6": { + "cache_creation_input_token_cost": 1.324e-06, + "cache_read_input_token_cost": 1.059e-07, + "input_cost_per_token": 1.059e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 5.295e-06, + "source": "https://apimodels.app/models/claude-sonnet-4-6", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-haiku-5-5": { + "cache_creation_input_token_cost": 1.125e-07, + "cache_creation_input_token_cost_above_100k_tokens": 5.625e-07, + "cache_read_input_token_cost": 9e-09, + "cache_read_input_token_cost_above_100k_tokens": 4.5e-08, + "input_cost_per_token": 9e-08, + "input_cost_per_token_above_100k_tokens": 4.5e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.5e-07, + "output_cost_per_token_above_100k_tokens": 2.25e-06, + "source": "https://apimodels.app/models/claude-haiku-5-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/claude-haiku-4-5-20251001": { + "cache_creation_input_token_cost": 4.41e-07, + "cache_read_input_token_cost": 3.53e-08, + "input_cost_per_token": 3.53e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 200000, + "max_output_tokens": 64000, + "max_tokens": 64000, + "mode": "chat", + "output_cost_per_token": 1.765e-06, + "source": "https://apimodels.app/models/claude-haiku-4-5-20251001", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gemini-3.8-flash": { + "cache_read_input_token_cost": 1.72e-07, + "input_cost_per_token": 4.5e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 2.25e-06, + "source": "https://apimodels.app/models/gemini-3.8-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gemini-3.6-flash": { + "cache_read_input_token_cost": 6.62e-08, + "input_cost_per_token": 6.62e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 3.302e-06, + "source": "https://apimodels.app/models/gemini-3.6-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gemini-3.5-flash": { + "cache_read_input_token_cost": 6.62e-08, + "input_cost_per_token": 6.62e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 3.971e-06, + "source": "https://apimodels.app/models/gemini-3.5-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gemini-3.1-flash-lite": { + "cache_read_input_token_cost": 2.5e-08, + "input_cost_per_token": 3.75e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 2.25e-06, + "source": "https://apimodels.app/models/gemini-3.1-flash-lite", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-6-astra": { + "cache_read_input_token_cost": 2.4e-07, + "cache_read_input_token_cost_above_272k_tokens": 4.8e-07, + "input_cost_per_token": 2.4e-06, + "input_cost_per_token_above_272k_tokens": 4.8e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.2e-05, + "output_cost_per_token_above_272k_tokens": 1.8e-05, + "source": "https://apimodels.app/models/gpt-6-astra", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-6.1-sol": { + "cache_read_input_token_cost": 5e-08, + "cache_read_input_token_cost_above_272k_tokens": 1e-07, + "input_cost_per_token": 1e-06, + "input_cost_per_token_above_272k_tokens": 2e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "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, + "source": "https://apimodels.app/models/gpt-6.1-sol", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-6-sol": { + "cache_read_input_token_cost": 1e-07, + "cache_read_input_token_cost_above_272k_tokens": 2e-07, + "input_cost_per_token": 1e-06, + "input_cost_per_token_above_272k_tokens": 2e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "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, + "source": "https://apimodels.app/models/gpt-6-sol", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-6-luna": { + "cache_read_input_token_cost": 9e-09, + "cache_read_input_token_cost_above_272k_tokens": 1.8e-08, + "input_cost_per_token": 9e-08, + "input_cost_per_token_above_272k_tokens": 1.8e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.5e-07, + "output_cost_per_token_above_272k_tokens": 6.75e-07, + "source": "https://apimodels.app/models/gpt-6-luna", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5.6-sol": { + "cache_read_input_token_cost": 1.32e-07, + "cache_read_input_token_cost_above_272k_tokens": 2.64e-07, + "input_cost_per_token": 1.324e-06, + "input_cost_per_token_above_272k_tokens": 2.648e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 6.618e-06, + "output_cost_per_token_above_272k_tokens": 9.927e-06, + "source": "https://apimodels.app/models/gpt-5-6-sol", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5.6-terra": { + "cache_read_input_token_cost": 5.5e-08, + "cache_read_input_token_cost_above_272k_tokens": 1.1e-07, + "input_cost_per_token": 5.51e-07, + "input_cost_per_token_above_272k_tokens": 1.102e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 3.309e-06, + "output_cost_per_token_above_272k_tokens": 4.9635e-06, + "source": "https://apimodels.app/models/gpt-5-6-terra", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5.6-luna": { + "cache_read_input_token_cost": 1.8e-08, + "cache_read_input_token_cost_above_272k_tokens": 3.6e-08, + "input_cost_per_token": 1.8e-07, + "input_cost_per_token_above_272k_tokens": 3.6e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 9.6e-07, + "output_cost_per_token_above_272k_tokens": 1.44e-06, + "source": "https://apimodels.app/models/gpt-5-6-luna", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5-5": { + "cache_read_input_token_cost": 5e-07, + "input_cost_per_token": 3e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.8e-05, + "source": "https://apimodels.app/models/gpt-5-5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/gpt-5-4": { + "cache_read_input_token_cost": 2.5e-07, + "input_cost_per_token": 1.8e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.08e-05, + "source": "https://apimodels.app/models/gpt-5-4", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/grok-4.6": { + "cache_read_input_token_cost": 3.75e-07, + "input_cost_per_token": 1.5e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 500000, + "max_output_tokens": 500000, + "max_tokens": 500000, + "mode": "chat", + "output_cost_per_token": 4.5e-06, + "source": "https://apimodels.app/models/grok-4.6", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/grok-4.5": { + "cache_read_input_token_cost": 3e-07, + "input_cost_per_token": 1.275e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 500000, + "max_output_tokens": 500000, + "max_tokens": 500000, + "mode": "chat", + "output_cost_per_token": 4.25e-06, + "source": "https://apimodels.app/models/grok-4.5", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_vision": true + }, + "apimodels/glm-5.3": { + "cache_read_input_token_cost": 2.47e-07, + "input_cost_per_token": 1.33e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.18e-06, + "source": "https://apimodels.app/models/glm-5.3", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/glm-5.2": { + "cache_read_input_token_cost": 2.6e-07, + "input_cost_per_token": 1.26e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 3.96e-06, + "source": "https://apimodels.app/models/glm-5.2", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/deepseek-v4.1-flash": { + "cache_read_input_token_cost": 5.4e-09, + "input_cost_per_token": 2.7e-07, + "litellm_provider": "apimodels", + "mode": "chat", + "off_peak_pricing": { + "cache_read_input_token_cost": 2.7e-09, + "input_cost_per_token": 1.35e-07, + "output_cost_per_token": 5.4e-07, + "windows": [ + { + "hours_utc": [ + "00:00-01:00", + "04:00-06:00", + "10:00-00:00" + ], + "weekdays": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + { + "hours_utc": "00:00-00:00", + "weekdays": [ + 6, + 7 + ] + } + ] + }, + "output_cost_per_token": 1.08e-06, + "source": "https://apimodels.app/models/deepseek-v4.1-flash" + }, + "apimodels/deepseek-v4-flash": { + "cache_read_input_token_cost": 5.4e-09, + "input_cost_per_token": 2.7e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 1000000, + "max_output_tokens": 393216, + "max_tokens": 393216, + "mode": "chat", + "off_peak_pricing": { + "cache_read_input_token_cost": 2.7e-09, + "input_cost_per_token": 1.35e-07, + "output_cost_per_token": 5.4e-07, + "windows": [ + { + "hours_utc": [ + "00:00-01:00", + "04:00-06:00", + "10:00-00:00" + ], + "weekdays": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + { + "hours_utc": "00:00-00:00", + "weekdays": [ + 6, + 7 + ] + } + ] + }, + "output_cost_per_token": 1.08e-06, + "source": "https://apimodels.app/models/deepseek-v4-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/qwen3.8-max": { + "cache_read_input_token_cost": 2.5e-07, + "input_cost_per_token": 2e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 991808, + "max_output_tokens": 131072, + "max_tokens": 131072, + "mode": "chat", + "output_cost_per_token": 6e-06, + "source": "https://apimodels.app/models/qwen3.8-max", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/qwen3.8-flash": { + "cache_read_input_token_cost": 1.6e-08, + "input_cost_per_token": 1.5e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 991808, + "max_output_tokens": 131072, + "max_tokens": 131072, + "mode": "chat", + "output_cost_per_token": 4.7e-07, + "source": "https://apimodels.app/models/qwen3.8-flash", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/qwen3.7-max": { + "cache_read_input_token_cost": 4.5e-07, + "input_cost_per_token": 2.25e-06, + "litellm_provider": "apimodels", + "max_input_tokens": 991808, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 6.75e-06, + "source": "https://apimodels.app/models/qwen3.7-max", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true + }, + "apimodels/qwen3.7-plus": { + "cache_read_input_token_cost": 7.2e-08, + "input_cost_per_token": 3.6e-07, + "litellm_provider": "apimodels", + "max_input_tokens": 991808, + "max_output_tokens": 65536, + "max_tokens": 65536, + "mode": "chat", + "output_cost_per_token": 1.44e-06, + "source": "https://apimodels.app/models/qwen3.7-plus", + "supports_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "tiered_pricing": [ + { + "cache_read_input_token_cost": 7.2e-08, + "input_cost_per_token": 3.6e-07, + "output_cost_per_token": 1.44e-06, + "range": [ + 0, + 262144 + ] + }, + { + "cache_read_input_token_cost": 2.16e-07, + "input_cost_per_token": 1.08e-06, + "output_cost_per_token": 4.32e-06, + "range": [ + 262144, + 1000000 + ] + } + ] + }, "bespoke/nimble-latest": { "input_cost_per_token": 0.0, "litellm_provider": "bespoke", diff --git a/tests/unit/llms/openai_like/test_apimodels_provider.py b/tests/unit/llms/openai_like/test_apimodels_provider.py index cfee74f364a..b52bf676897 100644 --- a/tests/unit/llms/openai_like/test_apimodels_provider.py +++ b/tests/unit/llms/openai_like/test_apimodels_provider.py @@ -224,3 +224,52 @@ async def test_apimodels_anthropic_messages_request_is_bridged_to_chat_completio assert body["messages"] == [{"role": "user", "content": "Say hello"}] assert body["max_tokens"] == 32 assert response["content"][0]["text"] == "Hello from APIMODELS" + + +def _completion_with_usage(model: str, usage: dict[str, object]) -> litellm.ModelResponse: + body: Final = {**_chat_completion(model), "usage": usage} + with respx.mock() as upstream: + upstream.post("https://api.apimodels.app/v1/chat/completions").respond(200, json=body) + return litellm.completion( + model=f"apimodels/{model}", + messages=[{"role": "user", "content": "Say hello"}], + api_key="apimodels-test-key", + ) + + +def test_apimodels_chat_completion_cost_bills_cached_tokens_at_cache_read_rate(): + row: Final = litellm.model_cost["apimodels/gpt-6-sol"] + response: Final = _completion_with_usage( + "gpt-6-sol", + { + "prompt_tokens": 1000, + "completion_tokens": 20, + "total_tokens": 1020, + "prompt_tokens_details": {"cached_tokens": 800}, + }, + ) + + assert row["cache_read_input_token_cost"] < row["input_cost_per_token"] + assert litellm.completion_cost(completion_response=response, model="apimodels/gpt-6-sol") == pytest.approx( + 200 * row["input_cost_per_token"] + 800 * row["cache_read_input_token_cost"] + 20 * row["output_cost_per_token"] + ) + + +def test_apimodels_prompt_over_272k_bills_the_whole_request_at_the_long_context_rates(): + row: Final = litellm.model_cost["apimodels/gpt-6-sol"] + response: Final = _completion_with_usage( + "gpt-6-sol", + { + "prompt_tokens": 300_000, + "completion_tokens": 20, + "total_tokens": 300_020, + "prompt_tokens_details": {"cached_tokens": 100_000}, + }, + ) + + assert row["input_cost_per_token_above_272k_tokens"] > row["input_cost_per_token"] + assert litellm.completion_cost(completion_response=response, model="apimodels/gpt-6-sol") == pytest.approx( + 200_000 * row["input_cost_per_token_above_272k_tokens"] + + 100_000 * row["cache_read_input_token_cost_above_272k_tokens"] + + 20 * row["output_cost_per_token_above_272k_tokens"] + )