{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/roroquantum-com/json-schema/roroquantum-com-machine-schema.json",
  "title": "Machine",
  "description": "One entry of `GET /v1/machines`. Every field is vendor-neutral except `provider` on brand-kept machines.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/roroquantum-com-openapi.yml#/components/schemas/Machine",
  "type": "object",
  "properties": {
    "targetId": {
      "type": "string",
      "description": "The codename to pass as `machineTargetId` (or `targetId`) when submitting."
    },
    "displayName": {
      "type": "string"
    },
    "provider": {
      "type": "string",
      "description": "`roro` for RoRo's own simulators and for white-labeled partner hardware; the real vendor (`amazon`, `ibm`, `ionq`) for machines that keep their brand."
    },
    "kind": {
      "type": "string",
      "enum": [
        "sim",
        "qpu"
      ],
      "description": "Coarse class: simulator or quantum processor."
    },
    "qubits": {
      "type": "integer",
      "description": "Maximum qubits for this target."
    },
    "costPerShot": {
      "type": "number",
      "format": "double",
      "description": "The catalogue's credits per shot. On a `per-shot` machine a run costs `shots × costPerShot`; on any other `priceModel` the quote is the only price. 0 on RoRo's own simulators; a machine your organization's plan makes free (see `free`) keeps its catalogue rate here, and a run on it charges nothing."
    },
    "free": {
      "type": "boolean",
      "description": "True when a run here charges YOU nothing: RoRo's own simulators (`roro.sim.*`, free by catalogue policy), and machines your organization's plan makes free to its members (an institution's plan can cover cloud simulators, within its own daily allowance; such a run can still be refused once that allowance is used up, and the quote says so). Computed for the organization your runs bill when no workspace is named; a run in another organization's workspace is priced by that organization, and the quote is the authority. Print the word from this flag, never from `costPerShot == 0` (an analog device, or a machine priced by device time, also reports 0)."
    },
    "priceModel": {
      "type": "string",
      "enum": [
        "free",
        "per-shot",
        "per-second",
        "per-job"
      ],
      "description": "How this machine prices a run for you: `free` (whenever `free` is true), `per-shot` (every rate below is 0), `per-second` (a rate per projected quantum-second, usually with a per-job minimum), or `per-job` (a job fee or minimum on top of the per-shot rate). These are RATES; what a run costs is what `POST /v1/runs/quote` answers."
    },
    "costPerSecond": {
      "type": "number",
      "format": "double",
      "description": "Credits per projected quantum-second (0 when the machine has no time rate)."
    },
    "costPerJob": {
      "type": "number",
      "format": "double",
      "description": "Credits added to every job (0 when none)."
    },
    "minJobCredits": {
      "type": "number",
      "format": "double",
      "description": "The least a job costs, in credits (0 when there is no floor)."
    },
    "online": {
      "type": "boolean",
      "description": "True when the target is accepting runs right now."
    },
    "status": {
      "type": "string",
      "enum": [
        "online",
        "offline",
        "busy"
      ],
      "description": "`busy` is an external machine that is queued/inactive/health-degraded — runs may still be accepted."
    },
    "queueDepth": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Jobs ahead on the backend when the machine reports it; null when unknown (simulators)."
    },
    "type": {
      "type": "string",
      "enum": [
        "aer",
        "qsimulator",
        "qtester",
        "qpu"
      ],
      "description": "Machine taxonomy: aer = instant local simulator, qsimulator = partner-grade simulator, qtester = hardware test device, qpu = real quantum processor."
    },
    "modality": {
      "type": "string",
      "enum": [
        "simulator",
        "superconducting",
        "trapped-ion",
        "neutral-atom"
      ],
      "description": "The physics of the device."
    },
    "connectivity": {
      "type": "string",
      "enum": [
        "all-to-all",
        "nearest-neighbour",
        "programmable",
        "limited"
      ],
      "description": "Coarse qubit-connectivity class (the coupling map of a brand-kept machine is on its properties)."
    },
    "nativeGates": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The gate basis the hardware physically executes (informational — the server transpiles your circuit down to it)."
    },
    "availability": {
      "type": "string",
      "description": "A one-line",
      "vendor-neutral availability note.": null
    },
    "analog": {
      "type": "boolean",
      "description": "Always false on this list — analog (Hamiltonian-schedule) devices cannot run QASM and are not offered here."
    },
    "resilience": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "readout",
          "zne",
          "dd",
          "twirling"
        ]
      },
      "description": "Error-mitigation methods a run on this machine may request right now (`resilience` on a run). Empty when none — `resilienceNote` says why."
    },
    "resilienceNote": {
      "type": "string",
      "description": "Why nothing is offered (e.g. an exact simulator has no readout error to mitigate), or a note on what is (e.g. a layout hint is advisory). Empty when there is nothing to add."
    },
    "resilienceState": {
      "type": "string",
      "enum": [
        "offered",
        "switched-off-by-operator",
        "not-offered"
      ],
      "description": "`offered`; `switched-off-by-operator` (available on this class of machine, switched off right now); `not-offered` (does not apply here)."
    },
    "resilienceMaxEffectiveShots": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The most shot-equivalents one resilience run may bill here; null when nothing is offered."
    },
    "calibration": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/$defs/MachineCalibration"
        }
      ],
      "description": "The provider's own published calibration summary. Present only for brand-kept machines whose provider publishes one (today `ibm`) and only once it has been read; the key is absent otherwise."
    }
  },
  "$defs": {
    "MachineCalibration": {
      "type": "object",
      "description": "Calibration summary as the provider publishes it (brand-kept machines only). Figures are refreshed by a periodic sync; `syncedAt` is when they were last actually read — a figure the provider stopped reporting keeps its old timestamp.",
      "properties": {
        "processorType": {
          "type": [
            "string",
            "null"
          ],
          "description": "Processor family and revision."
        },
        "twoQubitErrorMedian": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "description": "Median two-qubit gate error, as a fraction (0.0035 = 0.35 %)."
        },
        "readoutErrorMedian": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "description": "Median readout (measurement) error, as a fraction."
        },
        "syncedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When these figures were last read from the provider."
        }
      }
    }
  }
}