diff --git a/mito-ai/mito_ai/providers.py b/mito-ai/mito_ai/providers.py index 3a386f6d5..a930a8d1d 100644 --- a/mito-ai/mito_ai/providers.py +++ b/mito-ai/mito_ai/providers.py @@ -189,6 +189,16 @@ def capabilities(self) -> AICapabilities: if self._models is None: self._validate_api_key({"value": self.api_key}) + # If the user has an OpenAI API key, then we don't need to check the Mito server quota. + if self.api_key: + return AICapabilities( + configuration={ + "model": self.model, + "temperature": self.temperature, + }, + provider="OpenAI (user key)", + ) + # Get the number of usages global _num_usages if _num_usages is None: @@ -216,7 +226,7 @@ def capabilities(self) -> AICapabilities: "model": self.model, "temperature": self.temperature, }, - provider="OpenAI (user key)" if self.api_key else "Mito server", + provider="Mito server", ) @property