{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://codingplans.dev/schemas/model.schema.json",
  "title": "Model",
  "description": "A language model with measured benchmarks and published token pricing.",
  "type": "object",
  "required": [
    "id",
    "name",
    "vendor",
    "intelligence_index",
    "intelligence_index_reason",
    "median_speed_tps",
    "is_median_speed_est",
    "ttft_seconds",
    "end_to_end_seconds",
    "context_window",
    "open_weights",
    "cheapest_token_price",
    "cheapest_provider",
    "cost_per_task",
    "source",
    "benchmark_source",
    "pricing_source",
    "source_date"
  ],
  "properties": {
    "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$", "description": "Stable lower-case identifier. Also the anchor of the model on its vendor page; never changes." },
    "name": { "type": "string", "minLength": 1, "description": "Model name as the vendor publishes it." },
    "vendor": { "type": "string", "minLength": 1, "description": "Company that trains the model." },
    "intelligence_index": { "type": ["number", "null"], "minimum": 0, "maximum": 100, "description": "Artificial Analysis Intelligence Index score at the highest measured reasoning effort, copied without rounding; null when unmeasured." },
    "intelligence_index_reason": { "type": ["string", "null"], "description": "Why intelligence_index is null, starting with an em dash." },
    "intelligence_index_version": { "type": ["string", "null"], "pattern": "^[0-9]+(\\.[0-9]+)*$", "description": "AA Intelligence Index version the score was measured on, e.g. 5.0. Null when no score is published for the model." },
    "median_speed_tps": { "type": ["number", "null"], "minimum": 0, "description": "Median output speed in tokens per second (Artificial Analysis); null when unmeasured." },
    "is_median_speed_est": { "type": "boolean", "description": "True when median_speed_tps is an estimate rather than a measurement." },
    "ttft_seconds": { "type": ["number", "null"], "minimum": 0, "description": "Seconds to the first answer token, including thinking time (Artificial Analysis)." },
    "end_to_end_seconds": { "type": ["number", "null"], "minimum": 0, "description": "Seconds to a complete 500-token answer, including thinking time (Artificial Analysis)." },
    "context_window": { "type": "string", "minLength": 1, "description": "Maximum context window, e.g. \"1M\" or \"256K\" tokens." },
    "open_weights": { "type": "boolean", "description": "True when the weights are publicly downloadable." },
    "specialized": { "type": "boolean", "description": "True for a specialised decision model kept below the index floor; see specialized_reason." },
    "specialized_reason": { "type": ["string", "null"], "description": "Why a specialised model is kept despite a low index." },
    "cheapest_token_price": { "type": "string", "minLength": 1, "description": "Lowest list price as \"$input / $output per M\" (US dollars per million tokens)." },
    "cheapest_provider": { "type": "string", "minLength": 1, "description": "Where cheapest_token_price is offered." },
    "cost_per_task": { "type": "string", "minLength": 1, "description": "Artificial Analysis cost to run its Intelligence Index on this model at API list prices, in US dollars; a guide to relative cost, not a bill." },
    "source": { "type": "string", "pattern": "^https://", "description": "Main source page for the record." },
    "benchmark_source": { "type": "string", "pattern": "^https://", "description": "Artificial Analysis model page the benchmark figures come from." },
    "pricing_source": { "type": "string", "pattern": "^https://", "description": "First-party pricing page (or OpenRouter) for the token price." },
    "source_date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "description": "Date (YYYY-MM-DD) the sources were last checked." },
    "effort_profile": {
      "type": "object",
      "description": "Score and cost at each reasoning-effort level on an agentic coding benchmark, used to recommend an effort level.",
      "required": ["benchmark", "harness", "source", "source_date", "levels"],
      "properties": {
        "benchmark": { "type": "string", "minLength": 1 },
        "harness": { "type": "string", "minLength": 1, "description": "Agent harness the benchmark ran the model in." },
        "source": { "type": "string", "pattern": "^https://" },
        "source_date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
        "levels": {
          "type": "array",
          "minItems": 2,
          "items": {
            "type": "object",
            "required": ["effort", "score", "cost_per_task", "tokens"],
            "properties": {
              "effort": { "type": "string", "minLength": 1 },
              "score": { "type": "number", "minimum": 0, "maximum": 100 },
              "cost_per_task": { "type": "number", "minimum": 0 },
              "tokens": { "type": ["integer", "null"], "minimum": 0 }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": true
}
