{
  "components": {
    "schemas": {
      "HistoryResponse": {
        "properties": {
          "events": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          },
          "meta": {
            "additionalProperties": true,
            "type": "object"
          },
          "model_key": {
            "type": "string"
          },
          "recent": {
            "type": "boolean"
          },
          "schema_version": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "schema_version",
          "events",
          "meta"
        ],
        "type": "object"
      },
      "Problem": {
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "resolution": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "resolution"
        ],
        "type": "object"
      },
      "ToolRequest": {
        "properties": {
          "method": {
            "enum": [
              "tools/list",
              "tools/call"
            ],
            "type": "string"
          },
          "params": {
            "properties": {
              "arguments": {
                "additionalProperties": true,
                "type": "object"
              },
              "name": {
                "enum": [
                  "query_models",
                  "get_model",
                  "list_providers"
                ],
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "method"
        ],
        "type": "object"
      }
    }
  },
  "externalDocs": {
    "description": "Developer guide",
    "url": "https://llmcatalog.dev/developers"
  },
  "info": {
    "description": "Public, read-only interfaces for LLM model history and catalog lookup tools. No API key is required.",
    "title": "LLM Catalog by Jidoka Labs API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/history/recent": {
      "get": {
        "description": "Returns recent changes in reverse chronological order.",
        "operationId": "listRecentModelHistory",
        "parameters": [
          {
            "description": "Maximum number of events to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryResponse"
                }
              }
            },
            "description": "Model history response."
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Invalid limit."
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Model not found."
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "History data is unavailable."
          }
        },
        "security": [],
        "summary": "List recent model metadata changes"
      }
    },
    "/api/history/{provider}/{model_id}": {
      "get": {
        "description": "Returns the history for a provider and model ID. A model ID can contain additional path segments.",
        "operationId": "getModelHistory",
        "parameters": [
          {
            "description": "Provider identifier, such as openai.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Provider model ID. Preserve any nested path segments.",
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Maximum number of events to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 200,
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryResponse"
                }
              }
            },
            "description": "Model history response."
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Invalid limit."
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Model not found."
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "History data is unavailable."
          }
        },
        "security": [],
        "summary": "Get the history for one provider model"
      }
    },
    "/api/mcp": {
      "post": {
        "description": "Accepts the documented tools/list and tools/call request shapes. This endpoint is a small tool interface, not a complete MCP protocol implementation.",
        "operationId": "invokeCatalogTool",
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "call": {
                  "value": {
                    "method": "tools/call",
                    "params": {
                      "arguments": {
                        "spec": "openai:gpt-4o"
                      },
                      "name": "get_model"
                    }
                  }
                },
                "list": {
                  "value": {
                    "method": "tools/list"
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ToolRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object"
                }
              }
            },
            "description": "Tool list or tool result."
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Invalid tool request."
          },
          "405": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Method not allowed."
          }
        },
        "security": [],
        "summary": "List or call catalog lookup tools"
      }
    }
  },
  "servers": [
    {
      "url": "https://llmcatalog.dev"
    }
  ]
}