Spaces:
Sleeping
Sleeping
File size: 283 Bytes
37c6d1c |
1 2 3 4 5 6 7 8 9 |
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
|