Skip to content

The Agent RSI & Self-Tuning API powers two related self-improvement subsystems that run as background jobs with Server-Sent Events (SSE) progress streaming. Use these endpoints to start RSI (Recursive Self-Improvement) review passes and self-tuning runs against a session, then subscribe to the returned job’s stream endpoint for live progress events.

The RSI subsystem runs a “Reviewer-Selected-Improvement” pass over a session transcript. Each configured reviewer model reads the transcript and emits findings. Start a review to receive a jobID, then stream that job for progress.

POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/rsi/review

Fan out a Reviewer-Selected-Improvement pass: each configured reviewer model reads the session transcript and emits findings. Returns a queued jobID; subscribe to /rsi/runs/{jobID}/stream for progress and final output.

NameInTypeRequiredDescription
workspaceIDpathstringYesWorkspace identifier.
sessionIDpathstringYesSession identifier.
FieldTypeRequiredDescription
focusstringNoOptional focus instructions appended to each reviewer prompt. Max 10K chars.
reviewersarrayNoReviewers to run for this call. Each entry is either a string (filter by name into config) or an inline object that overrides config fields per-call. Omit to use all configured reviewers. Max 20 entries.

When reviewers entries are inline objects, each accepts name (required, 1-64 chars), model (optional, providerID/modelID format), fallbacks (optional, up to 5 fallback models tried in order), and prompt (optional, overrides the configured prompt for this call only).

Terminal window
curl -X POST "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/rsi/review" \
-H "Authorization: Bearer $HOODY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"focus": "Focus on tool-call efficiency and final-answer correctness.",
"reviewers": [
"accuracy",
{ "name": "clarity", "prompt": "Be terse; max 200 words per finding." }
]
}'

GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/rsi/runs/{jobID}/stream

Server-sent-events stream of progress events for an RSI review job. Emits a snapshot first (so late subscribers see current state), then live events; if the job is already terminal, emits the completion event and closes.

NameInTypeRequiredDescription
workspaceIDpathstringYesWorkspace identifier.
sessionIDpathstringYesSession identifier.
jobIDpathstringYesJob identifier returned from the start endpoint.
Terminal window
curl -N "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/rsi/runs/rsi_01HQZ9X7K4G3D7M5B6V2R8NJTQ/stream" \
-H "Authorization: Bearer $HOODY_API_KEY" \
-H "Accept: text/event-stream"

The self-tuning subsystem runs verifier-driven improvement loops on a session. Two modes are available:

  • tune — single iterative loop, capped at 20 iterations.
  • amplify — best-of-N loop with majority voting (N must be odd, max 11).

Both return a jobID; stream that job’s progress via /self-tuning/runs/{jobID}/stream.

POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/tune

Run a single-iteration self-tuning loop against the session’s verifier. Returns a queued jobID; subscribe to /self-tuning/runs/{jobID}/stream for progress and final output.

NameInTypeRequiredDescription
workspaceIDpathstringYesWorkspace identifier.
sessionIDpathstringYesSession identifier.
FieldTypeRequiredDescription
taskstringYesThe task / goal description for the tune run. Max 100K chars.
verifier_namestringYesName of a configured verifier program. Max 128 chars.
max_iterationsintegerNoCap on iteration count (1-20).
modelobjectNoOverride the worker LLM for this call only. Requires providerID and modelID; both must already be configured or registered via PATCH /config beforehand.
Terminal window
curl -X POST "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/self-tuning/tune" \
-H "Authorization: Bearer $HOODY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task": "Reduce average tool-call latency below 1.2s while preserving task success rate.",
"verifier_name": "perf_v1",
"max_iterations": 8,
"model": { "providerID": "openai", "modelID": "gpt-4o-mini" }
}'

POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/amplify

Run a best-of-N amplify loop against the session’s verifier (N must be odd, max 11, for majority voting). Returns a queued jobID; subscribe to /self-tuning/runs/{jobID}/stream for progress.

NameInTypeRequiredDescription
workspaceIDpathstringYesWorkspace identifier.
sessionIDpathstringYesSession identifier.
FieldTypeRequiredDescription
taskstringYesThe task / goal description for the amplify run. Max 100K chars.
verifier_namestringYesName of a configured verifier program. Max 128 chars.
nintegerYesNumber of trials (odd, max 11) for majority voting.
modelobjectNoOverride the worker LLM for this call only. Requires providerID and modelID; both must already be configured or registered via PATCH /config beforehand.
Terminal window
curl -X POST "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/self-tuning/amplify" \
-H "Authorization: Bearer $HOODY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task": "Generate a SQL query that lists the top 10 customers by lifetime spend.",
"verifier_name": "sql_v1",
"n": 5,
"model": { "providerID": "anthropic", "modelID": "claude-3-5-sonnet" }
}'

GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/runs/{jobID}/stream

Server-sent-events stream of progress events for a self-tuning tune or amplify job. Emits a snapshot first (so late subscribers see current state), then live events; if the job is already terminal, emits the completion event and closes.

NameInTypeRequiredDescription
workspaceIDpathstringYesWorkspace identifier.
sessionIDpathstringYesSession identifier.
jobIDpathstringYesJob identifier returned from the tune or amplify start endpoint.
Terminal window
curl -N "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/self-tuning/runs/tune_01HQZA3K8N5F2P4Q7M9B6V3WYX/stream" \
-H "Authorization: Bearer $HOODY_API_KEY" \
-H "Accept: text/event-stream"