Authentication

Every /api/* request needs a token:
Tokens are set on the server in BRAIN_API_TOKENS as name:token pairs separated by commas. The name becomes the actor for that agent’s writes. A token must be at least 16 characters, and the name jack is not allowed.
A missing or wrong token returns 401.

Read

Write

Send JSON with Content-Type: application/json. Previews that write nothing: POST /api/parse, POST /api/magic and POST /api/suggest.

Read-only servers

A server started with BRAIN_READONLY=1 refuses writes. The three preview requests still work.