Skip to main content
KiwiFS has no authentication by default, which suits a laptop or a trusted network. Before you expose a server, pick an auth mode in [auth] of .kiwi/config.toml. Every mode uses the same header:
Terminal

Auth modes

No authentication.
.kiwi/config.toml
A request without a valid token returns 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

A prefix limits every request that names a path, including each file in a POST /api/kiwi/bulk body:
.kiwi/config.toml
This key can read and write 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
Keys start with 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.
KiwiFS doesn’t watch config.toml for auth changes. Created and revoked tokens only take effect after SIGHUP or a restart.

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 an Authorization header (checked against the key’s space and prefix), a signed URL, or when the file is already public: a page with visibility: public or published: true, an asset next to such a page, or the configured logo and favicon.
  • /llms.txt and /llms-full.txt list only public or published pages, unless the whole space is public.
<img> and <video> tags can’t send headers, so get a signed URL instead. The web UI does this automatically.
Terminal
Response
Signed URLs last 30 to 60 minutes and stop working when the server restarts.

Other protocols

REST honors every auth mode. The other surfaces check only the global api_key:
With perspace or oidc, the MCP HTTP endpoint, S3, and WebDAV don’t require a token. Don’t enable --s3 or --webdav on a public network in those modes, and keep /mcp behind a proxy that authenticates.
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 from localhost. With auth on, any origin is allowed until you list the ones you trust:
.kiwi/config.toml

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.
Last modified on October 19, 2026