diff --git a/app/main.py b/app/main.py index 5783ac5..2cd6ba6 100644 --- a/app/main.py +++ b/app/main.py @@ -241,6 +241,21 @@ async def opencollective_webhook(request: Request): # --- B. Key injector (proxy) --- +@app.get("/v1/models") +async def list_models(): + """List models (same for everyone — no per-user auth needed).""" + async with httpx.AsyncClient() as client: + r = await client.get( + f"{LITELLM_BASE}/v1/models", + headers={"Authorization": f"Bearer {LITELLM_MASTER_KEY}"}, + ) + return Response( + content=r.content, + status_code=r.status_code, + headers={"content-type": r.headers.get("content-type", "application/json")}, + ) + + @app.api_route("/v1/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH"]) async def inject_key(request: Request, path: str): """Read the member's email from a header, inject their key, forward to LiteLLM."""