| from fastapi import Header, HTTPException | |
| # Enterprise demo keys (rotate later) | |
| VALID_KEYS = { | |
| "codex-enterprise-demo-key" | |
| } | |
| def verify_api_key(x_api_key: str = Header(...)): | |
| if x_api_key not in VALID_KEYS: | |
| raise HTTPException( | |
| status_code=401, | |
| detail="Invalid or missing API key" | |
| ) | |
| return x_api_key |