{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flopsindex-com/json-schema/flopsindex-com-cpucontract-submission-schema.json",
  "title": "CPUContractSubmission",
  "description": "Contract / lease rate row — annex §2, feeds CLRI-CPU.\n\nOne record per contract executed or renewed.",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flopsindex-com-openapi.json#/components/schemas/CPUContractSubmission",
  "properties": {
    "asset_ownership": {
      "anyOf": [
        {
          "$ref": "#/$defs/AssetOwnership"
        },
        {
          "type": "null"
        }
      ],
      "description": "Who owns the silicon. 'owner' = primary observation. Omitted is treated as 'orchestrator' (fail-closed) and the row is held out of published index math."
    },
    "underlying_provider": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 128
        },
        {
          "type": "null"
        }
      ],
      "title": "Underlying Provider",
      "description": "Whose hardware this actually is, when asset_ownership != owner. Use 'undisclosed' if contractually unnameable."
    },
    "operator_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Operator Id"
    },
    "cpu_sku": {
      "type": "string",
      "title": "Cpu Sku",
      "description": "Processor family if known (amd_epyc, intel_xeon_scalable, x86_mixed)."
    },
    "cpu_model_raw": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 256
        },
        {
          "type": "null"
        }
      ],
      "title": "Cpu Model Raw",
      "description": "Verbatim contributor string, kept for triage when the SKU is unmapped."
    },
    "core_count_contracted": {
      "type": "integer",
      "maximum": 2000000.0,
      "minimum": 1.0,
      "title": "Core Count Contracted",
      "description": "vCPU count in this contract or VM configuration (NOT physical cores)."
    },
    "ram_gb_contracted": {
      "type": "number",
      "maximum": 1000000.0,
      "minimum": 0.0,
      "title": "Ram Gb Contracted"
    },
    "storage_tb_contracted": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Storage Tb Contracted"
    },
    "rate_per_core_hour_usd": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 10000.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Rate Per Core Hour Usd",
      "description": "USD per vCPU-hour (annex naming says 'core'; the unit is vCPU)."
    },
    "rate_per_vm_config_month_usd": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 10000000.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Rate Per Vm Config Month Usd",
      "description": "USD per VM configuration per month."
    },
    "vm_config": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Vm Config",
      "description": "{cores, ram_gb, storage_tb, gpu_count}. Required with the monthly rate."
    },
    "contract_term_months": {
      "type": "integer",
      "maximum": 120.0,
      "minimum": 1.0,
      "title": "Contract Term Months",
      "description": "1 for on-demand; 3/6/12/24/36 for term contracts."
    },
    "region": {
      "$ref": "#/$defs/Region"
    },
    "contract_start_date": {
      "type": "string",
      "title": "Contract Start Date",
      "description": "YYYY-MM-DD"
    },
    "rate_includes_support": {
      "type": "boolean",
      "title": "Rate Includes Support",
      "description": "True if managed support or SLA is bundled into the rate."
    },
    "rate_includes_power": {
      "type": "boolean",
      "title": "Rate Includes Power",
      "description": "True if power costs are included."
    },
    "workload_class": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "web_app",
            "database",
            "batch_compute",
            "ai_inference",
            "storage_io",
            "general"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Workload Class"
    },
    "currency": {
      "type": "string",
      "maxLength": 3,
      "minLength": 3,
      "title": "Currency",
      "default": "USD"
    },
    "fx_rate_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fx Rate Date",
      "description": "YYYY-MM-DD of the FX rate used, if the contributor converted before sending."
    },
    "contract_end_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Contract End Date",
      "description": "YYYY-MM-DD"
    },
    "is_renewal": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Renewal",
      "description": "True if this renews an existing contract rather than a new one."
    },
    "replaces_contract_ref": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 128
        },
        {
          "type": "null"
        }
      ],
      "title": "Replaces Contract Ref",
      "description": "Contributor's opaque reference to the prior contract, to link a renewal chain."
    },
    "rate_compute_only_usd": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 10000.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Rate Compute Only Usd",
      "description": "Per-vCPU-hour rate with managed support/SLA stripped out. Lets a bundled retail contributor also feed the headline lease-rate series."
    },
    "source_type": {
      "$ref": "#/$defs/SourceType",
      "default": "b2b"
    },
    "submission_source": {
      "$ref": "#/$defs/SubmissionSource",
      "default": "manual"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "cpu_sku",
    "core_count_contracted",
    "ram_gb_contracted",
    "contract_term_months",
    "region",
    "contract_start_date",
    "rate_includes_support",
    "rate_includes_power"
  ],
  "$defs": {
    "AssetOwnership": {
      "type": "string",
      "enum": [
        "owner",
        "orchestrator",
        "reseller",
        "broker"
      ],
      "title": "AssetOwnership",
      "description": "Who actually owns the silicon behind a submitted row.\n\nThis exists because the first CPU contributor (Lyrid) is an\nORCHESTRATOR — it manages capacity it does not own. That distinction\nis not cosmetic: if an orchestrator reports cores that physically sit\nin a cloud FLOPS already collects directly, naive aggregation\ndouble-counts the same hardware, and a price row from an orchestrator\nis a resale margin on top of an underlying rate, not a primary rate.\n\nOnly ``OWNER`` rows are primary observations. Everything else carries\n``attribution_risk`` and is held out of published index math until an\nexplicit de-duplication rule exists (see docs/methodology)."
    },
    "Region": {
      "type": "string",
      "enum": [
        "us_east",
        "us_west",
        "eu_west",
        "ap_southeast",
        "africa",
        "global"
      ],
      "title": "Region"
    },
    "SourceType": {
      "type": "string",
      "enum": [
        "public",
        "b2b",
        "corporate"
      ],
      "title": "SourceType",
      "description": "Determines weight in FLCI/CLRI weighted median calculation."
    },
    "SubmissionSource": {
      "type": "string",
      "enum": [
        "manual",
        "agent_v1",
        "sdk"
      ],
      "title": "SubmissionSource",
      "description": "Tracks how a fleet submission was generated for validation tuning."
    }
  }
}