diff --git a/autogen/oai/completion.py b/autogen/oai/completion.py index f3ea897de6b6..54739ec5d2f3 100644 --- a/autogen/oai/completion.py +++ b/autogen/oai/completion.py @@ -1026,7 +1026,7 @@ def cost(cls, response: dict): Returns: The cost in USD. 0 if the model is not supported. """ - model = response["model"] + model = response.get("model") if model not in cls.price1K: return 0 # raise ValueError(f"Unknown model: {model}")