{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://llmpricing.site/data/models.schema.json",
  "title": "LLM Pricing normalized model catalog",
  "description": "A conservative contract for the stable core of /data/models.json. Optional provider-specific and experimental fields may be present. Missing or null prices are not evidence of free service; verify billing with the provider.",
  "type": "array",
  "items": {
    "$ref": "#/$defs/model"
  },
  "$defs": {
    "nullableNumber": {
      "type": [
        "number",
        "null"
      ]
    },
    "model": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "provider",
        "providerSlug",
        "name",
        "displayName",
        "mode",
        "pricing",
        "limits",
        "capabilities",
        "modalities",
        "endpoints",
        "lifecycle",
        "source",
        "rawLitellm"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique catalog route identifier, not necessarily the raw provider API model ID."
        },
        "slug": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "providerSlug": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Catalog model name; use source data to confirm exact API model IDs."
        },
        "displayName": {
          "type": "string"
        },
        "mode": {
          "type": "string"
        },
        "pricing": {
          "$ref": "#/$defs/pricing"
        },
        "limits": {
          "$ref": "#/$defs/limits"
        },
        "capabilities": {
          "$ref": "#/$defs/capabilities"
        },
        "modalities": {
          "$ref": "#/$defs/modalities"
        },
        "endpoints": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "lifecycle": {
          "type": "object"
        },
        "source": {
          "$ref": "#/$defs/source"
        },
        "rawLitellm": {
          "type": "object",
          "description": "Unnormalized source fields; keys and types vary by model."
        },
        "identity": {
          "type": "object"
        },
        "route": {
          "type": "object"
        },
        "nativeBilling": {
          "type": "object"
        },
        "localMeta": {
          "type": "object"
        },
        "benchmarks": {
          "type": "object"
        }
      },
      "additionalProperties": true
    },
    "pricing": {
      "type": "object",
      "description": "Prices are normalized to USD per stated unit only where applicable. Null or omitted values are not zero. Conditional/region-specific rules may require raw sources.",
      "properties": {
        "inputUsdPer1MTokens": {
          "$ref": "#/$defs/nullableNumber"
        },
        "outputUsdPer1MTokens": {
          "$ref": "#/$defs/nullableNumber"
        },
        "cachedInputUsdPer1MTokens": {
          "$ref": "#/$defs/nullableNumber"
        },
        "cacheWriteUsdPer1MTokens": {
          "$ref": "#/$defs/nullableNumber"
        },
        "embeddingUsdPer1MTokens": {
          "$ref": "#/$defs/nullableNumber"
        },
        "cacheWritePriceStatus": {
          "$ref": "#/$defs/cachePriceStatus"
        },
        "cachedInputPriceStatus": {
          "$ref": "#/$defs/cachePriceStatus"
        },
        "pricingCheckedAt": {
          "type": "string"
        },
        "rawPricing": {
          "type": "object"
        }
      },
      "additionalProperties": true
    },
    "cachePriceStatus": {
      "type": "string",
      "enum": [
        "not_provided",
        "positive_raw_price",
        "zero_raw_unclassified",
        "free",
        "same_as_input"
      ]
    },
    "limits": {
      "type": "object",
      "description": "Context and other limits, when known. Null is not a zero limit.",
      "properties": {
        "contextWindow": {
          "$ref": "#/$defs/nullableNumber"
        },
        "maxInputTokens": {
          "$ref": "#/$defs/nullableNumber"
        },
        "maxOutputTokens": {
          "$ref": "#/$defs/nullableNumber"
        },
        "maxTokens": {
          "$ref": "#/$defs/nullableNumber"
        }
      },
      "additionalProperties": true
    },
    "capabilities": {
      "type": "object",
      "description": "Capability flags are optional and should not be inferred from mode or name.",
      "properties": {
        "functionCalling": {
          "type": "boolean"
        },
        "vision": {
          "type": "boolean"
        },
        "reasoning": {
          "type": "boolean"
        },
        "responseSchema": {
          "type": "boolean"
        },
        "promptCaching": {
          "type": "boolean"
        },
        "raw": {
          "type": "object"
        }
      },
      "additionalProperties": true
    },
    "modalities": {
      "type": "object",
      "properties": {
        "supported": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "input": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "output": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": true
    },
    "source": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "litellmKey": {
          "type": "string"
        },
        "syncedAt": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string"
        },
        "modelSourceUrl": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  }
}
