Hydra exposes a JSON-RPC 2.0 API over HTTP and real-time events via SSE.
Base URL: http://localhost:7777
All methods are called via POST /rpc with Content-Type: application/json.
Start a cognitive loop for a task.
Params:
{
"intent": "string (required) - What you want Hydra to do"
}Response:
{
"run_id": "uuid",
"status": "accepted"
}The run executes asynchronously. Monitor progress via SSE events.
Cancel a running task.
Params:
{
"run_id": "string (required)"
}Response:
{
"success": true
}Emergency kill switch. Cancels all active runs.
Params:
{
"level": "instant | graceful | freeze (default: graceful)",
"reason": "string (optional)"
}Response:
{
"success": true,
"level": "graceful",
"cancelled_runs": 3
}| Level | Behavior |
|---|---|
instant |
Stop everything immediately, no cleanup |
graceful |
Complete current phase, then stop |
freeze |
Pause all runs, resumable |
Respond to an approval request.
Params:
{
"approval_id": "string (required)",
"decision": "approved | denied (required)"
}Response:
{
"success": true
}Get status of runs.
Params (optional):
{
"run_id": "string (optional - omit for all runs)"
}Response:
{
"runs": [
{
"id": "uuid",
"intent": "string",
"status": "pending | running | completed | failed | cancelled",
"created_at": "ISO 8601",
"steps": [
{
"id": "uuid",
"description": "Perceiving intent",
"status": "pending | running | completed | failed | skipped"
}
]
}
]
}Health check.
Response:
{
"status": "ok",
"uptime_seconds": 3600,
"sisters": {
"memory": "not_connected",
"identity": "not_connected"
}
}| Code | Meaning |
|---|---|
-32700 |
Parse error (invalid JSON) |
-32600 |
Invalid request (missing jsonrpc/method) |
-32601 |
Method not found |
-32602 |
Invalid params |
-32603 |
Internal error |
Connect to GET /events for real-time streaming.
curl -N http://localhost:7777/eventsEmitted on connection.
{"version": "0.1.0"}A new run has been accepted.
{
"run_id": "uuid",
"intent": "string",
"estimated_steps": 5
}A cognitive phase has begun.
{
"run_id": "uuid",
"step_id": "uuid",
"phase": "perceive | think | decide | act | learn",
"description": "Perceiving intent"
}Phase progress update.
{
"run_id": "uuid",
"step_id": "uuid",
"progress": 0.5,
"phase": "think"
}A cognitive phase has finished.
{
"run_id": "uuid",
"step_id": "uuid",
"result": "success",
"phase": "perceive"
}User approval needed before proceeding.
{
"run_id": "uuid",
"approval_id": "uuid",
"action": "delete file",
"risk_score": 0.75,
"reason": "Destructive operation",
"expires_at": "ISO 8601"
}Run finished successfully.
{
"run_id": "uuid",
"status": "success",
"tokens_used": 1250
}Run failed.
{
"run_id": "uuid",
"error": "Error description"
}Sent every 30 seconds.
{"status": "alive"}Server is shutting down.
{"reason": "User requested shutdown"}| Method | Path | Purpose |
|---|---|---|
GET |
/health |
Simple health check (JSON) |
POST |
/rpc |
JSON-RPC 2.0 endpoint |
GET |
/events |
SSE event stream |