[auth] of .kiwi/config.toml. Every mode uses the same header:
Terminal
Auth modes
- none (default)
- apikey
- perspace
- oidc
No authentication.
.kiwi/config.toml
401. A valid token used outside its scope, space, or prefix returns 403.
Per-space token fields
Each[[auth.api_keys]] entry supports:
A key with no
scope gets admin. kiwifs token create defaults to read, so set scope explicitly when you write entries by hand.Scopes
Path prefixes
Aprefix limits every request that names a path, including each file in a POST /api/kiwi/bulk body:
.kiwi/config.toml
onboarding/welcome.md. A request for ?path=pages/secret.md returns 403 path outside token prefix scope.
Manage tokens with the CLI
kiwifs token edits [[auth.api_keys]] in .kiwi/config.toml. If [auth] type is unset or none, token create switches it to perspace.
1
Create a token
Terminal
Output
kiwi_ro_, kiwi_rw_, or kiwi_adm_ depending on scope. Flags: --space, --scope (default read), --prefix, --actor (default <scope>-token), --root.2
Reload the server
Terminal
SIGHUP reloads [auth] from disk without dropping in-flight requests. Port and storage changes still need a restart.3
List and revoke
Terminal
list shows the first 12 characters of each key with its scope, space, actor, and prefix. revoke removes every key that starts with the prefix you give. Send SIGHUP again to make the revocation take effect.Public and unlisted spaces
Set[space] visibility to open read access without a token:
Writes always need a token. Change visibility at runtime with
PUT /api/kiwi/space/visibility.
Raw files and llms.txt
Two routes sit outside/api/kiwi so browsers and crawlers can reach them. When auth is on:
/raw/{path}serves a file only with anAuthorizationheader (checked against the key’s space and prefix), a signed URL, or when the file is already public: a page withvisibility: publicorpublished: true, an asset next to such a page, or the configured logo and favicon./llms.txtand/llms-full.txtlist only public or published pages, unless the whole space ispublic.
<img> and <video> tags can’t send headers, so get a signed URL instead. The web UI does this automatically.
Terminal
Response
Other protocols
REST honors every auth mode. The other surfaces check only the globalapi_key:
To point the MCP bridge or a FUSE mount at a protected server, pass a token:
Terminal
CORS
With auth off, the API only answers cross-origin browser requests fromlocalhost. With auth on, any origin is allowed until you list the ones you trust:
.kiwi/config.toml
Related
Configuration
Every
config.toml key.API overview
Headers and error codes.
Multi-space
Serve several knowledge bases from one server.
Publishing
Make individual pages public.