litellm/cookbook
devin-ai-integration[bot] 537e8ac068
feat(cost): warn and count $0 cost on billable requests (#42345)
* feat(cost): warn and count $0 cost on billable requests

A request that carries usage but prices to $0 on a model whose pricing
entry has a non-zero rate now logs one warning naming the model, the
pricing entry, and the missing rate, and increments
litellm_zero_cost_requests_total{requested_model, model, model_id,
api_provider, reason}. Free models (every used rate is 0), requests
without usage, and unmapped models stay silent. The diagnostic rides on
the standard logging payload as zero_cost_diagnostic

* fix(cost): keep the zero-cost diagnostic importable on 3.10 and recursion-free

* fix(cost): warn once per request when a $0 result is priced again

* fix(cost): judge a free deployment by its own pricing and keep it silent on calculator errors

* fix(cost): warn once per request when a usage-less evaluation sits between two zero-cost findings

* fix(cost): judge zero-cost findings by the priced entry, skip cache hits, count failure rows

* test(cost): type the zero-cost diagnostic test helpers

* test(logging): flag a $0 terminal Responses stream event by its inner response

* chore: restore the lazy OpenAPI snapshot as CI's Python 3.12 generates it

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-21 19:49:26 -07:00
..
ai_coding_tool_guides
anthropic_agent_sdk
benchmark docs: document new github + gitlab ci scripts 2026-03-25 20:17:10 -07:00
codellama-server
community-resources
gollem_go_agent_framework
litellm-ollama-docker-image
litellm_proxy_server feat(cost): warn and count $0 cost on billable requests (#42345) 2026-09-21 19:49:26 -07:00
litellm_router
litellm_router_load_test
livekit_agent_sdk chore: remove the dead telemetry flag from the SDK, proxy CLI and configs 2026-09-20 01:44:10 +00:00
logging_observability
misc fix(proxy): drop legacy telemetry key from persisted WORKER_CONFIG before initialize 2026-09-20 03:14:11 +00:00
mock_guardrail_server
mock_prompt_management_server
Benchmarking_LLMs_by_use_case.ipynb
Claude_(Anthropic)_with_Streaming_liteLLM_Examples.ipynb
Evaluating_LLMs.ipynb
google_adk_litellm_tutorial.ipynb
liteLLM_A121_Jurrasic_example.ipynb
LiteLLM_Azure_and_OpenAI_example.ipynb
liteLLM_Baseten.ipynb
LiteLLM_batch_completion.ipynb
LiteLLM_Bedrock.ipynb
liteLLM_clarifai_Demo.ipynb
LiteLLM_CometAPI.ipynb
LiteLLM_Comparing_LLMs.ipynb
LiteLLM_Completion_Cost.ipynb
liteLLM_function_calling.ipynb
liteLLM_Getting_Started.ipynb
LiteLLM_HuggingFace.ipynb
liteLLM_IBM_Watsonx.ipynb
liteLLM_Langchain_Demo.ipynb
litellm_model_fallback.ipynb
LiteLLM_NovitaAI_Cookbook.ipynb
liteLLM_Ollama.ipynb
LiteLLM_OpenRouter.ipynb
LiteLLM_Petals.ipynb
LiteLLM_PromptLayer.ipynb
liteLLM_Replicate_Demo.ipynb
liteLLM_Streaming_Demo.ipynb
litellm_test_multiple_llm_demo.ipynb
litellm_Test_Multiple_Providers.ipynb
LiteLLM_User_Based_Rate_Limits.ipynb
liteLLM_VertextAI_Example.ipynb
Migrating_to_LiteLLM_Proxy_from_OpenAI_Azure_OpenAI.ipynb
mlflow_langchain_tracing_litellm_proxy.ipynb
nova_sonic_realtime.py
Parallel_function_calling.ipynb
Proxy_Batch_Users.ipynb
result.html
TogetherAI_liteLLM.ipynb
Using_Nemo_Guardrails_with_LiteLLM_Server.ipynb
veo_video_generation.py
VLLM_Model_Testing.ipynb