Spaces:
Paused
Paused
Download litellm/proxy/example_config_yaml/custom_auth_basic.py from DesertWolf/test3: direct link, hf CLI and curl.
- Browser
- Download file 377 Bytes
-
https://huggingface.co/spaces/DesertWolf/test3/resolve/main/litellm/proxy/example_config_yaml/custom_auth_basic.py
- Command line
-
hf download hf://spaces/DesertWolf/test3/litellm/proxy/example_config_yaml/custom_auth_basic.py
-
curl -L -o custom_auth_basic.py https://huggingface.co/spaces/DesertWolf/test3/resolve/main/litellm/proxy/example_config_yaml/custom_auth_basic.py
377 Bytes
| from fastapi import Request | |
| from litellm.proxy._types import UserAPIKeyAuth | |
| async def user_api_key_auth(request: Request, api_key: str) -> UserAPIKeyAuth: | |
| try: | |
| return UserAPIKeyAuth( | |
| api_key="best-api-key-ever", | |
| user_id="best-user-id-ever", | |
| team_id="best-team-id-ever", | |
| ) | |
| except Exception: | |
| raise Exception | |