api.compute

status()

api.compute.status() → Promise<{ available, reason, workspace, network }>

Check whether the isolated compute runner is available before offering a command or terminal action.

read-onlydoes not start a container
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const status = await api.compute.status();
if (!status.available) {
  console.log("Compute is unavailable:", status.reason);
} else {
  console.log(status.workspace, status.network);
}
status = api.compute.status()
if not status.get("available"):
    print("Compute is unavailable:", status.get("reason"))
else:
    print(status["workspace"], status["network"])

Returned fields

availableboolean

Whether the runner currently accepts compute requests.

reasonstring|null

A public reason when the runner is unavailable; otherwise null.

workspacestring

Workspace mount path. Currently /workspace.

networkstring

Network policy reported by the runner. The current service reports none.

An available result is a point-in-time check, not a reservation. The runner can become unavailable before a later command starts; handle that request's error as well.