From 8950cc5b7ff66d2285fdf78b7c02ac392f382f50 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Wed, 22 Oct 2025 12:07:27 +0800 Subject: [PATCH] rm redundant try except --- routstr/proxy.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/routstr/proxy.py b/routstr/proxy.py index 86e2cbc9..4fbcc183 100644 --- a/routstr/proxy.py +++ b/routstr/proxy.py @@ -263,13 +263,7 @@ async def proxy( # Only pay for request if we have request body data (for completions endpoints) if request_body_dict: - try: - await pay_for_request(key, max_cost_for_model, session) - except Exception: - raise HTTPException( - status_code=402, - detail={"error": {"type": "payment_error", "code": "payment_error"}}, - ) + await pay_for_request(key, max_cost_for_model, session) # Prepare headers for upstream headers = upstream.prepare_headers(dict(request.headers))