{
  "openapi": "3.1.0",
  "info": {
    "title": "AI Model Watch API",
    "version": "2.0.0",
    "description": "Live prices, context windows, lifecycle status and deprecation dates for 258 AI/LLM models across 12 providers. Compiled daily from official provider documentation. No key, no signup, CORS open.",
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    },
    "contact": {
      "name": "AI Model Watch",
      "url": "https://aimodelwatch.dev/about"
    }
  },
  "servers": [
    {
      "url": "https://aimodelwatch.dev",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/models.json": {
      "get": {
        "operationId": "getModels",
        "summary": "Full model catalog",
        "description": "Returns all 258 models with prices (USD per 1M tokens), context windows, lifecycle status, retirement dates and a source_url per row.",
        "responses": {
          "200": {
            "description": "The full model catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelCatalog"
                }
              }
            }
          }
        }
      }
    },
    "/api/deprecations.json": {
      "get": {
        "operationId": "getDeprecations",
        "summary": "Deprecation and retirement timeline",
        "description": "Every model a provider has declared deprecated or retired, with retirement dates and migration targets. Sorted by soonest retirement first.",
        "responses": {
          "200": {
            "description": "The deprecation/retirement timeline",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeprecationCatalog"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Meta": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "example": "AI Model Watch"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "api_docs": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "feed_updated": {
            "type": "string",
            "format": "date",
            "description": "Date the catalog was last updated"
          },
          "license": {
            "type": "string"
          },
          "citation": {
            "type": "string"
          },
          "contact": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Model": {
        "type": "object",
        "required": [
          "id",
          "name",
          "provider",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique model identifier (slug)"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string",
            "enum": [
              "Alibaba",
              "Amazon",
              "Anthropic",
              "Cohere",
              "DeepSeek",
              "Google",
              "Meta",
              "Mistral",
              "Moonshot",
              "OpenAI",
              "Perplexity",
              "xAI"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ga",
              "preview",
              "beta",
              "deprecated",
              "retired"
            ]
          },
          "modality": {
            "type": "string",
            "nullable": true
          },
          "context_window": {
            "type": "integer",
            "nullable": true,
            "description": "Maximum context in tokens"
          },
          "max_output_tokens": {
            "type": "integer",
            "nullable": true
          },
          "price_input_per_mtok": {
            "type": "number",
            "nullable": true,
            "description": "USD per 1M input tokens"
          },
          "price_output_per_mtok": {
            "type": "number",
            "nullable": true,
            "description": "USD per 1M output tokens"
          },
          "price_cached_input_per_mtok": {
            "type": "number",
            "nullable": true,
            "description": "USD per 1M cached input tokens"
          },
          "knowledge_cutoff": {
            "type": "string",
            "nullable": true
          },
          "released": {
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "deprecated_on": {
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "retires_on": {
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "replacement": {
            "type": "string",
            "nullable": true,
            "description": "Provider-stated replacement model"
          },
          "api_string": {
            "type": "string",
            "nullable": true,
            "description": "The exact string to pass to the provider API"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "source_url": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "description": "Official provider page this row was read from"
          },
          "open_weight": {
            "type": "boolean",
            "nullable": true
          },
          "embedding_dimensions": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "ModelCatalog": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "updated": {
            "type": "string",
            "format": "date"
          },
          "count": {
            "type": "integer"
          },
          "_meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            }
          }
        }
      },
      "DeprecationEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "deprecated",
              "retired"
            ]
          },
          "deprecated_on": {
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "retires_on": {
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "replacement": {
            "type": "string",
            "nullable": true
          },
          "api_string": {
            "type": "string",
            "nullable": true
          },
          "source_url": {
            "type": "string",
            "nullable": true,
            "format": "uri"
          }
        }
      },
      "DeprecationCatalog": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "updated": {
            "type": "string",
            "format": "date"
          },
          "count": {
            "type": "integer"
          },
          "_meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeprecationEntry"
            }
          }
        }
      }
    }
  }
}