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#
/v1/jobsscope sandboxes:writeWith 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 bodynamerequiredstringprojectstringtemplatestringimagestringsnapshotstringsizestringtasksarray of objectsolverrequiredobjectsolver.cmdrequiredstring | array of stringsolver.timeout_srequiredintegersolver.envobject | array of stringgraderobjectgrader.cmdrequiredstring | array of stringgrader.filesobjectgrader.timeout_sinteger60. Min 1. Max 90.grader.envobject | array of stringconcurrencyintegerretries_on_infrainteger2. Min 0. Max 5.lease_sinteger900. Min 120. Max 86400.budget_usdnumberbenchmarkobjectbenchmark.namerequiredstringbenchmark.instancesarray of string | "all" | integerbenchmark.seedinteger0. Min 0.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#
/v1/jobsscope sandboxes:readstatusquery · "queued" | "running" | "done" | "failed" | "cancelled" | "budget_reached"projectquery · stringlimitquery · integercursorquery · stringcurl -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#
/v1/jobs/estimatescope sandboxes:readFrom 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 bodynamestringprojectstringtemplatestringimagestringsnapshotstringsizestringtasksarray of objectsolverobjectsolver.cmdrequiredstring | array of stringsolver.timeout_srequiredintegersolver.envobject | array of stringgraderobjectgrader.cmdrequiredstring | array of stringgrader.filesobjectgrader.timeout_sinteger60. Min 1. Max 90.grader.envobject | array of stringconcurrencyintegerretries_on_infrainteger2. Min 0. Max 5.lease_sinteger900. Min 120. Max 86400.budget_usdnumberbenchmarkobjectbenchmark.namerequiredstringbenchmark.instancesarray of string | "all" | integerbenchmark.seedinteger0. Min 0.task_countintegersampleintegersample_job_idstringcurl -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#
/v1/jobs/{id}scope sandboxes:readRollouts are in the job's run: GET /v1/rl/runs/{run_id}/rollouts, or …/export?format=jsonl.
Parametersidrequiredpath · stringcurl -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#
/v1/jobs/{id}/cancelscope sandboxes:writeRollouts already recorded stay in the run.
Parametersidrequiredpath · stringcurl -s -X POST https://api.kosa8.com/v1/jobs/$SBX/cancel \ -H "Authorization: Bearer $KOSA8_API_KEY"