{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://medgauge.org/schemas/0.1.0/model.schema.json",
  "title": "model",
  "description": "A model entry (model registry): vendor, display name, snapshots and access route.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9.-]+$"
    },
    "vendor": {
      "type": "string",
      "minLength": 1
    },
    "display_name": {
      "type": "string",
      "minLength": 1
    },
    "snapshots": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "access": {
      "type": "string",
      "enum": [
        "api",
        "open_weights",
        "partner_only",
        "session_only"
      ]
    },
    "pricing_ref": {
      "type": "object",
      "properties": {
        "input_usd_per_m": {
          "type": "number",
          "minimum": 0
        },
        "output_usd_per_m": {
          "type": "number",
          "minimum": 0
        },
        "cached_input_usd_per_m": {
          "type": "number",
          "minimum": 0
        },
        "as_of": {
          "type": "string",
          "format": "date"
        },
        "source_url": {
          "type": "string"
        }
      },
      "required": [
        "as_of",
        "source_url"
      ],
      "additionalProperties": false
    },
    "context_window": {
      "type": "integer",
      "minimum": 1
    },
    "notes": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "vendor",
    "display_name",
    "snapshots",
    "access"
  ]
}
