fix: add trailing slash routes for /models endpoint

The /models/ endpoint with trailing slash was being caught by the proxy
catch-all route instead of the models router, causing 'Model unknown not
found' errors. Add explicit routes for both /models and /v1/models with
and without trailing slashes.
This commit is contained in:
redshift
2026-03-23 13:15:59 +00:00
parent 6db11ed88f
commit a6c6d3e034
+3 -1
View File
@@ -403,7 +403,9 @@ async def update_sats_pricing() -> None:
@models_router.get("/v1/models")
@models_router.get("/models", include_in_schema=False)
@models_router.get("/v1/models/", include_in_schema=False)
@models_router.get("/models")
@models_router.get("/models/", include_in_schema=False)
async def models(session: AsyncSession = Depends(get_session)) -> dict:
"""Get all available models from all providers with database overrides applied."""
from ..proxy import get_unique_models