# API reference: robots

Robot-kind repo extras: robot card

## GET /v1/robots/{owner}/{repo}/card

`getRobotCard` · scope `none` · Get a robot card

Returns the structured robot description of a robot-kind repo: DOF, actuators, mass, limits and MJCF pointer. Answers 404 until a card is set. Returns a 409 problem if the repo kind is not `robot`.

Parameters:

- `owner` (path, required): Repo owner handle (username or org slug).
- `repo` (path, required): Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

Responses:

- `200`: The robot card.
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

## PUT /v1/robots/{owner}/{repo}/card

`putRobotCard` · scope `key:write` · Set a robot card

Replaces the robot card on a robot-kind repo in full. `mjcf_path` is the repo-relative path of the MJCF file. Upload it via the files endpoints first. Returns a 409 problem if the repo kind is not `robot`. The hub checks what it stores. Each of these is a 422:

- a `mjcf_path` that is not a file of this repo
- an MJCF that does not parse
- referenced assets or includes missing from the repo
- `interface.joint_order` names that are not 1-DoF joints of the MJCF
- an `interface.base` that contradicts the model's free joint

The 422's `errors[]` carry the same `code` (as `type`) that `validateRobot` reports. The hub rejects the card with the reason and does not repair it.

Where the hub draws stills (`getCapabilities.studio_stills`), a stored card whose still is not current queues the hub's render. The response then carries `stills.status: queued`. A card that names its own stills without a `render_key` is never drawn over.

Parameters:

- `owner` (path, required): Repo owner handle (username or org slug).
- `repo` (path, required): Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

Request body: `application/json`, required.

Responses:

- `200`: Stored robot card.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.

## GET /v1/robots/{owner}/{repo}/interface.json

`getRobotInterfaceFile` · scope `none` · Download the robot's interface as the file its fingerprint hashes

The card's `interface` block as one JSON file: keys sorted, no whitespace, UTF-8. These are the exact bytes whose sha256 is the card's `interface_fingerprint`, so `sha256sum interface.json` on the download reproduces it. The response is sent as an attachment named `interface.json`, and its `ETag` is the fingerprint. Answers 404 for a repo you cannot see, a repo with no card, and a card that declares no interface. Returns a 409 problem if the repo kind is not `robot`.

Parameters:

- `owner` (path, required): Repo owner handle (username or org slug).
- `repo` (path, required): Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

Responses:

- `200`: The canonical interface file.
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

## POST /v1/robots/{owner}/{repo}/validate

`validateRobot` · scope `key:read` · Validate a robot card against the repo's MJCF, without writing

Returns the report an agent iterates against before `putRobotCard`. It checks:

- Is `mjcf_path` a file of this repo?
- Does it parse?
- Is every asset it references (and every `<include>`) in the repo?
- Is every `interface.joint_order` name a 1-DoF joint of the model?
- Does `interface.base` agree with the presence of a free joint?

`card` is the candidate: the body of a `putRobotCard` you have not sent yet. Omit it, or send null, to validate the stored card. **Nothing is written.** The answer is 200 whether or not the card is good: `ok` and each check's `status` say which. A candidate that the `RobotCardPut` schema itself refuses comes back as `card.schema` failures in the same report. It does not come back as a 422. The checks are static: hardened XML parsing only, and the server never runs MuJoCo. `lucen robot validate` adds the dynamic ones on the user's machine and reports in the same shape. Every `fail` here is a 422 from `putRobotCard`, with the same `code` as the error's `type`. A repo the caller cannot see is 404. The API does not answer 403 for it. Answers 409 if the repo kind is not `robot`, and 404 when `card` is omitted and no card is stored.

Parameters:

- `owner` (path, required): Repo owner handle (username or org slug).
- `repo` (path, required): Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.

Request body: `application/json`.

Responses:

- `200`: The validation report (for a good card and a bad one alike).
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.
- `503`: A service this endpoint needs is not configured in this deployment. The API boots with zero secrets. An endpoint that needs one says so instead of returning a stack trace.

## GET /v1/robots/{owner}/{repo}/routes

`getTrainingRoutes` · scope `key:read` · The ways this robot could learn a goal, ranked

Answers "how could this robot learn this?" before anything is planned. Nothing is written or spent.

The branch comes from the robot card. A fixed base takes `manipulation`. A floating base takes `locomotion`. The goal's words pick the skill.

Each route says why it ranks where it does, what it would cost and take, whether this hub can run it, and what it needs from a person:

- `sim`: reinforcement learning in simulation, scored by the hub's sim tests. It trains walking, standing and recovery on a floating base, and reaching and holding on a fixed base (an arm). A goal with an object (pick, place, push, open) has no sim test: `sim` is unavailable and says so, and the data routes are offered.
- `existing_data`: datasets that fit the robot and the goal. The hub searches the caller's datasets, public datasets on this hub, and the LeRobot datasets it lists from Hugging Face.
- `your_demos`: demonstrations a person records, with the commands.
- `existing_data_and_demos`: some data found, plus demonstrations to record.
- `video_to_motion`: a clip of a person doing the move, learned as a motion. It is available where the deployment sets `VIDEO_MOTION_ENABLED` and the card can express a body motion: two legs, or arms. Its `next_operation` is `createMotionJob`.

`generated_scene` and `world_model` are always listed with `available: false`. `searched` says what the dataset search covered. A robot the caller cannot see is `404`. A repo that is not a robot is `409`.

The `sim` route is described for the account a campaign would be for: `campaign_owner`, else the caller. Where it trains and what it costs follow that account, as `planCampaign` with the same `owner` would. An owner the caller cannot create a campaign for is `403`.

Parameters:

- `owner` (path, required): Repo owner handle (username or org slug).
- `repo` (path, required): Repo slug. A renamed repo's former slug also finds it, and the answer names its current address.
- `goal` (query, required): What the robot should learn, in one sentence.
- `campaign_owner` (query): The account a campaign would be for (`planCampaign`'s `owner`). Defaults to the caller.

Responses:

- `200`: The routes, best first.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.

## GET /v1/robot-checks

`listRobotChecks` · scope `key:read` · List hosted robot checks

Lists the checks the caller can see, newest first. These are the checks they created and the checks on a robot repo they can write. A `lucen robot worker` polls this with `status=queued&executor=worker`. No check is public.

Parameters:

- `robot_repo` (query): `owner/slug` of the robot repo.
- `status` (query)
- `executor` (query)
- `limit` (query): Page size.
- `cursor` (query): Opaque cursor from the previous page's `next_cursor`.

Responses:

- `200`: A page of checks.
- `401`: Missing or invalid credentials.
- `422`: Request failed validation.

## POST /v1/robot-checks

`createRobotCheck` · scope `key:write` · Queue a hosted check of a robot repo's model

The hub never runs MuJoCo, so a **job** checks a robot someone uploaded in the browser. The job pulls the repo and runs the CLI's own `lucen robot init` on `entry`. It uses exactly the answers given here. No defaults are filled in: `control_hz` and `action` always need an answer, and `base` does for a URDF. The job then runs `lucen robot validate`. It uploads the draft card, the report, and the converted MJCF when `entry` is a URDF. Nothing is written to the repo until a person calls `publishRobotCheck`.

The repo must be a robot repo the caller can **write**. An invisible one is `404`, a visible one you cannot write is `403`, and the wrong kind is `409`. `entry` must be one of its files (`422`). The file list is **snapshotted now** (path, sha256, size). The job checks exactly those bytes, and publishing refuses once any of them changed. With `executor` omitted, the check uses the hub's hosted executor (`modal`) when this deployment has one. Otherwise it uses `worker`: a `lucen robot worker` the owner runs. `modal` on a deployment without it is `503`, and nothing is recorded. A check is unpriced CPU (`priced: false`). Each account may create `ROBOT_CHECK_DAILY_QUOTA` of them a day (`429` with `Retry-After` and `X-Robot-Check-Quota-*`). An account here is a user, across all their keys and sessions.

**Hosted execution.** The hosted executor runs for owners in the deployment's `HOSTED_OWNERS` (default `lucen`; `*` = everyone). For every other account, it runs inside the account's monthly hosted allowance (`HOSTED_ALLOWANCE_USD`, `HardwareTierList.hosting.allowance`). For these accounts, an omitted `executor` means `modal` while the check's reservation fits the allowance, else `worker`. An explicit `modal` that does not fit is `403` (`forbidden.hosted_allowance`, naming what is left and when it resets). With the allowance at 0, it is `403` (`forbidden.hosted_owner`). A hosted check is billed at the `robot_check` function's CPU host from claim to finish (`cost_usd`, one ledger row).

**A model check (`kind: model`).** The same job, for a policy:

- `model.repo` is a model repo the caller can write (the private draft).
- `robot_repo` is the robot it is checked against (read access). When it is omitted, the job only READS the policy: its stamp, graph widths, an import's revision, size and parameter count. A robot can then be suggested from the stamp (`listRepos?interface_fingerprint=`) before anything is checked or copied.
- `entry` is either an ONNX in the draft or a checkpoint directory (`lucen_manifest.json` + `policy/`, or a LeRobot `config.json` + `model.safetensors`).
- Instead of `entry`, the body may carry `model.hf_repo` (`org/name[@revision]`). The job fetches that public LeRobot policy from Hugging Face over HTTPS. The download is size-capped, and its revision and licence are recorded.

The job reads the policy's stamped contract and checks it against the robot's `interface`. The result is `intake.embodiment`: `match`, `mismatch` with the differing fields, or `unstamped`. For an unstamped policy, it derives the contract from the interface with the one `lucen model stamp` implementation. It asks only for what the robot cannot know (`model.obs` and `model.control_class`). A missing answer is a blocking `needs_you`. The report's codes are `manifest.stamped`, `onnx.shapes`, `contract.joint_order`, `contract.action`, `contract.observation`, `contract.rate` and `embodiment.fingerprint` (plus `source.hf` for an import). Each has a one-sentence `message` and a `data.verdict` (`match`, `mismatch`, `stamped`, `derived`). Publish (`publishRobotCheck`) links the (stamped) files into the draft, or into `repo`, created for the caller. It sets the model's meta (robot, control class, embodiment fingerprint). With `smoke`, it also queues the `smoke` sim gate as the publisher.

Request body: `application/json`, required.

Responses:

- `201`: Check queued.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.
- `429`: This account's daily check quota is spent. Or a hosted check was asked for and the account's spend cap stops new hosted work this month (`errors[].type` is `quota.spend_cap`).
- `503`: A service this endpoint needs is not configured in this deployment. The API boots with zero secrets. An endpoint that needs one says so instead of returning a stack trace.

## GET /v1/robot-checks/{check_id}

`getRobotCheck` · scope `key:read` · Get a hosted robot check

Returns the check's status and the tail of the job's log. Once the job finished, it also returns:

- the report (`engine: mujoco`, the CLI's shape and codes);
- the draft (the model's facts, `needs_you` with severities, the card the hub read back from the uploaded `robot_card.json`);
- the artifacts, with presigned 1-hour downloads;
- whether it can be published (`publish_blockers`).

Visible to its creator and to anyone who can write the robot repo. Any other caller gets `404`.

Parameters:

- `check_id` (path, required): Hosted robot check id (`rchk_...`).

Responses:

- `200`: The check.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).

## POST /v1/robot-checks/{check_id}/claim

`claimRobotCheck` · scope `key:write` · Claim a queued check (robot check worker protocol)

Compare-and-set `queued → running`, exactly like `claimRollout`. One caller wins, and everyone else gets `409` naming the holder. Records the **claiming credential**. `presignRobotCheckArtifacts` and `reportRobotCheck` are `409` from any other credential. The response is the check with `sources`: the snapshot's files, with presigned 1-hour GETs of exactly the bytes that were snapshotted. So the job needs no access to the repo at all. It never reads the repo through the repo's routes and can never write to it. There is no lease. A dead worker leaves the check `running` until someone cancels it.

Parameters:

- `check_id` (path, required): Hosted robot check id (`rchk_...`).

Request body: `application/json`, required.

Responses:

- `200`: Claimed; the check with its sources.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.

## POST /v1/robot-checks/{check_id}/artifacts

`presignRobotCheckArtifacts` · scope `key:write` · Presign uploads for a running check's artifacts

One presigned PUT per artifact under `robot-checks/{check_id}/files/` (outside the content-addressed `blobs/` prefix). `name` is the repo path the artifact would take if the check is published. Only four kinds are accepted:

- `robot_card.json`;
- the MJCF converted from a URDF `entry` (the entry with an `.xml` suffix);
- meshes under `meshes/`;
- the two stills `thumbnail.png` / `thumbnail-dark.png` (publish sets `thumbnail_paths` only when both were reported).

Only a `running` check may presign, and only the credential that claimed it (`409` otherwise). URLs live 1 h.

Parameters:

- `check_id` (path, required): Hosted robot check id (`rchk_...`).

Request body: `application/json`, required.

Responses:

- `200`: One presigned PUT per requested artifact.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.

## POST /v1/robot-checks/{check_id}/report

`reportRobotCheck` · scope `key:write` · Report progress or the result of a claimed check

This is the worker's one write path after `claimRobotCheck`. The check must be `running`, and the caller must be the credential that claimed it (`409` otherwise). `log_chunk` (≤ 256 KiB) is stored under `robot-checks/{id}/logs/` and appended to the row's log tail. The terminal `succeeded` report carries the `report` (the CLI's, `engine: mujoco`), the `draft` summary and the `artifacts` it uploaded. The hub then **hashes every artifact itself** and reads `robot_card.json` back (≤ 1 MiB, a JSON object). This pins what a person later publishes to the bytes that were checked. `succeeded` means the job produced a verdict. A model that fails to compile is a succeeded check whose report fails. `failed` means the job itself broke. A named artifact that was never uploaded, or is not one of the four accepted kinds, is `422`.

Parameters:

- `check_id` (path, required): Hosted robot check id (`rchk_...`).

Request body: `application/json`, required.

Responses:

- `200`: Recorded; the check as it now stands.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `413`: A log chunk is over its size limit.
- `422`: Request failed validation.

## POST /v1/robot-checks/{check_id}/publish

`publishRobotCheck` · scope `key:write` · Publish a check's draft card into the robot repo, as the caller

Links the check's artifacts into the robot repo and stores the drafted card, with the job's report as its `validation` record. Both happen under the **caller's** principal. Only a person (or a key acting for them) does this. The job never does. `write` on the robot repo is required (`403` otherwise; `404` if the check or the repo is invisible). The key that claimed the check is `403` even with `write`, because a person publishes what a worker proposed.

The hub copies each artifact into content-addressed storage and **hashes the copy**. A digest that differs from the one the hub recorded at the terminal report is `409`. This keeps the linked bytes equal to the bytes that were checked. The card then goes through `putRobotCard`'s own static checks. If they refuse it, the answer is `422` with their reasons, and nothing is linked.

`409` also when:

- the check is not `succeeded`;
- it was already published;
- its report failed;
- its draft lists a `blocking` `needs_you` item;
- a snapshotted file of the repo changed since the check was queued. Any edit means a new check;
- an artifact would replace a file Lucen certified;
- `visibility: private` would hide a repo robots fetch a certified file from (the rule of `updateRepo`).

Only a certifier may publish into the repo that holds Lucen's certification list (`403`).

`visibility` in the body is applied to the repo last and audited as a `repo.update`. The browser upload creates the repo private.

Parameters:

- `check_id` (path, required): Hosted robot check id (`rchk_...`).

Request body: `application/json`.

Responses:

- `200`: Published; the check with `published` filled in.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `422`: Request failed validation.
- `503`: Either a service this endpoint needs is not configured, or the hub cannot read Lucen's certification list right now. Nothing was changed.

## POST /v1/robot-checks/{check_id}/cancel

`cancelRobotCheck` · scope `key:write` · Cancel a hosted robot check

A `queued` or `running` check becomes `canceled` in this request. A `modal` check's call is terminated first (`502` if Modal refuses, and nothing changes). A `worker` check's worker learns on its next report (`409`). A terminal check is `409`.

Parameters:

- `check_id` (path, required): Hosted robot check id (`rchk_...`).

Responses:

- `202`: Canceled; the check as it now stands.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `409`: State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).
- `502`: Modal refused to terminate the call; nothing changed.
