refactor(proxy): use settings for upstream base; integrate new pricing flow and header prep

This commit is contained in:
Shroominic
2025-09-08 10:53:02 +01:00
parent a4f28db887
commit 15e61d1760
+3 -3
View File
@@ -15,8 +15,8 @@ from .auth import (
)
from .core import get_logger
from .core.db import ApiKey, AsyncSession, create_session, get_session
from .core.settings import settings
from .payment.helpers import (
UPSTREAM_BASE_URL,
check_token_balance,
create_error_response,
get_max_cost_for_model,
@@ -307,7 +307,7 @@ async def forward_to_upstream(
if path.startswith("v1/"):
path = path.replace("v1/", "")
url = f"{UPSTREAM_BASE_URL}/{path}"
url = f"{settings.upstream_base_url}/{path}"
logger.info(
"Forwarding request to upstream",
@@ -756,7 +756,7 @@ async def forward_get_to_upstream(
if path.startswith("v1/"):
path = path.replace("v1/", "")
url = f"{UPSTREAM_BASE_URL}/{path}"
url = f"{settings.upstream_base_url}/{path}"
logger.info(
"Forwarding GET request to upstream",