mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
refactor(proxy): use settings for upstream base; integrate new pricing flow and header prep
This commit is contained in:
+3
-3
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user