WebUI & Hermex iOS Compatibility Layer
Kerux includes a native REST and Server-Sent Events (SSE) API layer designed for web dashboards and native mobile clients, including the Hermex native iOS SwiftUI client.
Quickstart
Start the gateway with WebUI enabled via CLI:
kerux serve --webui --webui-port 8787
Or configure it in your kerux.toml:
[gateway]
webui_enabled = true
webui_addr = "0.0.0.0:8787"
# webui_password = "optional-secret"
Hermex iOS Setup
- Open Hermex on your iPhone or iPad.
- In Settings, set the Server URL to
http://<your-machine-ip>:8787. - If
webui_passwordis set, enter the password in the Password field. - Tap Connect. You can now chat with your Kerux agent, view live reasoning traces, inspect tool execution cards, and browse prior sessions.
API Reference
Health & Auth
-
GET /healthReturns server health, uptime, and active stream metrics.{ "status": "ok", "sessions": 4, "activeStreams": 0, "uptimeSeconds": 128.4 } -
GET /api/auth/statusReturns whether password protection is enabled and if the client is currently authorized. -
POST /api/auth/loginAuthenticates a client with a password body ({"password": "..."}).
Sessions
-
GET /api/sessionsLists all persistent chat sessions recorded by Kerux.{ "sessions": [ { "sessionId": "cli:default", "title": "Cli Default", "messageCount": 12, "estimatedTokens": 1420, "updatedAt": 1795412345 } ], "count": 1 } -
GET /api/session?id=<session_id>Fetches full session details including message history. -
POST /api/session/newCreates a new session ID with an optional title. -
POST /api/session/renameRenames a session:{"sessionId": "...", "title": "New Title"}. -
POST /api/session/deleteDeletes session history:{"sessionId": "..."}.
Chat & Streaming (SSE)
-
POST /api/chat/startStarts an agent turn for a given session.{ "sessionId": "cli:default", "message": "List recent commits in this repository." }Returns:
{ "streamId": "stream_1732360000_1a2b3c4d", "sessionId": "cli:default" } -
GET /api/chat/stream?stream_id=<stream_id>Opens a Server-Sent Events (SSE) stream (text/event-stream). Emits the following event types:token: Streaming assistant text tokens ({"text": "..."}).reasoning: Chain-of-thought or thinking text ({"text": "..."}).toolStarted: Emitted when the agent calls a tool ({"name": "...", "callId": "...", "arguments": "..."}).toolCompleted: Emitted when the tool finishes ({"name": "...", "callId": "...", "content": "...", "success": true}).metering: Token metrics and generation speed.done: Emitted when the agent finishes the turn ({"sessionId": "..."}).error: Emitted on runtime failure ({"message": "..."}).streamEnd: Terminal event indicating the stream is closing ({}).
-
GET /api/chat/cancel?stream_id=<stream_id>orPOST /api/chat/cancelCancels an in-flight agent run. -
POST /api/chat/steerAppends mid-turn steering instructions to the active agent run.
Settings & Models
-
GET /api/modelsReturns available configured models. -
GET /api/settingsReturns current gateway and runtime settings.