Base URL
The default server runs on:Endpoints
GET /models
List available models and default model
POST /chat
Stream chat completions with tool execution
POST /chat/relay/:relayId
Resolve permission requests for tool execution
Architecture
EachPOST /chat request creates a fresh AgentOrchestrator for that session. Server-Sent Events flow from the orchestrator until the stream closes or an error occurs. The orchestrator is automatically cleaned up when the connection ends.
Event Streaming
All streaming endpoints use Server-Sent Events (SSE) with the following format:Common Event Types
connected- Initial connection established with session IDharness_start- Agent harness begins processingtext- Text content from the AIreasoning- Internal reasoning steps (if supported by model)tool_call- Agent is calling a tooltool_result- Result from tool executionrelay- Permission request for tool executionusage- Token usage informationharness_end- Agent harness completed processingerror- Error occurred during processing
Authentication
The HTTP API currently does not require authentication. Configure your deployment environment to add authentication layers as needed.Error Handling
All endpoints return standard HTTP status codes:200- Success400- Bad Request (invalid JSON or missing required fields)404- Not Found (session or relay not found)500- Internal Server Error
Starting the Server
PORT- Server port (default: 4000)DEFAULT_MODEL- Default model when not specified in requests
