kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

HTTP API / RL runs

RL runs

12 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.

Two to four runs side by side#

GET/v1/rl/comparescope sandboxes:read
Parameters
idsrequiredquery · string
2 to 4 run ids, comma-separated
Responses
200400401403404
curl -s -X GET https://api.kosa8.com/v1/rl/compare \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Alert rules on RL runs#

GET/v1/rl/alertsscope sandboxes:read

Kinds: infra_rate and oom_rate (threshold a share 0-1 of the last window rollouts, default 100), cost (threshold USD at list rate) and idle (threshold minutes without a rollout). The minute tick checks running runs and sends rl.alert to the organization's webhooks that subscribe to it, at most once an hour per rule. At most 50 rules an organization.

Parameters
run_idquery · string
This run's rules and the organization-wide ones
Responses
200400401403
curl -s -X GET https://api.kosa8.com/v1/rl/alerts \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Add an alert rule#

POST/v1/rl/alertsscope sandboxes:write

Kinds: infra_rate and oom_rate (threshold a share 0-1 of the last window rollouts, default 100), cost (threshold USD at list rate) and idle (threshold minutes without a rollout). The minute tick checks running runs and sends rl.alert to the organization's webhooks that subscribe to it, at most once an hour per rule. At most 50 rules an organization.

JSON body
run_idstring | null
—
kindrequired"infra_rate" | "oom_rate" | "cost" | "idle"
—
thresholdrequirednumber
—
windowinteger
—
Responses
201400401403404409
curl -s -X POST https://api.kosa8.com/v1/rl/alerts \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Change, pause or resume an alert rule#

PATCH/v1/rl/alerts/{id}scope sandboxes:write
Parameters
idrequiredpath · string
Alert rule id (rla_…)
JSON body
thresholdnumber
—
windowinteger
—
enabledboolean
—
Responses
200400401403404
curl -s -X PATCH https://api.kosa8.com/v1/rl/alerts/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Delete an alert rule#

DELETE/v1/rl/alerts/{id}scope sandboxes:write
Parameters
idrequiredpath · string
Alert rule id (rla_…)
Responses
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/rl/alerts/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Start an RL run#

POST/v1/rl/runsscope sandboxes:write

Label the run's sandboxes kosa8.run=<id> (run_id on POST /v1/sandboxes/batch and /fork does it) so the run's page counts their sandbox-hours and cost, and drain can find them.

JSON body
namerequiredstring
Max length 128.
projectstring
Max length 64.
configobject
Anything, at most 16 KiB as JSON
Responses
201400401403
curl -s -X POST https://api.kosa8.com/v1/rl/runs \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

The organization's runs, newest first, with a short summary#

GET/v1/rl/runsscope sandboxes:read
Parameters
projectquery · string
Only this project
statusquery · "running" | "finished" | "failed"
Only this status
namequery · string
Only runs with this exact name (to attach to one)
limitquery · integer
Default 50
cursorquery · string
next_cursor of the page before
Responses
200400401403
curl -s -X GET https://api.kosa8.com/v1/rl/runs \
  -H "Authorization: Bearer $KOSA8_API_KEY"

A run with its summary and recommended actions#

GET/v1/rl/runs/{id}scope sandboxes:read

Cost is at list rates for sandboxes labelled kosa8.run=<id> (cost_basis: list_rate); on a plan the usage is included up to the plan's sandbox-hours. Recommendations appear only when the run's numbers support them.

Parameters
idrequiredpath · string
Run id (run_…)
Responses
200401403404
curl -s -X GET https://api.kosa8.com/v1/rl/runs/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Rename a run or set its status#

PATCH/v1/rl/runs/{id}scope sandboxes:write

Finishing a run does not delete its sandboxes: drain them with POST /v1/sandboxes/drain {run_id}.

Parameters
idrequiredpath · string
Run id (run_…)
JSON body
status"running" | "finished" | "failed"
—
namestring
Max length 128.
Responses
200400401403404
curl -s -X PATCH https://api.kosa8.com/v1/rl/runs/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Record rollouts#

POST/v1/rl/runs/{id}/rolloutsscope sandboxes:write

At most 500 a call and 4 MiB a body; all or none are stored. The sealed grader records its own (source grade) when given run_id.

Parameters
idrequiredpath · string
Run id (run_…)
JSON body
rolloutsrequiredarray of object
—
Responses
200400401403404413
curl -s -X POST https://api.kosa8.com/v1/rl/runs/$SBX/rollouts \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

A run's rollouts, newest first, filtered#

GET/v1/rl/runs/{id}/rolloutsscope sandboxes:read
Parameters
idrequiredpath · string
Run id (run_…)
stepquery · integer
Only this step
failure_classquery · "ok" | "exit_nonzero" | "timeout" | "oom" | "infra" | "quota" | "client"
Only this class
min_rewardquery · number
reward >= this
max_rewardquery · number
reward <= this
sandbox_idquery · string
Only this sandbox's rollouts
idquery · string
Only this rollout (ro_…)
limitquery · integer
Default 100
cursorquery · string
next_cursor of the page before
Responses
200400401403404
curl -s -X GET https://api.kosa8.com/v1/rl/runs/$SBX/rollouts \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Every rollout of a run as JSONL, oldest first#

GET/v1/rl/runs/{id}/exportscope sandboxes:read
Parameters
idrequiredpath · string
Run id (run_…)
formatquery · "jsonl"
jsonl (the default)
Responses
200400401403404
curl -s -X GET https://api.kosa8.com/v1/rl/runs/$SBX/export \
  -H "Authorization: Bearer $KOSA8_API_KEY"

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · AI Agent Sandbox: Secure and Sovereign for Enterprise · Local models served by llamay · Agent gateway: MAQPNA