INNER CODE UNIT · Python
_custom_http_exception_handler
speaches-ai/speaches · src/speaches/main.py:153
async def _custom_http_exception_handler(request: Request, exc: HTTPException) -> Response:
logger.error(f"HTTP error: {exc}")
return await http_exception_handler(request, exc)
# Public routers WITHOUT authentication
app.include_router(misc_public_router)
# HTTP routers WITH authentication (if API key is configured)
http_dependencies = []
if config.api_key is not None:
http_dependencies.append(ApiKeyDependency)
app.include_router(chat_router, dependencies=http_dependencies)
app.include_router(stt_router, dependencies=http_dependencies)
app.include_router(models_router, dependencies=http_dependencies)
app.include_router(misc_router, dependencies=http_dependencies)
app.include_router(realtime_rtc_router, dependencies=http_dependencies)
app.include_router(speech_router, dependencies=http_dependencies)