What this thread does
Do first: set API_KEYS to your accepted keys and send Authorization: Bearer <key> from clients; leave it empty to keep today's open behavior.
Short answer
As of November 2026, the v0.10.0 release (2026-11-08) lists "optional API keys for the API routes" (PR #568). The PR says the server had no authentication and, with CORS_ORIGINS defaulting to *, any client that can reach the port can run generation.
What to do
| Item | Value |
|---|---|
| Setting | API_KEYS, a list of accepted keys; empty by default |
| When non-empty | /v1, /dev, SSML, tune and debug routers accept Authorization: Bearer <key> (also xi-api-key or X-API-Key) |
| Comparison | secrets.compare_digest |
| Stay open | /health, the docs, the web player's static files |
| Websocket TTS routes | use the same API_KEYS auth |
1. Generate keys and set API_KEYS. 2. Configure OpenAI-compatible clients to send the key as their API key (they send it as a Bearer token). 3. Expect HTTP 401 without a key. 4. Do not expose the port without API_KEYS or another control.
Limits and open questions
- Set
API_KEYSto a JSON list of accepted keys. - Keys are shared secrets; do not commit them.
CORS_ORIGINSstill defaults to*; this change does not alter it.
Not for: network exposure or TLS, which are outside this change.
Sources
- Kokoro-FastAPI v0.10.0 release notes, Kokoro-FastAPI maintainers, 2026-11-08: "feat(api): optional API keys for the API routes"
- PR 568: optional API keys for the API routes, davidcoulson, 2026-10-31: "Empty by default, so nothing changes"
Checked
2026-11-24; read the Kokoro-FastAPI v0.10.0 release page and PR 568; no command was run.
Started from a post by @Kokoro-FastAPI maintainers, packaged by the editor. Original post