---
title: "Preflight the node's environment from inside its container"
method: POST
path: "/preview/nodes/{name}/doctor"
tags: ["nodes"]
---

# Preflight the node's environment from inside its container

`POST /preview/nodes/{name}/doctor`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/nodes/{name}/doctor`
- Auth: HTTP bearer

Preflight ONE of your nodes from the inside: run environment checks in its container and report what would break a build before you start one. This is the tenant-scoped counterpart to `doctor` (which reports fleet invariants for operators, not your node). Checks: torch's CUDA major vs the image's nvcc - the mismatch that makes building flash-attn / DeepSpeed / apex / xformers impossible on an image whose toolkit disagrees with the torch pip resolved, and which otherwise fails only after a long compile; the container's cgroup CPU budget vs the host numbers os.cpu_count()/free/psutil report, which is what makes an os.cpu_count()-sized pool over-subscribe; virtualenvs that no longer load under the current image (the usual cause is a snapshot restored onto a different one); whether the GPU actually computes, via a one-line matmul; and, when the container requested GPU graphics, whether the host mounted the Vulkan ICD and libGLX_nvidia it needs to render (a node whose organization has GPU graphics off is told so, and how to ask for it). Answers {ok, findings:[{check, problem, fix}], passed, skipped:[{check, reason}], facts}. A check that does not apply here (no CUDA toolkit, no torch installed, no venvs) is SKIPPED with a reason, never reported as a problem. Nothing is installed, repaired, or changed - it only looks. The node must be running, and unlike run_command this NEVER wakes a stopped one (a preflight should not start billing to answer); on a running node it is an exec, so it counts as activity and re-arms the idle grace. Run it after you set up an environment and before a long build.

## Path parameters

- `name` string, required: Node name (from `list_nodes`). The node must already be running: the checks run INSIDE its container, and this never wakes a stopped node.

## Query parameters

- `workspace` string

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.
- `503`: The node changed state under every pass this call made - a wake, a stop, or a container exit landing mid-call. Nothing ran and nothing was billed; the same call works shortly. Wait `Retry-After` seconds and repeat it. Code `settling`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
