Skip to content

Docs · API reference

API reference

Every action in the console is one of these endpoints. JSON over HTTPS, bearer keys, and the same IDs you see on screen.

Conventions

  • Base URL https://api.kalworks.dev/v1
  • Auth Authorization: Bearer kw_live_…, scoped per key.
  • Idempotency required on every POST. Repeating a key returns the original result.
  • Request ID on every response in x-request-id. Include it when you contact support.

Endpoints

Sandboxes
MethodPathWhat it does
POST/v1/sandboxesCreate. Returns 202 with an operation ID.
GET/v1/sandboxes/{id}State, environment digest, machine class, cost so far.
POST/v1/sandboxes/{id}/executionsRun a command. Streams or returns exit code and output.
PUT/v1/sandboxes/{id}/files/{path}Write a file.
POST/v1/sandboxes/{id}/resetRestore the pinned environment on the same machine.
DELETE/v1/sandboxes/{id}Release. Billing stops when release is confirmed.
Fleets
MethodPathWhat it does
POST/v1/fleetsCreate with slots, if_partial, retry policy and budget.
GET/v1/fleets/{id}/resultsOutcome counts and per-task attempts.
POST/v1/fleets/{id}/tasks/{task}/outcomeYour tests report passed or failed.
POST/v1/fleets/{id}/retriesRetry infrastructure failures on the same environment version.
Account
MethodPathWhat it does
GET/v1/usageMeter records: provisional or final, with rate version.
GET/v1/operations/{id}Status of any async request.
POST/v1/keysCreate a scoped key. Secret is returned once.

Async operations

Creating compute takes seconds to minutes, so create calls return immediately with an operation you can poll or wait on.

POST /v1/sandboxes
Idempotency-Key: 3f1c…
{ "workload": "rl-v1@1.4.0", "machine": "standard-2", "shut_down_after_min": 10 }

Errors

Errors return a stable code, whether retrying can help, and a message written for the person reading the log.

CodeRetryableMeaning
capacity_unavailableYesNo slots in the region now. retry_after_s says when to try.
quota_exceededNoYour organization limit. Request more on Limits.
budget_reachedNoThe fleet hit its budget. Running tasks finish; no new ones start.
profile_version_retiredNoPin a current version. Running sandboxes are unaffected.
idempotency_conflictNoSame key, different body. Use a new key for a new request.