Getting started
Endpoint overview
| Method | Path | Description |
|---|---|---|
POST | /sessions | Create and run a new session |
POST | /sessions/{id}/messages | Continue an existing session |
GET | /sessions/{id} | Fetch session metadata and usage |
GET | /sessions/{id}/events | SSE stream for real-time updates |
GET | /health | Liveness check |
GET | /capabilities | Runtime capabilities |
GET | /config | Read config |
PUT | /config | Replace config |
PATCH | /config | Merge-patch config (RFC 7396) |
Configuration
Server configuration details
Server configuration details
The REST server reads config from its instance data directory:API keys are provided via environment variables:
- macOS:
~/Library/Application Support/meerkat/rest/config.toml - Linux:
~/.local/share/meerkat/rest/config.toml - Windows:
%APPDATA%\meerkat\rest\config.toml
ANTHROPIC_API_KEYOPENAI_API_KEYGOOGLE_API_KEY
Endpoints
POST /sessions
Create and run a new session.Request fields
The user prompt to send to the agent.
Override the system prompt for this session.
Model name (e.g.
"claude-opus-4-6", "gpt-5.2").Provider:
"anthropic", "openai", "gemini", "other".Max tokens per turn.
JSON schema for structured output extraction (wrapper or raw schema).
Max retries for structured output validation.
Enable verbose event logging (server-side).
Run in host mode for inter-agent comms (requires
comms_name).Agent name for inter-agent communication.
Response fields
UUID of the created session.
The agent’s response text.
Number of LLM calls made.
Number of tool calls executed.
Token usage breakdown.
Input tokens consumed.
Output tokens generated.
Total tokens (input + output).
Cache creation tokens (provider-specific).
Cache read tokens (provider-specific).
Parsed structured output (when
output_schema was provided).Schema compatibility warnings per provider.
Structured output example
Structured output example
output_schema is provided, the text field contains the schema-only JSON
string produced by the extraction turn (no extra prose). The structured_output
field contains the parsed JSON value for convenience.output_schema may be provided as a wrapper object (shown above) or as a raw
JSON Schema object. The wrapper enables explicit compat/format settings.POST /sessions/{id}/messages
Continue an existing session.Request fields
Session ID (must match the path
{id}).Follow-up prompt.
Override the system prompt.
Model override for this turn.
Provider override for this turn.
Max tokens override for this turn.
Structured output schema for this turn.
Max retries for structured output validation.
Enable verbose event logging.
Enable host mode for this turn.
Agent name for comms.
Run-scoped hook overrides.
Response fields
Same shape asPOST /sessions.
GET /sessions/{id}
Fetch session metadata and usage.Response
GET /sessions/{id}/events
Server-Sent Events (SSE) stream for real-time updates. Event types:| Event | Description |
|---|---|
session_loaded | Emitted on connect with session metadata |
run_started | Turn execution began |
turn_started | New LLM call within the turn |
text_delta | Streaming text chunk from LLM |
tool_call_requested | LLM wants to call a tool |
tool_execution_started | Tool dispatch began |
tool_execution_completed | Tool returned a result |
turn_completed | LLM call finished |
run_completed | Turn execution finished successfully |
run_failed | Turn execution failed |
budget_warning | Approaching resource limits |
retrying | Retrying after transient error |
done | Emitted when the broadcast channel closes |
GET /health
Returns"ok" (HTTP 200). Use for liveness checks.
GET /capabilities
Returns runtime capabilities with status resolved against config.Response
GET /config
Returns the currentConfig object.
PUT /config
Sets the entire config. Body: fullConfig JSON.
PATCH /config
RFC 7396 merge patch on the config. Body: partial JSON.Error responses
All errors are returned as JSON with an HTTP status code:| HTTP Status | Code | When |
|---|---|---|
| 400 | BAD_REQUEST | Invalid parameters, session ID mismatch, host_mode without comms |
| 404 | NOT_FOUND | Session does not exist |
| 500 | CONFIGURATION_ERROR | Config store read/write failure |
| 500 | AGENT_ERROR | LLM provider error, tool dispatch failure, agent loop error |
| 500 | INTERNAL_ERROR | Store initialization failure, unexpected server error |
Notes
Host mode requires
host_mode: true and a comms_name. If host_mode is
requested but the binary was not compiled with comms support, the server
returns a BAD_REQUEST error.hooks_override allows per-request hook overrides including adding extra hook
entries and disabling specific hooks by ID. See Hooks for the
HookRunOverrides schema.