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
| Method | Path | What it does |
|---|---|---|
| POST | /v1/sandboxes | Create. Returns 202 with an operation ID. |
| GET | /v1/sandboxes/{id} | State, environment digest, machine class, cost so far. |
| POST | /v1/sandboxes/{id}/executions | Run a command. Streams or returns exit code and output. |
| PUT | /v1/sandboxes/{id}/files/{path} | Write a file. |
| POST | /v1/sandboxes/{id}/reset | Restore the pinned environment on the same machine. |
| DELETE | /v1/sandboxes/{id} | Release. Billing stops when release is confirmed. |
| Method | Path | What it does |
|---|---|---|
| POST | /v1/fleets | Create with slots, if_partial, retry policy and budget. |
| GET | /v1/fleets/{id}/results | Outcome counts and per-task attempts. |
| POST | /v1/fleets/{id}/tasks/{task}/outcome | Your tests report passed or failed. |
| POST | /v1/fleets/{id}/retries | Retry infrastructure failures on the same environment version. |
| Method | Path | What it does |
|---|---|---|
| GET | /v1/usage | Meter records: provisional or final, with rate version. |
| GET | /v1/operations/{id} | Status of any async request. |
| POST | /v1/keys | Create 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.
| Code | Retryable | Meaning |
|---|---|---|
| capacity_unavailable | Yes | No slots in the region now. retry_after_s says when to try. |
| quota_exceeded | No | Your organization limit. Request more on Limits. |
| budget_reached | No | The fleet hit its budget. Running tasks finish; no new ones start. |
| profile_version_retired | No | Pin a current version. Running sandboxes are unaffected. |
| idempotency_conflict | No | Same key, different body. Use a new key for a new request. |