Meerkat ships a REST server for running and managing agent sessions over HTTP. This is the best fit if you want a simple, language-agnostic API for the Meerkat core.Documentation Index
Fetch the complete documentation index at: https://docs.rkat.ai/llms.txt
Use this file to discover all available pages before exploring further.
Getting started
Runtime scope
rkat-rest accepts:
--realm <id>--isolated--instance <id>--realm-backend <sqlite|jsonl>--state-root <path>--context-root <path>--user-config-root <path>--expose-paths
--realm is omitted, the server creates a new isolated opaque realm (realm-...).
--realm-backend is a creation hint only; after first open, realm_manifest.json
is authoritative.
Endpoint overview
This overview follows the generated OpenAPI artifact atartifacts/schemas/rest-openapi.json.
| Method | Path | Description |
|---|---|---|
POST | /help | Ask Meerkat usage help with the embedded platform skill |
POST | /sessions | Create and run a new session |
GET | /sessions | List sessions |
GET | /sessions/{id} | Fetch session metadata and usage |
GET | /sessions/{id}/status | Fetch current runtime state for a session |
GET | /sessions/{id}/history | Fetch committed session transcript messages |
POST | /sessions/{id}/system_context | Append staged runtime system context |
POST | /sessions/{id}/messages | Continue an existing session |
POST | /sessions/{id}/external-events | Queue a runtime-backed external event |
POST | /sessions/{id}/peer-response-terminal | Queue a typed peer terminal response event |
POST | /sessions/{id}/interrupt | Interrupt an in-flight turn |
DELETE | /sessions/{id} | Archive (remove) a session |
GET | /sessions/{id}/events | SSE stream for real-time updates |
GET | /schedule/tools | List schedule tool definitions |
POST | /schedule/call | Call a schedule tool directly |
POST | /schedules | Create a schedule |
GET | /schedules | List schedules |
GET | /schedules/{id} | Fetch one schedule |
PATCH | /schedules/{id} | Update a schedule |
DELETE | /schedules/{id} | Delete a schedule |
POST | /schedules/{id}/pause | Pause a schedule |
POST | /schedules/{id}/resume | Resume a schedule |
GET | /schedules/{id}/occurrences | List schedule occurrences |
GET | /workgraph/items | List WorkGraph items |
GET | /workgraph/items/{id} | Fetch one WorkGraph item |
GET | /workgraph/ready | List ready WorkGraph items |
GET | /workgraph/snapshot | Read a WorkGraph observability snapshot |
GET | /workgraph/events | Read WorkGraph event history |
POST | /sessions/{id}/mcp/add | Stage live MCP server addition (mcp feature) |
POST | /sessions/{id}/mcp/remove | Stage live MCP server removal (mcp feature) |
POST | /sessions/{id}/mcp/reload | Reload MCP server(s) (mcp feature) |
POST | /comms/send | Push comms message into a session (comms feature) |
GET | /comms/peers | List discoverable peers (comms feature) |
GET | /auth/profiles | List realm auth profiles, backend profiles, and bindings |
POST | /auth/profiles | Store binding-scoped credentials |
GET | /auth/bindings/{binding_id} | Read a binding-scoped auth profile |
DELETE | /auth/bindings/{binding_id} | Delete binding-scoped credentials |
POST | /auth/bindings/{binding_id}/test | Test a binding resolve path |
POST | /auth/login/start | Start interactive auth login |
POST | /auth/login/complete | Complete interactive auth login |
POST | /auth/login/device/start | Start device-code login |
POST | /auth/login/device/complete | Complete device-code login |
GET | /auth/bindings/{binding_id}/status | Read binding auth status |
POST | /auth/bindings/{binding_id}/logout | Log out a binding |
GET | /realms | List configured realms |
GET | /realms/{id} | Read one realm |
GET | /mob/{id}/events | Mob event SSE stream (mob feature) |
POST | /mob/{id}/spawn-helper | Spawn a helper into a mob (mob feature) |
POST | /mob/{id}/fork-helper | Fork a helper from an existing member (mob feature) |
POST | /mob/{id}/wait-kickoff | Wait for kickoff completion (mob feature) |
GET | /mob/{id}/members/{agent_identity}/status | Read member status (mob feature) |
POST | /mob/{id}/members/{agent_identity}/cancel | Force-cancel a member (mob feature) |
POST | /mob/{id}/members/{agent_identity}/respawn | Respawn a member (mob feature) |
GET | /skills | List skills with provenance |
GET | /health | Liveness check |
GET | /runtime/host_info | Read runtime host identity, endpoints, and realm projection |
GET | /runtime/capabilities | Read runtime host capability flags |
GET | /runtime/health | Read runtime host health |
GET | /models/catalog | Curated model catalog with provider profiles |
GET | /capabilities | Runtime capabilities |
GET | /config | Read config |
PUT | /config | Replace config |
PATCH | /config | Merge-patch config (RFC 7396) |
POST | /requests/{request_id}/cancel | Cancel an uncommitted in-flight request |
Generated images are not returned as inline bytes in history.
GET /sessions/{id}/history returns assistant image blocks with image_id, blob_ref, dimensions, and metadata; fetch image bytes through the blob/artifact surface exposed by the runtime-backed RPC/SDK path.REST keeps observation and helper endpoints for mobs, but typed lifecycle/control
for app hosts lives on the canonical RPC/SDK
mob/* surface. Inside running
sessions, mob capability is still exposed by composing meerkat-mob-mcp
(MobMcpState + AgentMobToolSurfaceFactory) into
SessionBuildOptions.mob_tools in the host runtime. external_tools remains
reserved for callback and MCP-backed dispatchers.WorkGraph REST endpoints are read-only observability/operator lookup. Agents
create, claim, update, link, evidence, and close WorkGraph items through
WorkGraph tools inside sessions.
Request cancellation
REST request cancellation is opt-in and request-ID based.- send
X-Meerkat-Request-Id: <id>onPOST /sessionsorPOST /sessions/{id}/messages - call
POST /requests/{request_id}/cancelto cancel uncommitted in-flight work - duplicate in-flight request IDs are rejected
- pre-start / pre-commit work may return cancelled
- committed success is not rewritten to cancellation
- post-commit create failures still return session identity and remain resumable
Configuration
Server configuration details
Server configuration details
REST configuration is realm-scoped:API keys are provided via environment variables:
- macOS:
~/Library/Application Support/meerkat/realms/<realm>/config.toml - Linux:
~/.local/share/meerkat/realms/<realm>/config.toml - Windows:
%APPDATA%\\meerkat\\realms\\<realm>\\config.toml
realm_manifest.json (backend pinning) and config_state.json (generation CAS state).Key sections:ANTHROPIC_API_KEYOPENAI_API_KEYGOOGLE_API_KEY
Endpoints
POST /help
Ask Meerkat usage help with the embedded platform skill.Request
HelpResponse with the answer text and any plan metadata requested by the input.
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.5").Provider:
"anthropic", "openai", "gemini", "self_hosted", "other".Max tokens per turn.
JSON schema for structured output extraction (wrapper or raw schema).
Max retries for structured output validation.
null/omitted uses the server default on create and inherits the persisted session value on continue.Enable verbose event logging (server-side).
Keep session alive after turn for comms. On create,
null/omitted uses the create default (false), true enables, and false explicitly disables. Requires comms_name when enabled.Agent name for inter-agent communication.
Friendly metadata for peer discovery (name, description, labels).
GET /sessions//history
Read committed transcript history for a session without changing the lightweight metadata shape ofGET /sessions/{id}.
Query parameters:
offset— skip this many messages from the start of the transcriptlimit— cap the number of returned messages
Enable built-in tools (task management, etc.). Omit to use factory defaults.
Enable shell tool (requires
enable_builtins). Omit to use factory defaults.Enable semantic memory. Omit to use factory defaults.
Override schedule tools for this session. Omit to use factory defaults.
Override WorkGraph tools for this session. Omit to use factory defaults.
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 remains the committed
main-turn assistant output. The extraction turn runs afterward and populates
structured_output on success or extraction_error on failure.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.GET /sessions
List sessions. Supports optional label filters via query parameters.Response
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. On materialized sessions this hot-swaps the LLM client for the remainder of the session.
Provider override for this turn. Typically inferred from
model. Used with model for mid-session provider switching.Max tokens override for this turn.
Structured output schema for this turn.
Max retries for structured output validation. Omit /
null to inherit the persisted session value on continue.Enable verbose event logging.
Keep-alive override for this turn.
null = inherit persisted session intent, true = enable, false = disable.Agent name for comms.
Run-scoped hook overrides.
Response fields
Same shape asPOST /sessions.
POST /sessions/{id}/interrupt
Interrupt an in-flight turn. No-op if the session is idle.Response
POST /requests/{request_id}/cancel
Cancel an uncommitted in-flight request that previously suppliedX-Meerkat-Request-Id.
Response
200 with {"cancelled": false, "reason": "already_terminal"} when
the tracked request already published or completed. Returns 404 only when the
request ID is unknown.
DELETE /sessions/{id}
Archive (remove) a session.Response
404 if the session is not found.
POST /sessions/{id}/external-events
Queue an external event through the runtime-backed admission path.This route keeps the optional
RKAT_WEBHOOK_SECRET header auth used for webhook
delivery, but the admitted event now flows through runtime input acceptance
instead of a surface-local injector path.Any JSON payload. Pretty-printed and injected as an event into the agent’s inbox.
Webhook secret for authentication. Required when
RKAT_WEBHOOK_SECRET env var is set on the server. Compared using constant-time equality (subtle::ConstantTimeEq).| HTTP Status | When |
|---|---|
| 202 | Event queued successfully |
| 404 | Session not found |
| 401 | Missing or invalid webhook secret |
| 503 | Event inbox is full |
POST /sessions/{id}/peer-response-terminal
Admit a terminal peer response through the typed runtime ingress.Canonical peer routing ID. Display names are not accepted as routing identity.
Optional presentation label.
Peer correlation ID for the request this terminal response completes.
Terminal response status:
"completed", "failed", or "cancelled".Peer-returned terminal payload.
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 | Agent execution began |
run_completed | Agent run finished |
run_failed | Agent run failed |
turn_started | New LLM call within the turn |
text_delta | Streaming text chunk from LLM |
text_complete | Full text for this turn |
tool_call_requested | LLM wants to call a tool |
tool_result_received | Tool result processed |
turn_completed | LLM call finished |
tool_execution_started | Tool dispatch began |
tool_execution_completed | Tool returned a result |
tool_execution_timed_out | Tool exceeded timeout |
compaction_started | Context compaction began |
compaction_completed | Compaction finished |
compaction_failed | Compaction failed |
budget_warning | Approaching resource limits |
retrying | Retrying after transient error |
hook_started | Hook execution began |
hook_completed | Hook finished |
hook_failed | Hook execution failed |
hook_denied | Hook blocked operation |
skills_resolved | Skills loaded for turn |
skill_resolution_failed | Skill resolution failed |
done | Emitted when the broadcast channel closes |
GET /skills
List all skills with provenance information. Returns active and shadowed entries.Response
404 if skills are not enabled.
GET /health
Returns"ok" (HTTP 200). Use for liveness checks.
GET /models/catalog
Return the curated model catalog with provider profiles, capability metadata, and parameter schemas.Response (abbreviated)
GET /capabilities
Returns runtime capabilities with status resolved against config.Response (abbreviated)
sessions, streaming, structured_output, hooks, builtins, shell, comms, memory_store, schedule, work_graph, session_store, session_compaction, skills, mcp_live. See the RPC capabilities endpoint for the complete example.
GET /config
Returns a realm config envelope:configgenerationrealm_idinstance_idbackendresolved_paths
PUT /config
Replaces config. Accepted request forms:- Direct config object (compat)
- Wrapped form with CAS:
{ "config": <Config>, "expected_generation": <u64|null> }
PATCH /config
Applies RFC 7396 merge patch. Accepted request forms:- Direct patch object (compat)
- Wrapped form with CAS:
{ "patch": <JSON>, "expected_generation": <u64|null> }
expected_generation is stale, the server returns 400 with a generation-conflict message.
GET /auth/profiles
List the auth profiles, backend profiles, and provider bindings for a realm.Realm to read.
Optional profile selector accepted by the shared auth query shape.
Response
POST /auth/profiles
Store credentials for an existing binding-scoped auth profile. The binding must resolve to an auth profile whose source ismanaged_store; inline, env,
external resolver, platform-default, command, and file-descriptor sources are
configured outside this endpoint.
Request
Response (201 Created)
Realm containing the binding.
Binding whose configured auth profile will receive the stored credential.
Optional explicit profile override for the binding.
Provider expected from the resolved auth profile.
Stored-secret method:
"api_key" or "static_bearer".Secret material to persist in the token store.
GET /auth/bindings/{binding_id}
Read the auth profile resolved by a binding.Binding to resolve.
Realm containing the binding.
Optional explicit profile override for the binding.
DELETE /auth/bindings/{binding_id}
Clear stored credentials for the resolved binding-scoped auth profile.Binding whose stored credentials should be cleared.
Realm containing the binding.
Optional explicit profile override for the binding.
POST /auth/bindings/{binding_id}/test
Resolve a binding through the provider registry and report whether credential material or a dynamic authorizer is available.Request
Binding to test.
Realm containing the binding.
Optional explicit profile override for the binding.
POST /auth/login/start
Begin a loopback OAuth login. The server owns the OAuth state and PKCE verifier.Request
POST /auth/login/complete
Complete a loopback OAuth login and store the resulting tokens under an explicit binding-scopedAuthBindingRef.
Request
Realm containing the binding.
Binding that owns the stored OAuth tokens.
Optional explicit profile override for the binding.
POST /auth/login/device/start
Begin a device-code OAuth login.Request
POST /auth/login/device/complete
Poll one device-code OAuth completion attempt and, when ready, store the tokens under an explicit binding-scopedAuthBindingRef.
Request
202 with { "state": "pending" } when the provider has not finished,
429 with { "state": "slow_down" } when the caller should back off, and 200
with a ready payload after tokens are persisted.
GET /auth/bindings/{binding_id}/status
Read binding-scoped auth status. The response includes the flattened binding identity plusprofile_id, provider, auth_method, public state,
expiration, refresh timestamp, account ID, and refresh-token presence.
Binding whose status should be read.
Realm containing the binding.
Optional explicit profile override for the binding.
POST /auth/bindings/{binding_id}/logout
Clear stored credentials for the binding and publish the auth lifecycle release.Binding to log out.
Realm containing the binding.
Optional explicit profile override for the binding.
GET /realms
List configured realm summaries.GET /realms/{id}
Read one realm connection set.POST /comms/send
Push a canonical comms command into a running session. Requires thecomms feature.
Session ID to dispatch the comms command to.
Command kind:
"input", "peer_message", "peer_lifecycle", "peer_request", or "peer_response".Peer name to send to (required for
peer_message, peer_lifecycle, peer_request, and peer_response).Message body (required for
input and peer_message).Handling mode for
input, peer_message, peer_request, and peer_response. Local callers must provide "queue" or "steer".peer_message is the default collaboration primitive. peer_lifecycle is a one-way topology notification. peer_request is only a structured ask with correlated replies.Lifecycle event kind:
"mob.peer_added", "mob.peer_retired", or "mob.peer_unwired" (required for peer_lifecycle).Request intent (required for
peer_request, e.g. "review", "delegate").Request parameters (optional for
peer_request).ID of the request being responded to (required for
peer_response).Response status:
"accepted", "completed", or "failed" (for peer_response).Response result data (optional for
peer_response).Optional source label.
Optional input stream mode:
"none" or "reserve_interaction" (for input and peer_request).Allow the session to send a message to itself (default: false).
Unlike
POST /sessions/{id}/external-events (which uses RKAT_WEBHOOK_SECRET
header auth), /comms/send has no authentication. It is intended for
trusted internal callers that already know the session ID.GET /comms/peers
List discoverable peers for a session. Requires thecomms feature.
Session ID to query peers for.
Response
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, keep_alive without comms |
| 403 | HOOK_DENIED | Hook blocked the operation |
| 404 | SESSION_NOT_FOUND | Session does not exist |
| 404 | SKILL_NOT_FOUND | Requested skill does not exist |
| 409 | SESSION_BUSY | Turn already in progress |
| 409 | SESSION_NOT_RUNNING | Session not in running state |
| 422 | SKILL_RESOLUTION_FAILED | Skill resolution error |
| 429 | BUDGET_EXHAUSTED | Resource limits reached |
| 500 | AGENT_ERROR | LLM provider error, tool dispatch failure, agent loop error |
| 500 | INTERNAL_ERROR | Store initialization failure, unexpected server error |
| 501 | CAPABILITY_UNAVAILABLE | Required capability not compiled in or disabled |
| 502 | PROVIDER_ERROR | LLM provider issue (missing key, auth failure) |
Notes
Keep-alive mode requires
keep_alive: true and a comms_name. If keep_alive is
requested but the binary was not compiled with comms support, the server
returns a BAD_REQUEST error.POST /sessions/{id}/external-events queues a runtime-backed external event. It is a queue-only admission path, not a second direct execution loop.hooks_override allows per-request hook overrides including adding extra hook
entries and disabling specific hooks by ID. See Hooks for the
HookRunOverrides schema.