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

HTTP API / Jobs

Jobs

5 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.

Run tasks with a solver and a sealed grader, server-side, into an RL run#

POST/v1/jobsscope sandboxes:write

With benchmark, leave out template, image, snapshot, size, tasks and grader: each instance runs in its ready-made environment and is graded by the benchmark's own grader (SWE-bench: the harness's eval script and log parser, reward 1 when resolved; Terminal-Bench: the task's tests/test.sh), sealed, in the background. solver is {cmd, timeout_s?, env?, files?} (timeout_s defaults to the instance's agent time), {patches: {instance id: diff}} (SWE-bench predictions) or {oracle: true} (the reference solutions). Each task gets its own sandbox, its input and files, then the solver in the background; the sealed grader scores it in a copy with no network. Infra failures are retried up to retries_on_infra, then recorded masked. Send an Idempotency-Key header to make a retried submit safe. tasks_url answers 501 until organization storage exists.

JSON body
namerequiredstring
Max length 128.
projectstring
Max length 64.
templatestring
—
imagestring
—
snapshotstring
Exactly one of template, image or snapshot
sizestring
A Cloud size, e.g. 2x4
tasksarray of object
—
solverrequiredobject
—
solver.cmdrequiredstring | array of string
—
solver.timeout_srequiredinteger
Runs as a background command, polled, so it may run for hours Min 1. Max 86400.
solver.envobject | array of string
{NAME: value} or ["NAME=value"]; KOSA8_ names are the job's
graderobject
—
grader.cmdrequiredstring | array of string
—
grader.filesobject
Hidden files: written only into the sealed copy (no network) the grader runs in; at most 1 MiB
grader.timeout_sinteger
Default 60. Min 1. Max 90.
grader.envobject | array of string
{NAME: value} or ["NAME=value"]; KOSA8_ names are the job's
concurrencyinteger
Tasks in flight at once; at most the organization's running limit less one, kept for a sealed grader's copy (default 16, or that if lower) Min 1.
retries_on_infrainteger
Default 2. Min 0. Max 5.
lease_sinteger
Each task sandbox's lease; the job's driver moves it on while it runs Default 900. Min 120. Max 86400.
budget_usdnumber
Stop with status budget_reached once the job's list cost reaches this
benchmarkobject
—
benchmark.namerequiredstring
A benchmark from GET /v1/benchmarks, e.g. swe-bench-verified or terminal-bench-2.1
benchmark.instancesarray of string | "all" | integer
Instance ids, "all", or n: a seeded sample of n
benchmark.seedinteger
Default 0. Min 0.
Responses
202400401402403413501
curl -s -X POST https://api.kosa8.com/v1/jobs \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

The organization's jobs, newest first#

GET/v1/jobsscope sandboxes:read
Parameters
statusquery · "queued" | "running" | "done" | "failed" | "cancelled" | "budget_reached"
Only this status
projectquery · string
Only this project
limitquery · integer
Default 50
cursorquery · string
next_cursor of the page before
Responses
200400401403
curl -s -X GET https://api.kosa8.com/v1/jobs \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Estimate a job's sandbox-hours and list cost, as a range#

POST/v1/jobs/estimatescope sandboxes:read

From the timeout: tasks × (30 s + a quarter of solver.timeout_s) to tasks × (30 s + solver.timeout_s + grader.timeout_s). From a sample: tasks × p50 to tasks × p90. Sandbox-hours by the size's standard_hours_per_hour (plan_limits.json); dollars at list rates.

JSON body
namestring
Max length 128.
projectstring
Max length 64.
templatestring
—
imagestring
—
snapshotstring
Exactly one of template, image or snapshot
sizestring
A Cloud size, e.g. 2x4
tasksarray of object
—
solverobject
—
solver.cmdrequiredstring | array of string
—
solver.timeout_srequiredinteger
Runs as a background command, polled, so it may run for hours Min 1. Max 86400.
solver.envobject | array of string
{NAME: value} or ["NAME=value"]; KOSA8_ names are the job's
graderobject
—
grader.cmdrequiredstring | array of string
—
grader.filesobject
Hidden files: written only into the sealed copy (no network) the grader runs in; at most 1 MiB
grader.timeout_sinteger
Default 60. Min 1. Max 90.
grader.envobject | array of string
{NAME: value} or ["NAME=value"]; KOSA8_ names are the job's
concurrencyinteger
Tasks in flight at once; at most the organization's running limit less one, kept for a sealed grader's copy (default 16, or that if lower) Min 1.
retries_on_infrainteger
Default 2. Min 0. Max 5.
lease_sinteger
Each task sandbox's lease; the job's driver moves it on while it runs Default 900. Min 120. Max 86400.
budget_usdnumber
Stop with status budget_reached once the job's list cost reaches this
benchmarkobject
—
benchmark.namerequiredstring
A benchmark from GET /v1/benchmarks, e.g. swe-bench-verified or terminal-bench-2.1
benchmark.instancesarray of string | "all" | integer
Instance ids, "all", or n: a seeded sample of n
benchmark.seedinteger
Default 0. Min 0.
task_countinteger
Instead of tasks Min 1. Max 10000.
sampleinteger
Run the first n tasks for real (a pilot job, 202; needs sandboxes:write); estimate again with sample_job_id once it has rollouts Min 1. Max 50.
sample_job_idstring
Estimate from this job's measured p50 and p90 rollout time
Responses
200400401403404
curl -s -X POST https://api.kosa8.com/v1/jobs/estimate \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

A job: status, counts by state and failure class, progress, cost so far and ETA#

GET/v1/jobs/{id}scope sandboxes:read

Rollouts are in the job's run: GET /v1/rl/runs/{run_id}/rollouts, or …/export?format=jsonl.

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

Cancel a job: no new rollouts, its sandboxes drained#

POST/v1/jobs/{id}/cancelscope sandboxes:write

Rollouts already recorded stay in the run.

Parameters
idrequiredpath · string
Job id (job_…)
Responses
200401403404
curl -s -X POST https://api.kosa8.com/v1/jobs/$SBX/cancel \
  -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