diff --git a/.gitignore b/.gitignore index c21c4b2d..38976d5a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ wallet.sqlite3 .*wallet.sqlite3 *models.json .cashu +.dockerignore compose.override.yml diff --git a/router/payment/helpers.py b/router/payment/helpers.py index 6b58882b..61b8120a 100644 --- a/router/payment/helpers.py +++ b/router/payment/helpers.py @@ -10,17 +10,12 @@ from .models import MODELS logger = get_logger(__name__) -UPSTREAM_BASE_URL = os.environ["UPSTREAM_BASE_URL"] + +UPSTREAM_BASE_URL = os.environ.get("UPSTREAM_BASE_URL", "") UPSTREAM_API_KEY = os.environ.get("UPSTREAM_API_KEY", "") -logger.info( - "Payment helpers initialized", - extra={ - "upstream_base_url": UPSTREAM_BASE_URL, - "has_upstream_api_key": bool(UPSTREAM_API_KEY), - "model_based_pricing": MODEL_BASED_PRICING, - }, -) +if not UPSTREAM_BASE_URL: + raise ValueError("Please set the UPSTREAM_BASE_URL environment variable") def get_cost_per_request(model: str | None = None) -> int: