{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amplerun-com/json-schema/amplerun-com-offer-summary-schema.json",
  "title": "OfferSummary",
  "description": "No host management address is ever exposed. gpu_count, model and vram_bytes come from the machine manifest; vram_bytes is per GPU and is absent when the GPUs differ or memory was not measured. region, ram_bytes and disk_bytes are absent when the host did not measure them, never 0.",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amplerun-com-openapi.json#/components/schemas/OfferSummary",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "offer_id",
    "machine_id",
    "observed_at",
    "offer_version",
    "readiness",
    "total_rate_micro_per_hour",
    "included_quotas",
    "available_from",
    "available_until",
    "maintenance_windows",
    "expected_version"
  ],
  "properties": {
    "offer_id": {
      "$ref": "#/$defs/UUID"
    },
    "machine_id": {
      "$ref": "#/$defs/UUID"
    },
    "observed_at": {
      "$ref": "#/$defs/Rfc3339Utc"
    },
    "offer_version": {
      "$ref": "#/$defs/DecimalString"
    },
    "expected_version": {
      "$ref": "#/$defs/DecimalString"
    },
    "readiness": {
      "enum": [
        "ready",
        "provisioning",
        "unavailable"
      ]
    },
    "total_rate_micro_per_hour": {
      "$ref": "#/$defs/MicroAmount"
    },
    "included_quotas": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "included_disk_gib",
        "included_egress_gib"
      ],
      "properties": {
        "included_disk_gib": {
          "type": "integer",
          "minimum": 0
        },
        "included_egress_gib": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "available_from": {
      "$ref": "#/$defs/Rfc3339Utc"
    },
    "available_until": {
      "$ref": "#/$defs/Rfc3339Utc"
    },
    "maintenance_windows": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "starts_at",
          "ends_at",
          "reason"
        ],
        "properties": {
          "starts_at": {
            "$ref": "#/$defs/Rfc3339Utc"
          },
          "ends_at": {
            "$ref": "#/$defs/Rfc3339Utc"
          },
          "reason": {
            "type": "string"
          }
        }
      }
    },
    "gpu_count": {
      "type": "integer",
      "minimum": 1
    },
    "model": {
      "type": "string"
    },
    "vram_bytes": {
      "$ref": "#/$defs/DecimalString"
    },
    "region": {
      "type": "string"
    },
    "country": {
      "type": "string",
      "pattern": "^[A-Z]{2}$",
      "description": "Additive. ISO 3166-1 alpha-2 country of the machine, read by the controller from the agent's request country as reported by the trusted proxy (never from host input). Absent when unknown."
    },
    "continent": {
      "$ref": "#/$defs/Continent"
    },
    "ram_bytes": {
      "$ref": "#/$defs/DecimalString"
    },
    "disk_bytes": {
      "$ref": "#/$defs/DecimalString"
    },
    "measured_bandwidth_mbps": {
      "type": "integer",
      "minimum": 0,
      "description": "netfacts lane. Measured DOWNLOAD rate in Mbps; additive. Absent = never measured (never 0)."
    },
    "net_up_mbps": {
      "type": "integer",
      "minimum": 0,
      "description": "netfacts lane. Measured UPLOAD rate in Mbps; rides the same measurement as measured_bandwidth_mbps."
    },
    "net_latency_ms": {
      "type": "integer",
      "minimum": 0,
      "description": "netfacts lane. Median HTTPS latency in ms from the same measurement."
    },
    "speedtest_at": {
      "$ref": "#/$defs/Rfc3339Utc",
      "description": "netfacts lane. When the current net facts were measured; renders 'measured N ago' honestly."
    },
    "tflops_bf16": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "AI Speed. Measured dense BF16 matmul TFLOPS per GPU (the MIN across the machine's GPUs); additive. Absent = never measured (never 0)."
    },
    "tflops_total": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "AI Speed. tflops_bf16 x gpu_count, computed, one decimal. Absent with tflops_bf16 or gpu_count."
    },
    "mem_bw_gbps": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "AI Speed. Measured device memory bandwidth in GB/s per GPU (the MIN across the machine's GPUs). Absent = never measured (never 0)."
    },
    "ai_speed": {
      "type": "integer",
      "minimum": 1,
      "description": "AI Speed. round(100*sqrt((tflops_bf16/165.2)*(mem_bw_gbps/1008))); RTX 4090 = 100. Absent unless both figures were measured."
    },
    "bench_at": {
      "$ref": "#/$defs/Rfc3339Utc",
      "description": "AI Speed. When the current figures were measured."
    },
    "bench_flag": {
      "type": "string",
      "enum": [
        "unverified_spec"
      ],
      "description": "AI Speed. The GPU has no datasheet row to check the figures against."
    },
    "disk_free_bytes": {
      "$ref": "#/$defs/DecimalString",
      "description": "Additive. Free disk space in bytes from the machine's latest telemetry sample. Absent when there is no sample, the sample is older than 60 seconds (2x the 30 s heartbeat, the host console STALE_AFTER_S rule) or the agent did not report it; never 0 as a stand-in."
    },
    "uptime_s": {
      "$ref": "#/$defs/DecimalString",
      "description": "Additive. Seconds since the machine booted, from the latest telemetry sample. Absent under the same rules as disk_free_bytes."
    },
    "gpu_utilization_pct": {
      "type": "number",
      "minimum": 0,
      "maximum": 100,
      "description": "Additive. Live GPU load, the PEAK across the machine's devices, from the latest telemetry sample. Absent under the same rules as disk_free_bytes, and when no device reported utilisation. 0 means measured idle."
    },
    "telemetry_at": {
      "$ref": "#/$defs/Rfc3339Utc",
      "description": "Additive. observed_at of the telemetry sample disk_free_bytes, uptime_s and gpu_utilization_pct came from. Present only with at least one of them; absent whenever they are."
    },
    "template_compatibility": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "manifest_hash": {
      "$ref": "#/$defs/Sha256Hash"
    },
    "fit": {
      "$ref": "#/$defs/TemplateFit",
      "description": "D-19(c). Present only when the request carried template_id; computed server-side from the template vram_fit against measured device VRAM."
    },
    "fits_template_ids": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UUID"
      },
      "description": "Additive. Present only when the request carried fits_for=all; the ids of every published template that fits this offer (the same rule as fit)."
    },
    "platform_fee_bps": {
      "type": "integer",
      "minimum": 0,
      "description": "Additive. Platform fee frozen into this offer version, in basis points (500 = 5%), taken out of each charge."
    },
    "verification_level": {
      "enum": [
        "unverified",
        "auto_verified",
        "manually_verified"
      ],
      "description": "Additive. How the machine's hardware claims were verified."
    },
    "admitted": {
      "type": "boolean",
      "description": "Additive. Whether the machine has passed admission (a passed qualification for its current manifest). false is an unverified listing: shown in the catalog, never quoted or reserved (409 CONFLICT)."
    },
    "tier": {
      "enum": [
        "container",
        "inference"
      ],
      "description": "Additive (D-23). container: SSH containers under the launch profile. inference: managed models on a signed, hash-pinned runtime with no renter code, reached over the host's outbound session (community inference: don't send sensitive data)."
    },
    "backends": {
      "description": "Additive. Backends the machine's devices serve, in preference order (cuda > rocm > sycl > vulkan > metal). A template runs here with the first one it has a runtime for.",
      "type": "array",
      "items": {
        "enum": [
          "cuda",
          "rocm",
          "sycl",
          "vulkan",
          "metal"
        ]
      }
    },
    "reliability": {
      "description": "Additive. Approximate reliability score from machine fields only (no per-job joins on the catalog path).",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "score",
        "stars",
        "band",
        "approximate"
      ],
      "properties": {
        "score": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "stars": {
          "type": "string"
        },
        "band": {
          "type": "string"
        },
        "approximate": {
          "type": "boolean"
        }
      }
    },
    "availability_class": {
      "$ref": "#/$defs/AvailabilityClass"
    },
    "preemption_notice_s": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 3600
        },
        {
          "type": "null"
        }
      ],
      "description": "D-22. Notice in seconds (SIGTERM plus /work/.amplerun-preempt) before the host stops an interruptible rental; null for dedicated."
    },
    "interruption_estimate": {
      "description": "D-22. Present for interruptible offers (horizon 4 h in the catalog); null for dedicated.",
      "anyOf": [
        {
          "$ref": "#/$defs/InterruptionEstimate"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "AvailabilityClass": {
      "type": "string",
      "enum": [
        "dedicated",
        "interruptible"
      ],
      "description": "D-22. dedicated (the default) is never preempted. interruptible is sold only from idle or co-listed hosts: the host may take the machine back after preemption_notice_s seconds of notice, and billing stops at the notice."
    },
    "Continent": {
      "description": "Additive. Continent derived from country: AF Africa, AN Antarctica, AS Asia, EU Europe, NA North America, OC Oceania, SA South America. Absent when the country is unknown.",
      "enum": [
        "AF",
        "AN",
        "AS",
        "EU",
        "NA",
        "OC",
        "SA"
      ]
    },
    "DecimalString": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)$",
      "description": "Unsigned base-10 integer as string; never a float."
    },
    "InterruptionEstimate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "runs",
        "uninterrupted",
        "horizon_h",
        "computed_at",
        "summary"
      ],
      "description": "D-22, interruptible offers only. Plain observed counts, never a prediction. A run is one continuous period in which the host reported the machine offerable (from heartbeats); it counts when it ended, or has already lasted horizon_h. uninterrupted is null below the sample gate (20 runs): not enough history.",
      "properties": {
        "runs": {
          "type": "integer",
          "minimum": 0,
          "description": "Most recent decided runs counted (at most 40)."
        },
        "uninterrupted": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ],
          "description": "Of those runs, how many lasted horizon_h without interruption; null below the sample gate."
        },
        "horizon_h": {
          "type": "integer",
          "minimum": 1
        },
        "computed_at": {
          "$ref": "#/$defs/Rfc3339Utc"
        },
        "summary": {
          "type": "string",
          "description": "The counts in words, e.g. \"34 of the last 40 runs lasted 4 h without interruption\" or \"Not enough history (12 runs so far)\"."
        }
      }
    },
    "MicroAmount": {
      "$ref": "#/$defs/DecimalString",
      "description": "Money in micro-units of the settlement asset as a base-10 integer string (\"5000000\" is 5 USDC). Never a float."
    },
    "Rfc3339Utc": {
      "type": "string",
      "format": "date-time",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z$"
    },
    "Sha256Hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "TemplateFit": {
      "description": "D-19(c) per-offer fit verdict for a template, computed server-side from vram_fit against measured device VRAM. reason is human-readable and non-empty when fits is false.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "fits",
        "reason"
      ],
      "properties": {
        "fits": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "UUID": {
      "type": "string",
      "format": "uuid",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
    }
  }
}