feat: add API key authentication for AI proxy endpoints
- Add API_KEY config (env var) to all entry points - requireAuth helper checks Authorization: Bearer or x-api-key header - Auth applied to /v1/chat/completions, /v1/messages, /v1/models - When API_KEY is empty/unset, auth is disabled (backward compatible) - Update wrangler.toml with API_KEY variable documentation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2be57c0838
commit
c0a02279bd
4 files changed
+69
No files matched your search
@@ -12,3 +12,4 @@ workers_dev = true
|
||||
# RELAY_TIMEOUT_MS = "30000"
|
||||
# RATE_LIMIT_MAX = "200"
|
||||
# RATE_LIMIT_WINDOW_MS = "60000"
|
||||
# API_KEY = "sk-your-secret-key"
|
||||
Reference in new issue
Block a user