{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aidevhub.io/api/models.schema.json",
  "title": "AI Dev Hub model catalog",
  "description": "List prices (USD per million tokens), cache rates, context windows, output limits and release months of AI models on sale, each read from the vendor's own page. Documentation: https://aidevhub.io/llm-pricing-api/",
  "type": "object",
  "required": [
    "name",
    "url",
    "license",
    "prices_verified",
    "count",
    "models"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Documentation, licence and field reference."
    },
    "license": {
      "type": "string",
      "description": "Licence of the data."
    },
    "license_url": {
      "type": "string",
      "format": "uri"
    },
    "attribution": {
      "type": "string",
      "description": "The credit line the licence asks for."
    },
    "terms": {
      "type": "string",
      "format": "uri"
    },
    "prices_verified": {
      "type": "string",
      "format": "date",
      "description": "Every row was checked against its vendor page on or after this day."
    },
    "count": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of rows in models."
    },
    "models": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "provider",
          "status",
          "flagship",
          "input_usd_per_mtok",
          "output_usd_per_mtok",
          "cached_input_usd_per_mtok",
          "cache_write_usd_per_mtok",
          "price_scope",
          "context_window_tokens",
          "max_output_tokens",
          "released",
          "source",
          "verified_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable catalog id of the model."
          },
          "name": {
            "type": "string",
            "description": "Model name as the vendor writes it."
          },
          "provider": {
            "type": "string",
            "description": "The company whose API sells the model at these prices."
          },
          "status": {
            "type": "string",
            "description": "current: in the vendor's present lineup. legacy: still on sale, but superseded by a newer model.",
            "enum": [
              "current",
              "legacy"
            ]
          },
          "flagship": {
            "type": "boolean",
            "description": "true for the provider's top model in this catalog."
          },
          "input_usd_per_mtok": {
            "type": "number",
            "description": "List price per million input tokens. Unit: USD per 1M tokens.",
            "minimum": 0
          },
          "output_usd_per_mtok": {
            "type": "number",
            "description": "List price per million output tokens. Unit: USD per 1M tokens.",
            "minimum": 0
          },
          "cached_input_usd_per_mtok": {
            "type": [
              "number",
              "null"
            ],
            "description": "Price per million input tokens served from the prompt cache. null when the catalog records no cached rate. Unit: USD per 1M tokens.",
            "minimum": 0
          },
          "cache_write_usd_per_mtok": {
            "type": [
              "number",
              "null"
            ],
            "description": "Price per million tokens written to the prompt cache. null when the vendor bills no separate write rate or the catalog records none. Unit: USD per 1M tokens.",
            "minimum": 0
          },
          "price_scope": {
            "type": [
              "string",
              "null"
            ],
            "description": "The condition the prices apply to when the vendor attaches one, such as a prompt-length band, a region, a cache duration or a promotion end date. null when none is recorded."
          },
          "context_window_tokens": {
            "type": "integer",
            "description": "Context window as the vendor states it. Unit: tokens.",
            "minimum": 0
          },
          "max_output_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Most output tokens one response can have, as the vendor states it. null when not recorded. Unit: tokens.",
            "minimum": 0
          },
          "released": {
            "type": "string",
            "description": "Release month, YYYY-MM.",
            "pattern": "^\\d{4}-\\d{2}$"
          },
          "source": {
            "type": "string",
            "description": "The vendor page this row was read from.",
            "format": "uri"
          },
          "verified_at": {
            "type": "string",
            "description": "The day this row was last checked against that page, YYYY-MM-DD.",
            "format": "date"
          }
        }
      }
    }
  }
}