Documentation
All documents

HTTP API

Every endpoint, which ones are public, and what write requests must carry.

All

The desktop app serves a plain HTTP API on port 8787 (falling back to 8788, then 8789). Only two endpoints are public; everything else requires the bearer token.

Endpoints

MethodPathAuthPurpose
POST/api/pairpublicExchange a 6-digit code for a token
GET/api/statuspublicStatus, host, default/active agent, session, agents
GET/api/protocol/statereadProtocol state snapshot
GET/api/agentsreadDetected agents with installed / active / version / workdir
POST/api/agents/defaultwriteSet the default agent
GET/api/agents/:id/modelsreadProviders, active and preferred model ids
POST/api/agents/:id/switchwriteSwitch the active agent
POST/api/agents/models/defaultwriteSet preferred model and provider
POST/api/messagewriteSubmit a task; may return pending_approval
GET/api/message/:idreadPoll a task's state and result
POST/api/session/startwriteStart a session
POST/api/session/stopwriteStop a session
POST/api/discovery/refreshwriteForce a fresh agent probe
GET, POST/api/approvals/moderead / writeRead or set the approval mode
GET/api/approvalsreadList pending approvals
POST/api/approvals/:idwriteapprove / deny / always_approve
GET, POST/api/conversationsread / writeList or create conversations
GET, PATCH, DELETE/api/conversations/:idread / writeRead, update or delete one conversation
POST/api/conversations/:id/activatewriteMake a conversation active
GET/api/folders/rootsreadRoot folders: home plus drive letters
GET/api/foldersreadBrowse a directory with pagination
POST/api/agents/workdirwriteSet or clear an agent's working directory

Authentication

  • POST /api/pair and GET /api/status are public.
  • Every other endpoint requires Authorization: Bearer <token>.
  • Write operations additionally require X-BrewPing-Timestamp (within ±120s) and a never-before-used X-BrewPing-Nonce.
  • GET requests skip the timestamp and nonce checks.
  • Unauthenticated requests to protected endpoints are rejected with 401.

Limits

  • Request bodies are capped at 8 MB; larger requests get 413.
  • Responses are sent with Connection: close.
  • Nonce memory holds at most 2048 values; when full, the oldest half is evicted.
  • Unknown paths return a plain not found response.
bash
# Public: read the status without a token
curl http://192.168.1.20:8787/api/status

# Authenticated read
curl http://192.168.1.20:8787/api/agents \
  -H 'Authorization: Bearer <token>'

# Authenticated write
curl -X POST http://192.168.1.20:8787/api/discovery/refresh \
  -H 'Authorization: Bearer <token>' \
  -H 'X-BrewPing-Timestamp: 1780000000' \
  -H 'X-BrewPing-Nonce: 9b21ff...'