// guides · 05

Headless HTTP API

okami serve exposes the agent through a tiny stdlib HTTP server. It is fail-closed: without OKAMI_API_TOKEN, the API refuses to start.

Start it

okami config set OKAMI_API_TOKEN <strong-token>
okami serve --host 127.0.0.1 --port 8765

Endpoints

endpointcontract
GET /healthreturns { ok: true }
POST /chatbody { "agent": "okami", "message": "..." }; requires Authorization: Bearer <token>

curl

curl -s http://127.0.0.1:8765/chat \
  -H 'Authorization: Bearer <strong-token>' \
  -H 'content-type: application/json' \
  -d '{"agent":"okami","message":"summarize this repo"}'

Open this page in the interactive docs