diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 870b97530fa..f18e8d62aa9 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -952,7 +952,8 @@ def completion_cost( # noqa: PLR0915 ) potential_model_names = [selected_model, _get_response_model(completion_response)] - + if model is not None: + potential_model_names.append(model) for idx, model in enumerate(potential_model_names): try: