# API reference: runs

Training runs: submitted here and executed by an executor, either a self-hosted `worker` or Modal (`modal`)

## GET /v1/runs

`listRuns` · scope `key:read` · List training runs

Runs visible to the caller (created by them or owned by an org they belong to), newest first. A self-hosted runner discovers its work here with `status=queued&executor=worker`.

Parameters:

- `status` (query)
- `executor` (query): Filter by executor (`worker` | `modal`).
- `owner` (query): Filter by billing owner handle (username or org slug).
- `kind` (query): Filter by kind: `external` (imported), `orchestration` (a plan's run), `cloud` (executed; narrow further with `executor`), `job` (a command from an uploaded project).
- `robot` (query): Filter by the robot the recipe names (`owner/slug`, exact), or the literal `none` for runs whose recipe names no robot.
- `gated` (query): `true`: only runs that were tested in simulation. That is a run with a scorecard (`scorecard_key` set), or one with a finished sim test of a checkpoint while it trained (`best_gate` non-null). `false`: only runs with neither.
- `parent_run_id` (query): The direct forks of one run (its lineage children).
- `import_key` (query): Only the imported run that `importRun` recorded with this `import_key` (exact). An importer finds its earlier import with it.
- `template` (query): Only runs whose recipe names this template (`Recipe.template`, exact): a method page's Runs tab. Part of the query.
- `facets` (query): `true` adds `facets` to the page. They show how the caller's whole visible set splits by kind, executor, status, robot and gate. This request's filters are NOT applied to them. A filter rail can then print a count beside every choice. Default false. The CLI never pays for it.
- `limit` (query): Page size.
- `cursor` (query): Opaque cursor from the previous page's `next_cursor`.

Responses:

- `200`: Page of runs.
- `401`: Missing or invalid credentials.

## POST /v1/runs

`createRun` · scope `key:train` · Create a training run

Queues a training run from a recipe. The API validates the recipe envelope and the dataset ref URI format (`lucen://`, `hf://`, `github://`). The executor resolves external refs. `owner` defaults to the caller. Pass an org slug to bill an org. `parent_run_id` records lineage (fork / retrain attribution). The coach's resolved-config diff runs against it.

**Executor.** `recipe.executor` picks the backend. Absent means `worker`. A `worker` run is recorded as `queued` and stays there until a self-hosted runner claims it. The runner is `lucen worker run`, holding a `train` key for this owner. The hub does not track connected runners, so a run with no runner waits. A `modal` run is recorded `queued`. The hub then spawns the template's deployed Modal function on the tier's GPU (`modal_call_id` / `dispatched_at` on the run). The container claims and reports like a runner. On a deployment without `MODAL_APP_NAME`, the submit answers `503` naming it. It records no run, because that run would never start. A spawn that fails after the commit leaves the run `failed` with the reason. The run is not left `queued` forever.

**The cloud.** A `cloud` run is launched on the hub's own AWS and Azure accounts as a SkyPilot managed job (`RunCloud` on the run). The VM claims and reports like a runner. Spot is used when the work resumes from its newest checkpoint: a VM the cloud takes back is replaced, and the run resumes. It is billed at the instance's price × 1.1, per VM. Without a SkyPilot server, or without an image for the run, the submit answers `503` and records nothing. A CPU template and an Isaac Lab job that must run behind Lucen cloud's network allowlist are `422` there. A hub may send a tier's `modal` runs to the cloud. It does so for work of at least `CLOUD_MIN_HOURS` with a cloud image, and the stored recipe then says `cloud`.

**Jobs.** `recipe.template: custom` with a `recipe.job` block runs any command from an uploaded project (`createJobSnapshot`). The run's kind is `job`. It keeps what a run has: logs, metrics, checkpoints, cancel, the budget and the ledger. With `modal` it runs on Lucen cloud, billed at the provider's cost × 1.1. A hosted job needs `budget_usd`, and `max_hours` of at most `JOB_MAX_HOURS` (default 24). It is open to owners in `HOSTED_OWNERS`, and to workspaces with a payment method once the hub takes payments. Anyone else gets `402`. An `isaaclab3-newton` job on Lucen cloud runs without NVIDIA's assets for an owner outside `HOSTED_OWNERS`. NVIDIA's licence for its Isaac Sim assets does not let the hub fetch them for others. Such a job runs in a sandbox whose network reaches only the package indexes, Hugging Face, GitHub and this hub, and its command does not run as root. A job that asks for an asset fails, and its `error` names the file and the reason. Such a job runs on `own_modal` or `worker`. Every hosted `isaaclab3-newton` job is priced at that sandbox's host: 2 cores and 8 GiB, or 4 cores and 16 GiB with `job.large_host`. Its default GPU is `a10g`; another job's is `l4`. With `own_modal` it runs in the owner's own Modal workspace, connected in Settings, and the hub bills nothing. At most `JOB_MAX_CONCURRENT` (default 2) jobs per owner may be queued or running on Lucen cloud and on the owner's Modal together. One more is `429`.

**Idempotency.** Send an `Idempotency-Key` header to make retries safe. Idempotency keys are scoped per credential. The same key with the same body within 24 h returns the run created the first time (`200`, same id). The same key with a different body is `422`.

**GPU-hour quota.** The GPU hours an account may reserve on **priced** executors (`modal`, `cloud`) are capped. The hub sums `max_hours` (service default 4) over the priced runs the user created in the last 24 h. Runs that are `canceled` are left out. Runs created through ANY credential count: a session, any key, an agent session's keys. That sum plus this run must stay within the deployment's `RUN_DAILY_GPU_HOUR_QUOTA` (default 24 h). Otherwise the answer is `429` with `Retry-After`, `X-GPU-Quota-Limit` / `-Used` and a problem body naming the numbers. An API key's own `daily_gpu_hour_quota`, when set, narrows that further for the runs the key created. `worker` runs are unpriced and never count.

**Planned templates.** The hardware planner knows some templates that no executor implements yet (`pi0_lora`, `groot_lora`, `openvla_lora`). Such a template is `503` naming the missing template, on every executor, and nothing is recorded. `POST /v1/runs/recommend` still answers for it. Ask `recommend` before `create`: it picks the GPU tier from the model family, the method and the dataset's shape.

**Isaac Lab on Modal.** `ppo_isaac` with `executor: modal` runs the owner's Isaac Lab task on a hosted L40S or L4 / A10G. L40S is the default when `recipe.gpu` is null. NVIDIA's Isaac Sim licence covers a company training its own robots. It does not cover a service training other people's robots. So the hosted template is **`403`** for any owner not in the deployment's `ISAAC_HOSTED_OWNERS` (default `lucen`), naming the reason. Its `errors[].type` is `forbidden.isaac_license`. A `worker` run of `ppo_isaac` (on the owner's own machine) is never restricted. Isaac Sim renders through RTX, so `gpu: a100 | h100` is `422` for it. `recipe.parent_checkpoint_step` starts a child from a parent's published checkpoint (`422` if the parent does not list that step). A `modal` run that Modal preempts is re-claimed by its own call. It resumes from its last published checkpoint (`claimRun`).

**A hosted Isaac Lab customer.** An owner on `ISAAC_HOSTED_OWNERS` and not on `ISAAC_OPERATOR_OWNERS` (default `lucen`) is a customer. A hosted `ppo_isaac` run for a customer may set only `task`, `num_envs`, `max_iterations`, `seed` and `policy_name` in `recipe.hyperparams`. The task is `Lucen-Legs-Stand`, `Lucen-Legs-Walk` or `Lucen-Legs-Omni` with a version, for example `Lucen-Legs-Omni-v0`. `overrides` must be empty. An override could change the robot's gains or model, and the policy's stamp would not record it. A warm start (`parent_checkpoint_step`) needs a parent that was itself a hosted `ppo_isaac` run, or an operator's run. Anything else is `422` with `errors[].type: value_error.isaac_customer_hyperparam`. Each key is one error, and its `loc` names the key. The run's outputs then hold no training recipe: `config.yaml` has no `env` or `agent`, and `metrics.jsonl` has no `Episode_Reward/`, `Episode_Termination/`, `Episode/` or `Curriculum/` keys. A `worker` run is never limited.

**Hosted Isaac Lab values, for every owner.** `policy_name` names the policy file. It is 1 to 64 lowercase letters, digits, `_` or `-`, and starts with a letter or digit. `num_envs` is a whole number from 1 to 16384. `max_iterations` is one from 1 to 100000. `seed` is one from 0 to 2147483647. `true` and `false` are not numbers. Null leaves a value unset. Anything else is `422` with `errors[].type: value_error.isaac_hyperparam`, one error per key. The template refuses the same values on the owner's own machine.

**Hosted execution.** There is no payment system, so `executor: modal` runs only for owners in the deployment's `HOSTED_OWNERS` (default `lucen`; `*` = everyone). Anyone else gets `403` with `errors[].type: forbidden.hosted_owner` and a sentence naming the setting and the self-hosted way. Nothing is recorded or dispatched. A `worker` run is never restricted. A `recipe.gate` whose rollouts would be hosted is still asked the same question. On a deployment with no Modal app, the `503` answers instead.

**An AI agent's key.** A key marked as an agent's may spend only the free hosted allowance on its own. Hosted work beyond it is not refused. It is held: the answer is `202` with a `SpendHold`, nothing is recorded as a run, and nothing is reserved. A person approves or denies the hold from the Inbox. The same key asking the same thing again while the hold is pending gets the same hold.

**A motion learned from a video.** A `motion_tracking_isaac` or `motion_tracking_mjlab` run passes `trainMotionJob`'s own checks. Its motion job needs its preview in, no `blocking` note and no training waiting for a person (`409` otherwise). `hyperparams` holds only `motion_job_id`, `speed`, `profile` and `iterations` (200 to 20000), and `dataset` is empty. `speed` and `profile` must be the job's (`422` otherwise). An AI agent's key may not create one here (`403`, `forbidden.motion_agent_key`), and neither may a key the hub made for a job or a robot. Such a key asks with `trainMotionJob`, which files a hold that a person approves. The approval creates the run.

**The spend cap.** An account's cap counts the month's recorded cloud spend plus what queued and running cloud work could still cost, plus this run's own most possible cost. In `stop` mode a run that would carry the month past the cap is `429` (`quota.spend_cap`). In `warn` mode it starts, and the Usage page and the Inbox warn.

Parameters:

- `Idempotency-Key` (header): Client-chosen key that makes a create retry-safe. It is scoped to the credential (API key, or session user). Within 24 h, the same key with the same body returns the original resource with `200`. The same key with a different body is `422`. Keys are opaque to the hub. A UUID is a fine choice.

Request body: `application/json`, required.

Responses:

- `200`: Replay: this `Idempotency-Key` already created a run with this body. That run is returned unchanged.
- `201`: Run queued.
- `202`: Held for a person's confirmation. The key is marked as an AI agent's, and the work would spend beyond the free hosted allowance. Nothing started, and nothing is reserved yet. A person approves or denies the hold from the Inbox. Poll `getSpendHold` with the hold's id.
- `401`: Missing or invalid credentials.
- `402`: A job on Lucen cloud needs a payment method, and this owner has none. Nothing was recorded. The problem's `errors[].type` is `payment_required.job`.
- `403`: Not allowed, and nothing was recorded. A hosted refusal says why in `errors[].type`. `forbidden.hosted_owner`: the owner is outside `HOSTED_OWNERS`. `forbidden.hosted_allowance`: the free allowance cannot cover the run. `forbidden.agent_key_spend`: an AI agent's key asked for GPU work. `forbidden.isaac_license`: the owner is outside `ISAAC_HOSTED_OWNERS` for a hosted `ppo_isaac` run. `forbidden.key_limits`: the key is limited to repos, and the robot or the owner is not among them. `forbidden.motion_agent_key`: a motion's training was asked for directly by an AI agent's key, or by a key the hub made for a job or a robot. A caller who may not act for the owner gets a `403` without a type.
- `409`: A motion-tracking run whose motion job cannot train now: no preview yet, a `blocking` note, a training already running, or one waiting for a person. Nothing was recorded.
- `422`: The request failed validation. A hosted `ppo_isaac` customer's hyperparameter outside the allow-list is `value_error.isaac_customer_hyperparam`, one error per key. A hosted `ppo_isaac` value no owner may send is `value_error.isaac_hyperparam`. Nothing was recorded.
- `429`: The account's (or the key's own) daily GPU-hour quota would be exceeded (priced executors only). Or the account's spend cap is in `stop` mode and this month's Lucen cloud spend has reached it (`errors[].type` is `quota.spend_cap`). Or the owner already has `JOB_MAX_CONCURRENT` jobs queued or running (`quota.job_concurrency`). `Retry-After` says when to try again; nothing was recorded.
- `503`: The requested executor cannot run on this deployment (`modal` with no `MODAL_APP_NAME`, or a template no deployed function carries). The same answer comes when the template is registered for planning only (`pi0_lora`, `groot_lora`, `openvla_lora`). Nothing was recorded.

## POST /v1/jobs/snapshots

`createJobSnapshot` · scope `key:write` · Upload a project folder for a job

Uploads the project a job runs from. `tree` is the folder as a gzipped tar, then base64. `sha256` is the digest of the gzipped bytes. The CLI leaves out what `.gitignore` names, and `.git` itself.

**No credentials.** The hub reads every file. A file that looks like a credential is left out and named in `refused[]`. That covers `.env` files, private keys, tokens and passwords written into the code. The rest is kept, rewritten in a fixed order with plain file modes.

**Content-addressed.** The answer's `sha256` names the snapshot as the hub stores it. A job names it in `recipe.job.snapshot`. Uploading the same files again answers `200` with `deduplicated: true` and stores nothing new. A snapshot belongs to one owner and is not shared.

**Size.** The gzipped tar is at most 16 MiB. It unpacks to at most 256 MiB and 20,000 files. Larger is `413`. Keep data and weights out of the project. A job downloads them itself when it starts.

Request body: `application/json`, required.

Responses:

- `200`: The owner already holds these files. Nothing new was stored.
- `201`: The snapshot, stored.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).
- `413`: The project is over its size cap. Nothing was stored.
- `422`: Request failed validation.

## GET /v1/jobs/snapshots/{sha256}

`getJobSnapshot` · scope `key:read` · Look up an uploaded project

Says whether an owner already holds a snapshot. The CLI asks before it uploads, so an unchanged project is sent once. A snapshot that does not exist, or belongs to another owner, is `404`.

Parameters:

- `sha256` (path, required): The snapshot's digest, or the digest of the upload that made it.
- `owner` (query): The owner to look in. Defaults to the caller.

Responses:

- `200`: The snapshot.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).

## POST /v1/runs/import

`importRun` · scope `key:write` · Import a training run trained off-platform

Records a run that trained somewhere else (`kind: external`). The Training Coach can then read it, and it appears on `/runs` beside cloud runs. The three artifacts (resolved config, metrics summary, scorecard) are sent inline and stored as objects. `parent_run_id` records lineage. It makes the coach's resolved-config diff possible, which is the coach's first piece of attribution evidence. Importing spends no GPU dollars, so this operation needs `key:write`. It does not need `key:train`. Imported runs have no live logs: `logs_key` is always null.

`output_model_repo` links the run to a model repo that holds its checkpoints under `checkpoints/step_N/`. The hub resolves it like `reportRun` does. It must be a model repo the caller may write, else `422`. A child run may then name one of those steps as `recipe.parent_checkpoint_step`. `import_key` makes the import repeatable. A second import under the same owner with the same key answers `200` with the first run and records nothing new.

Request body: `application/json`, required.

Responses:

- `200`: An earlier import under the same owner sent the same `import_key`. This is that run. Nothing new was stored. A run with no output repo yet is linked to the one this request names.
- `201`: Run imported.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `409`: The run with this `import_key` is already linked to another output repo.
- `413`: An artifact is over the per-artifact size limit, or the owner's storage quota would be exceeded (imports count toward it).
- `422`: Request failed validation.

## POST /v1/runs/estimate

`estimateRun` · scope `key:train` · Price a training run before submitting it

Takes the same body as `createRun` and validates it the same way (owner, dataset refs, parent). Nothing is created. The answer is the most the run can cost. That is the tier's billed hourly rate × the wall-clock cap (`recipe.max_hours`, else the service default of 4 h). The result is then capped by `recipe.budget_usd` when one is set. Rates are the ones `GET /v1/hardware_tiers` publishes. A `worker` run executes on the owner's own machine and costs the hub nothing. So its estimate is `cost_usd_max: 0, priced: false`. The coach applies the same rule to an unknown model id. A `modal` estimate is priced whether or not this deployment can run it. The price list exists on every deployment. The backend exists only where `MODAL_APP_NAME` is set. For `ppo_isaac`, the rate is the tier's plus `host_rate_usd_per_hour` (the CPU cores and memory `ppo_isaac`'s function reserves). A hosted `ppo_isaac` estimate for an owner outside `ISAAC_HOSTED_OWNERS` is the same `403` (`forbidden.isaac_license`) `createRun` answers. A price for something the owner may not buy would be a false answer. A customer's hyperparameter outside the allow-list is the same `422` (`value_error.isaac_customer_hyperparam`). So is a value no owner may send (`value_error.isaac_hyperparam`).

**Hosted execution.** A `modal` estimate for an owner outside `HOSTED_OWNERS` is the same `403` (`forbidden.hosted_owner`) `createRun` answers.

Request body: `application/json`, required.

Responses:

- `200`: The estimate.
- `401`: Missing or invalid credentials.
- `403`: The same `403` `createRun` answers, with the same `errors[].type`: `forbidden.hosted_owner`, `forbidden.hosted_allowance`, `forbidden.agent_key_spend`, `forbidden.isaac_license` or `forbidden.key_limits`.
- `422`: The same `422` `createRun` answers, including `value_error.isaac_customer_hyperparam` and `value_error.isaac_hyperparam`.

## POST /v1/runs/recommend

`recommendRun` · scope `key:read` · Recommend a GPU tier for a training run (deterministic planner)

Takes the same body as `createRun` and validates it the same way. Nothing is created. The answer is which `hardware_tiers` entry the run needs. **Deterministic: no model is in this path.** The hub computes it in three steps:

- It looks the recipe's `template` up in its `training_policies` registry. The registry holds the model family, parameter count, method `lora | full | rl`, control class, per-sample activation cost and published requirements. Each row carries the URL it was read from.
- It reads the first `lucen://` dataset ref's `meta/info.json` with the episode viewer's parser. That gives the cameras and their resolution, fps, episodes, frames, and state and action width.
- It computes `vram_estimate_gb = runtime floor + params × bytes × (lora ? 1.6 : 6) + samples × activations(cameras, resolution, action chunk)`. Here `samples` is `hyperparams.batch_size` for imitation learning and `hyperparams.num_envs` for RL.

A published floor (GR00T: "40 GB+ VRAM") raises the estimate when the arithmetic lands below it. The smallest tier whose VRAM covers the estimate **plus 20 % headroom** is `tier`. Every tier that does is `fits_on`. `est_hours` comes from the registry's reference throughput, scaled by the tier's relative BF16 tensor throughput. `cost_usd_est` / `cost_usd_max` come from the tier's billed rate. A `worker` recipe is unpriced, and the tier then names the GPU class the owner's own machine needs.

**Measured beats modelled**: every `succeeded` `reportRun` that carried `peak_vram_gb` / `samples_per_s` updates a rolling value per (template, tier, batch size). When one exists for this recipe's batch size, it replaces the arithmetic. `basis` says which was used, and `why[]` shows the sums either way.

A template registered for planning only (`implemented: false`) is answered here and refused by `createRun` with `503`. An unknown template is `422` naming the registered ones. A dataset ref the caller cannot read, or one that is not a LeRobotDataset, gives a warning. The registry's defaults are used instead. Such a ref never causes a 404, because a planner must not be an existence oracle. `explanation` is reserved for the planner and is always null today.

Request body: `application/json`, required.

Responses:

- `200`: The recommendation, with its arithmetic.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `422`: Request failed validation.

## GET /v1/runs/{run_id}

`getRun` · scope `key:read` · Get a training run

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Responses:

- `200`: The run.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).

## GET /v1/runs/{run_id}/logs

`streamRunLogs` · scope `key:read` · Stream run logs (SSE)

Server-Sent Events stream (`text/event-stream`). Each event is `event: log` with a JSON `LogEvent` payload (`{ts, stream, line}`). Replays existing logs from `tail`. With `follow=true`, the stream stays open while the run is active, then closes with `event: end`.

**What is on the wire.** The log is the sequence of chunks a runner sent through `reportRun`, one object per report under `logs_key`. The stream emits one `log` event per line. `ts` is the chunk's arrival time. A runner batches ~5 s of output per report, so lines inside one chunk share a stamp. `stream` is `stdout` for the runner's output. It is `stderr` for a notice the hub wrote into the log itself (a lease re-queue, a cancel request). The same stream also carries `event: metric`: one `MetricEvent` per `metrics.jsonl` line, all of them, unaffected by `tail`. This lets a client draw the loss curve from the same connection. `event: end` always closes the stream, with the run's status at that moment as its payload. With `follow=true`, it comes once the run is terminal. Otherwise it comes right after the replay. An imported (`external`) run has no log and answers `end` at once. Same visibility as `getRun`: a run you may not see is `404`.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).
- `follow` (query): Keep the stream open while the run is queued/running.
- `tail` (query): Replay only the last N log lines (default = all). Metric events are never tailed.
- `strip_ansi` (query): Remove ANSI escape sequences (colour, bold, cursor control) from every log line before it is sent. Off by default: the log is the trainer's bytes, and a terminal pane renders rsl_rl's bold header from them. An agent reading text sets it (the MCP `get_run_logs` tool does).

Responses:

- `200`: SSE log stream.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).

## GET /v1/runs/{run_id}/logs/download

`downloadRunLogs` · scope `key:read` · Download a run's whole log as text

Returns every log chunk of the run concatenated, in arrival order, as one `text/plain; charset=utf-8` body. The Terminal tab's Download button uses it, and so does `curl … > run.log`. The body holds exactly the bytes the runner reported and the hub's own `[lucen <iso>] …` notices. Nothing is added between chunks. The chunks come in the order `streamRunLogs` replays them. ANSI SGR sequences (rsl_rl's bold `ESC[1m` header) are **kept** unless `strip_ansi=true`. Sent with `Content-Disposition: attachment; filename="<run_id>.log"` and streamed chunk by chunk, so a long run's log never sits in the API's memory. Same visibility as `getRun` (`404` when invisible). A run with no log yet (queued, or imported) answers an empty body.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).
- `strip_ansi` (query): Remove ANSI escape sequences (colour, bold, cursor control) from every log line before it is sent. Off by default: the log is the trainer's bytes, and a terminal pane renders rsl_rl's bold header from them. An agent reading text sets it (the MCP `get_run_logs` tool does).

Responses:

- `200`: The whole log.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).

## POST /v1/runs/{run_id}/cancel

`cancelRun` · scope `key:train` · Cancel a training run

Requests cancellation. Queued runs cancel immediately. Running jobs move to `canceled` once the worker acknowledges (billing stops within 60 s). Terminal runs return 409.

**Mechanism.** A `queued` run becomes `canceled` in this request. Nothing ran, so nothing is billed and no ledger row is written. A `running` `worker` run stays `running`, because the hub has no process to kill. The hub sets its `cancel_requested_at`. The runner sees that field on its next `reportRun` response. It kills the template and reports `status: canceled`. That is the terminal report, and it writes the ledger (cost 0 for a worker run). Until then the response is `202` with the run still `running`. Asking again is idempotent. Anyone who can see the run may cancel it (the owner, an org member, or the runner's own credential). A `modal` run is stopped on Modal in this request and billed to the second. A `cloud` run's managed job is cancelled the same way. Checkpoints it had not uploaded yet are lost. `stopRun` ends a run and keeps every checkpoint the template wrote. Writes a `run.cancel` audit row and a `stderr` notice into the run's log.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Responses:

- `202`: Cancellation requested; current run snapshot returned.
- `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, ...).
- `501`: The run's executor cannot cancel on this deployment (`modal`).

## POST /v1/runs/{run_id}/stop

`stopRun` · scope `key:train` · Stop a training run early and keep its checkpoints

Ends a run before its iterations do and keeps everything it trained. A `running` run gets `cancel_requested_at` on every executor. The hub never kills its process. The runner reads the field off its next `reportRun` response. It stops the template and uploads every checkpoint the template wrote that has not reached the hub yet. Then it reports `canceled`. On `modal` the container keeps running for those seconds, and billing continues. `cancelRun` instead shuts it down at once and loses what was not uploaded. Checkpoints already published stay either way, because the hub never deletes them. A `queued` run is canceled in this request, as `cancelRun` does. Nothing ran, so nothing is kept. `409` for a run that already ended or was imported. Idempotent while running. Writes a `run.cancel` audit row marked `stop_early` and a `stderr` notice into the run's log.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Responses:

- `202`: Stop requested; current run snapshot returned.
- `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, ...).

## POST /v1/runs/{run_id}/move

`moveRun` · scope `key:train` · Move a queued run to hosted compute

Moves a run that is waiting for a self-hosted runner onto the hub's hosted compute. It is the same run, with the same id and recipe. Only `executor` changes, plus `gpu`, `max_hours` and `budget_usd` when the body names them. Only a `queued` `worker` run that no runner has claimed may move, and only to `modal`. Asking to move a run to the executor it already has returns it unchanged, so a repeated request is harmless.

**Checks.** The run's owner must pass everything `createRun` checks for a `modal` recipe:

- hosted access (`403`)
- the monthly CPU allowance (`403` when the run's most possible cost does not fit)
- the GPU-hour quota (`429`)
- a GPU that a CPU template would not use (`422`)
- a deployment with no hosted compute (`503`)

A refusal leaves the run as it was, still queued for a runner.

**One run, billed once.** The move is a compare-and-set on the row. It succeeds only while the run is still `queued` on `worker` with no claim. `claimRun` checks the executor it read. So when a move and a runner's claim race for one run, exactly one wins and the other gets `409`. Nothing is billed while a run waits. Once moved, the run is dispatched like any hosted run and billed from its claim. Writes a `run.move` audit row and a notice into the run's log.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Request body: `application/json`, required.

Responses:

- `200`: The run, now on the requested executor and still `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`: The owner's (or the key's own) daily GPU-hour quota would be exceeded. Or the account's spend cap is in `stop` mode and this month's Lucen cloud spend has reached it. `Retry-After` says when to try again; the run is unchanged.
- `503`: This deployment has no hosted compute for the run's template; the run is unchanged.

## GET /v1/runs/{run_id}/config

`getRunConfig` · scope `key:read` · A run's resolved config, flattened, and its diff against the parent

What the run page's Config tab and its "Config against the parent" panel read. The resolved config artifact (`config_key`) is flattened to leaf paths. When the run declares a `parent_run_id` whose config the caller can also see, the hub diffs the two. It diffs them exactly as the coach's prompt builder does (the coach's attribution evidence #1). Changed columns are listed and unchanged columns are counted. Same visibility as `getRun` (404 when invisible).

**Grouped by RL structure, and readable while the run trains.** A runner uploads `config.yaml` on its first progress report after the template wrote it. For `ppo_isaac`, that is as soon as Isaac Lab dumped `params/env.yaml` + `params/agent.yaml`, before `runner.learn`. So this answers mid-run. `groups[]` sorts every key and every diff entry into groups by one rule table (the API guide, "Config groups"). The groups are Actions, Contract, Observations, Plant, Rewards, Network, Algorithm, Domain randomization, Curriculum, Terminations, Commands, Sim, Bookkeeping and Other. `Round.variables` and the MCP `get_run_config` tool count with the same implementation. `comparison` is `cross_shape` when one side is the importer's manifest shape and the other is Isaac Lab's resolved config. The manifest shape uses `contract.*` / `plant.*` / `lineage.*`, and Isaac Lab's uses `env.*` / `agent.*`. In that case, only the keys that map one to one (`pairs[]`) are compared. The rest of each group is counted as `parent_has_no_record` / `child_has_no_record`. None of it counts as unchanged.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Responses:

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

## POST /v1/runs/{run_id}/code

`putRunCode` · scope `key:write` · Record the code a run trained from, and archive it

A runner calls this when it starts a run from a git checkout. An importer calls it after `importRun`. It records the run's code identity: the repo, the commit, the branch and the uncommitted files. It also archives the code on the hub. `tree` is the commit's tree as `git archive` writes it, gzipped, then base64. `patch` is the uncommitted diff of tracked files. Untracked files are never sent.

**Archived once per commit.** When a run of the same owner already archived this repo at this commit, the hub keeps that copy. The answer then says `deduplicated: true`. When the tree is needed and was not sent, the answer says `tree_needed: true`. Send the same call again with `tree`.

**No credentials in the archive.** The hub reads every file of the tree and the patch. A file that looks like a credential is left out and named in `refused[]`. That covers `.env` files, private keys, tokens and passwords written into the code. The hub also writes a line into the run's log naming it. The rest is kept.

**Size.** The gzipped tree is at most 16 MiB, and the patch 2 MiB. A larger tree is `413`; send the identity and the patch alone. Files the runner left out for size are listed in `skipped[]`.

The identity is recorded once. The same commit again adds what is missing. Another commit is `409`. A claimed run takes this call only from the credential that claimed it. Any other run takes it from a credential that may write it.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Request body: `application/json`, required.

Responses:

- `200`: The run's code as the hub now holds it.
- `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`: The tree or the patch is over its size cap. Nothing was stored.
- `422`: Request failed validation.

## GET /v1/runs/{run_id}/code/diff

`getRunCodeDiff` · scope `key:read` · What changed in the code between this run and another

A unified diff of the code this run trained from against another run's. `against` defaults to the run's parent. Each side is its commit with its uncommitted patch applied, so a change that was never committed still shows. Such a file says `uncommitted: true`.

`source` says where the diff was read. `archive` reads the two archives on the hub. `github` asks GitHub to compare the two commits through a connection that covers the repo. GitHub cannot see uncommitted changes, so `auto` (the default) reads the archives when both runs have one. It asks GitHub otherwise. When neither works, `files` is empty and `reason` says why.

At most 300 files and 512 KiB of diff text are returned. `truncated` says when more changed. Both runs must be visible to the caller. A run you cannot see is `404`.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).
- `against` (query): The run to compare with. Defaults to this run's parent.
- `source` (query)

Responses:

- `200`: The diff, or the reason there is none.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).

## GET /v1/runs/{run_id}/code/files

`getRunCodeFile` · scope `key:read` · Read a file, or list a folder, of the code a run trained from

A file as the run saw it: the commit's file with the run's uncommitted patch applied. An empty `path` or a folder lists its entries instead. The archive answers when the run has one. GitHub answers otherwise, through a connection that covers the repo. A text file is returned up to 256 KiB, and `truncated` says when it is longer. A binary file has no `text`. Same visibility as `getRun`.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).
- `path` (query): A path inside the repo, such as `envs/rewards.py`. Empty is the root.

Responses:

- `200`: The file, or the folder's entries.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).

## GET /v1/runs/{run_id}/curves

`getRunCurves` · scope `key:read` · A run's learning curves, decimated, with its parent's and a summary of each

The series a run page charts and an agent reads, from the run's `metrics.jsonl`. Two logger vocabularies map to one set of names. Isaac Lab's rsl_rl writes `Train/mean_reward`, `Episode_Reward/<term>` and `Episode_Termination/<cause>`. The hub's MuJoCo trainer writes `episode_return`, `r_<term>` and the same termination names. Both become `return`, `reward/<term>` and `termination/<cause>`, and `source_key` keeps the logged name. LeRobot's trainer writes `loss` and `grad_norm`. They are the curves of an imitation or VLA run. The full map is in the API guide, "Run curves".

Each series is decimated by min/max buckets to at most `max_points` points. Every point is a real logged value, and `downsample` says whether any were dropped. A reward term carries its weight from the resolved config, and whether the logged values include it. With `parent=true` the parent's series come along on the same iteration axis. The parent is `parent_run_id`, or the parent a campaign round declared.

`summary` gives each series its last value, the slope over the last 10% of iterations, whether that is a plateau, and the change against the parent at a common iteration. `gates_by_step` joins the sim tests the run's checkpoints got while it trained. `flags` names patterns worth a look, such as a return that keeps rising while sim tests stay flat. Same visibility as `getRun`. A parent the caller cannot see contributes nothing, and `parent_reason` says so.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).
- `keys` (query): Comma-separated series to return, by the hub's name (`return`, `reward/action_rate`) or by the logged name (`Train/mean_reward`). Default: every known series the log carries.
- `max_points` (query): The most points per series, after min/max decimation.
- `parent` (query): Include the parent run's series, its sim tests by step, and the comparison.

Responses:

- `200`: The curves, their summaries, the sim tests by step and the flags.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).

## GET /v1/runs/{run_id}/evals

`getRunEvals` · scope `key:read` · A run's offline evaluation on its held-out episodes

Each checkpoint's action error on the episodes the run held out of training. The LeRobot templates (`act`, `diffusion`, `smolvla_lora`) score every checkpoint as it is saved and append the scores to the run's `metrics.jsonl` under an `eval` key. This reads them back: the curve, the per-checkpoint table with the worst episode, the checkpoint being scored now and how far it got, and the first, latest and best scores.

Same visibility as `getRun`. A run that holds nothing out, or whose template does not score its checkpoints, answers 200 with empty lists and a `reason`.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Responses:

- `200`: The held-out split, the scores and the progress.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).

## POST /v1/runs/{run_id}/fork

`forkRun` · scope `key:train` · Start a child of a run with one declared change

A child run that resumes from one of this run's checkpoints with ONE resolved-config key changed. The hub composes the child's recipe from the parent's: the same template, robot, dataset, hyperparameters and sim tests, then the one change. It records the change on `recipe.fork`, sets `parent_run_id` and `recipe.parent_checkpoint_step`, and creates the run the way `createRun` does. The same quota, spend hold, `Idempotency-Key` and executor rules apply.

The hub checks the change against the parent before anything runs. It maps the config path to the hyperparameter the template reads, and diffs the planned child against the parent with the campaign rule's arithmetic. Exactly the declared key may move. A key the template never reads, a value equal to the parent's, or a contract change on a resume from weights is `422`. An unpublished step is `422`.

A run that belongs to a campaign round is `409`. Its next experiment is the campaign's next round (`createRound`), where the campaign's rules, locked gates and experiment cards apply. `dry_run=true` composes the child and creates nothing. It answers `200` with the recipe, the change and, in `refusals`, every reason the real call would refuse.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).
- `dry_run` (query): Compose and check the child, record nothing.
- `Idempotency-Key` (header): Same meaning as on `createRun`. The same key and body within 24 h return the same run.

Request body: `application/json`, required.

Responses:

- `200`: A dry run, or a replay of an `Idempotency-Key` that already created this child.
- `201`: The child run, queued.
- `202`: Held for a person's confirmation. The key is marked as an AI agent's, and the work would spend beyond the free hosted allowance. Nothing started, and nothing is reserved yet. A person approves or denies the hold from the Inbox. Poll `getSpendHold` with the hold's id.
- `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`: The account's daily GPU-hour quota or its spend cap, as on `createRun`. Nothing was recorded.
- `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.

## POST /v1/runs/{run_id}/promote

`promoteCheckpoint` · scope `key:write` · Publish one of a run's checkpoints as its policy

Copies the policy file of `checkpoints/step_N/` to the root of the run's output model repo, where the policy lives. The file keeps its name. The hub links the root path to the same stored bytes, so nothing is uploaded. It records the step on `ModelMeta.checkpoint_step`.

The model card stays as it is when the run already published one. Otherwise the hub writes it from the run's recipe: the method, the robot, the run as `source_run_id` and the method's control class.

The run must have published that checkpoint with exactly one policy file, or the answer is `422`. A run with no output repo is `409`. The caller must be able to write the output repo. Promoting the same step twice is `200` with the same answer. A promoted checkpoint stays in `checkpoints/`.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Request body: `application/json`, required.

Responses:

- `200`: The checkpoint is the policy.
- `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/runs/{run_id}/compare

`compareCheckpoints` · scope `key:read` · Two checkpoints side by side, as the hub measured them

Checkpoint A is this run at `step`. Checkpoint B is `other_run_id` at `other_step`, which may be the same run. The answer puts their sim tests side by side, test by test, with each test's `measured_pct`. It adds the return and the reward terms at those two iterations from each run's `metrics.jsonl`, ranked by how much each term moved. It adds the resolved-config diff from run A to run B. When B is a fork of A at `step` with an experiment card, `prediction` scores the card against these numbers. Nothing is stored.

A checkpoint's sim test is its latest finished gate at that step, else the latest band scan's. `table` renders the comparison as one text table of at most 4,000 characters for an agent or a terminal. Both runs must be visible: a run the caller cannot see is `404`, the same answer as a missing one.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).
- `step` (query, required): Checkpoint A's step on this run.
- `other_run_id` (query, required): Checkpoint B's run. It may be this run.
- `other_step` (query, required): Checkpoint B's step.

Responses:

- `200`: The comparison.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).
- `422`: Request failed validation.

## GET /v1/runs/{run_id}/checkpoints

`listRunCheckpoints` · scope `key:read` · List a run's checkpoints

Checkpoints are ordinary repo files under `checkpoints/step_{N}/` in the run's output model repo. This lists them grouped by step, read from that repo's own file rows. There is no separate checkpoint store. A checkpoint downloads through `presignDownload` on the repo like any other file. A run with no output repo yet (queued, or running and not past its first checkpoint) answers an empty list with `repo: null`. **Listed while the run trains:** the runner publishes every `checkpoints/step_{N}/` the template writes as soon as it is complete. For an ONNX-shaped template, each step holds **exactly one `*.onnx` stamped with `lucen_manifest`** beside the framework checkpoint (`model_{N}.pt` for rsl_rl). The progress report that first publishes sets `output_model_repo`, so this list grows during training. Steps appear in order and are never rewritten (content addressing dedupes unchanged bytes). `published_at`: when the step's last file landed.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Responses:

- `200`: Checkpoints by step, oldest first.
- `401`: Missing or invalid credentials.
- `403`: Authenticated but not allowed (visibility, membership or scope).
- `404`: Resource not found (or hidden from the caller).

## GET /v1/runs/{run_id}/job

`getRunJobInputs` · scope `key:write` · The inputs a runner needs to start a claimed job

A runner calls this right after it claims a job (`recipe.template: custom`). The answer holds a download URL for the project snapshot, valid for one hour, and the run's output repo. `hf_token` is the owner's Hugging Face token. It is present only when the job asked for it with `use_hf_token` and the owner connected Hugging Face.

Only the credential that claimed the run may call this, while the run is `running`. Any other caller, or a run that is not a job, is `409`.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Responses:

- `200`: What the runner needs.
- `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, ...).

## POST /v1/runs/{run_id}/claim

`claimRun` · scope `key:train` · Claim a queued worker run (self-hosted runner protocol)

Compare-and-set `queued → running` on a run whose `executor` is `worker`. Exactly one caller wins. A run that is already claimed, is terminal, or is not a `worker` run answers `409`. A claim may name the executor it serves (`executor: worker`, as a self-hosted runner does). That claim is `409` for a run on another executor. The set checks the executor too. So a run that `moveRun` moved to hosted compute is never also claimed by a runner.

Records `claimed_by`, `claimed_at`, `started_at` and the first `heartbeat_at`, writes an audit row, and returns the run. Its recipe, `parent_run_id` and owner are what a runner needs to assemble the template's inputs. `key:train` because a runner spends the owner's compute on the owner's behalf. The run must be visible to the credential (own, or an org it belongs to). An invisible run is `404`. The claim records the claiming credential. Only that credential may `reportRun` afterwards (`409` for anyone else).

**Lease**: every report renews `heartbeat_at`. A periodic sweep re-queues a `running` run whose heartbeat is older than the hub's lease (`RUN_LEASE_SECONDS`, default 300 s). The run goes back to `queued`, its claim fields are cleared and its partial metrics are dropped. A `stderr` notice goes into its log. So a dead runner never strands a run, and the dead runner's next report is `409`.

**Re-claim after preemption.** Modal restarts a preempted input in a new container under the same function call. A claim on a `running` `modal` run can then succeed instead of getting `409`. Its `modal_call_id` must equal the run's own, and its credential must be the one that claimed the run. The new claimer's name replaces `claimed_by`, and the heartbeat is renewed. `started_at` is unchanged, so billing is unchanged too. `resume_step` is where the template restarts: a checkpoint step this run already published, or null. The lost attempt's metrics past it are dropped. A `stderr` notice lands in the log and `run.reclaim` is audited. Every other claim on a non-`queued` run is still `409`.

**A hosted run's first claim.** A queued `modal` run is claimed only by the key the hub minted for its job. The hub hands that key to the run's container. Any other key is `403` with `errors[].type: forbidden.hosted_run_claim` when `executor` is left out or is `modal`. With `executor: worker` the claim is `409` first. A run no user could hold a key for is claimed with the operator's own key, and only with it. The operator is a user on `ISAAC_OPERATOR_OWNERS`, or a member of an org on it.

**A `cloud` run's re-claim** follows the same rule under the SkyPilot managed job's name. The hub also asks SkyPilot whether it replaced the VM: the job's recovery count must cover every VM the run has had. When SkyPilot cannot be asked, the re-claim is `503` with `Retry-After` and the run is left as it was. The VM retries, or the lease sweep ends the run. The new VM's price comes only from SkyPilot's record of the job.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Request body: `application/json`, required.

Responses:

- `200`: Claimed; the run as it now stands.
- `401`: Missing or invalid credentials.
- `403`: Not allowed. A queued `modal` run claimed by any key but its job's own is `forbidden.hosted_run_claim`. A run no user holds takes the operator's key instead. A hosted job's key used for another run is `403` too.
- `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 `cloud` run's re-claim while SkyPilot cannot be asked whether it replaced the VM. Nothing changed. `Retry-After` says when to try again.

## POST /v1/runs/{run_id}/report

`reportRun` · scope `key:train` · Report progress or a terminal state for a claimed run

The runner's one write path after `claimRun`. The run must be `running` (`409` otherwise). Every field is optional and additive:

- `log_chunk` (≤ 256 KiB of UTF-8) is stored as one object under `runs/{run_id}/logs/`, and `logs_key` becomes that prefix.
- `metrics` lines are appended to `runs/{run_id}/metrics.jsonl`. The last one is echoed on the run as `latest_metrics`.
- `config_yaml` (the **resolved** config) and `scorecard_json` land at `config_key` / `scorecard_key`, exactly where `importRun` puts them. So the coach reads an executed run and an imported one the same way.
- `output_model_repo` names the model repo the runner published. It must be a model repo the caller can write, else `422`. The runner sends it on the **progress** report that first publishes a checkpoint, and on the terminal report too.

`status` may only move `running → succeeded | failed`, or `running → canceled` **after** the hub set `cancel_requested_at`. A `canceled` nobody asked for is `422`. A terminal report sets `finished_at` and records `cost_usd` (0 for a `worker` run, since the hub billed nothing). It also writes the run's ledger entry and an audit row. Every report refreshes `heartbeat_at` (the lease). The caller must be the credential that claimed the run. Another key gets `409`, and so does a runner whose run was re-queued after a missed lease. Read `cancel_requested_at` on the returned run. When it is set, stop the template and report `canceled`.

**Measurements:** `peak_vram_gb`, `samples_per_s` and `gpu_tier` may ride on any report and are echoed on the run. On a `succeeded` terminal report they also update the hub's rolling measured value for (template, tier, batch size). That value is what makes `recommendRun` prefer measured over modelled next time.

Parameters:

- `run_id` (path, required): Training run id (`run_...`).

Request body: `application/json`, required.

Responses:

- `200`: Recorded; the run 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, metrics batch or artifact is over its size limit, or storing the report would put the run owner past their storage quota. Nothing was stored.
- `422`: Request failed validation.

## GET /v1/hardware_tiers

`listHardwareTiers` · scope `none` · GPU tiers and what an hour on each costs

The tiers `Recipe.gpu` accepts, each with the hourly rate a `modal` run is billed at. **Rates are what you pay, all-in.** The hub's margin is already inside them. `estimateRun` multiplies exactly these rates by the wall-clock cap. `worker` runs are never billed and no tier applies to them. This endpoint is public, so anyone can read the prices without a key. `l40s` is a tier too. The function of one template, `ppo_isaac`, reserves a large CPU host. That template pays for the host on top of the tier. `estimateRun` names the host's rate as `host_rate_usd_per_hour`. `hosting` says who this deployment runs `modal` work for at all (`HOSTED_OWNERS`).

Responses:

- `200`: The tier table.
- `401`: Missing or invalid credentials.

## GET /v1/github/commits

`searchGithubCommits` · scope `key:read` · Search a connected GitHub repo's commits

Searches the commit messages of one GitHub repo, newest first, through a GitHub connection of one of your workspaces that covers it. Each commit lists the runs you can see that trained from it. A repo no connection of yours covers is `404`. `503` means this hub has no GitHub App.

Parameters:

- `repo` (query, required): `owner/name` on GitHub.
- `q` (query): Words to look for in the commit messages. Empty lists the newest commits.
- `limit` (query): Page size.

Responses:

- `200`: The commits.
- `401`: Missing or invalid credentials.
- `404`: Resource not found (or hidden from the caller).
- `502`: GitHub could not be reached or refused the call.
- `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.
