HTTP API
The daemon exposes a RESTful HTTP API on 127.0.0.1:9999 using the v3 protocol. All endpoints except /v3/health require Bearer token authentication.
Authentication
Include the daemon token in the Authorization header on every request:
The token is read from ~/.config/opta/daemon/state.json. If the token is missing or incorrect, the daemon returns 401 Unauthorized.
Health & Metrics
Sessions
Create Session
Get Session
Submit Turn
Poll Events
Cancel Session
Permissions
Operations
Operations are pre-defined daemon commands (model management, config changes, diagnostics) that can be triggered via the API without creating a chat session.
List Operations
Execute Operation
Error Format
All error responses follow a consistent JSON format:
Common error codes:
UNAUTHORIZED— Missing or invalid Bearer token (401)SESSION_NOT_FOUND— Session ID does not exist (404)TURN_IN_PROGRESS— Cannot submit a new turn while one is active (409)LMX_UNREACHABLE— Cannot connect to the LMX inference server (502)INTERNAL_ERROR— Unexpected daemon error (500)