Spaces:
Running
Running
| from fastapi import Header, HTTPException | |
| API_KEY = "my_secret_key_123" # Simple hardcoded key for demo | |
| async def verify_api_key(x_api_key: str = Header(...)): | |
| if x_api_key != API_KEY: | |
| raise HTTPException(status_code=401, detail="Invalid API Key") | |
| return x_api_key | |