{
  "openapi": "3.0.3",
  "info": {
    "title": "Metkagram Static API",
    "description": "Machine-readable language resources for agents, LLM tools, researchers and learning applications. All endpoints are static JSON files served from GitHub Pages.",
    "version": "1.0.0+20260715",
    "contact": {
      "name": "Applied Systems Lab at MetalHatsCats",
      "url": "https://metalhatscats.com"
    },
    "license": {
      "name": "CC BY-NC 4.0",
      "url": "https://creativecommons.org/licenses/by-nc/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://metkagram.github.io/api/v1",
      "description": "GitHub Pages production API"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "summary": "API index",
        "operationId": "",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/catalog.json": {
      "get": {
        "summary": "Dataset catalog",
        "operationId": "catalog.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/attribution.json": {
      "get": {
        "summary": "Attribution policy",
        "operationId": "attribution.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/patterns.json": {
      "get": {
        "summary": "All patterns",
        "operationId": "patterns.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "https://metkagram.github.io/api/v1/schemas/pattern.json"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/patterns/index.json": {
      "get": {
        "summary": "Pattern summaries (paginated)",
        "operationId": "patterns_index.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Page number (static; use /page/{n}.json)"
          }
        ]
      }
    },
    "/patterns/{id}.json": {
      "get": {
        "summary": "Single pattern",
        "operationId": "patterns_id.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/sets.json": {
      "get": {
        "summary": "Study sets",
        "operationId": "sets.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/sets/{id}.json": {
      "get": {
        "summary": "Single study set",
        "operationId": "sets_id.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/categories.json": {
      "get": {
        "summary": "Categories",
        "operationId": "categories.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/categories/{id}.json": {
      "get": {
        "summary": "Patterns in category",
        "operationId": "categories_id.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/languages.json": {
      "get": {
        "summary": "Languages",
        "operationId": "languages.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/subsets/language/{lang}.json": {
      "get": {
        "summary": "Language subset",
        "operationId": "subsets_language_lang.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/subsets/set/{id}.json": {
      "get": {
        "summary": "Set subset",
        "operationId": "subsets_set_id.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/annotations/{target}/{collection}.json": {
      "get": {
        "summary": "Annotated documents",
        "operationId": "annotations_target_collection.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/annotations/{target}/{collection}/{id}.json": {
      "get": {
        "summary": "Single annotated document",
        "operationId": "annotations_target_collection_id.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/search-index.json": {
      "get": {
        "summary": "Search index",
        "operationId": "search-index.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/download/full-patterns.json": {
      "get": {
        "summary": "Download patterns",
        "operationId": "download_full-patterns.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/mcp-server.json": {
      "get": {
        "summary": "MCP tool spec",
        "operationId": "mcp-server.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Provenance": {
        "$ref": "https://metkagram.github.io/api/v1/schemas/provenance.json"
      },
      "ApiResponse": {
        "$ref": "https://metkagram.github.io/api/v1/schemas/api-response.json"
      },
      "Pattern": {
        "$ref": "https://metkagram.github.io/api/v1/schemas/pattern.json"
      },
      "Set": {
        "$ref": "https://metkagram.github.io/api/v1/schemas/set.json"
      },
      "Document": {
        "$ref": "https://metkagram.github.io/api/v1/schemas/document.json"
      }
    }
  }
}
