fix: Default to free tier if OpenRouter tier check fails

This commit is contained in:
Paul Gauthier (aider) 2025-03-28 18:44:57 -10:00
parent b4f9258f3c
commit 3bc4064b61

View file

@ -38,8 +38,8 @@ def check_openrouter_tier(api_key):
# According to the documentation, 'is_free_tier' will be true if the user has never paid # According to the documentation, 'is_free_tier' will be true if the user has never paid
return data.get("data", {}).get("is_free_tier", True) # Default to True if not found return data.get("data", {}).get("is_free_tier", True) # Default to True if not found
except Exception: except Exception:
# If there's any error, we'll default to assuming paid tier to be safe # If there's any error, we'll default to assuming free tier
return False return True
def try_to_select_default_model(): def try_to_select_default_model():