{
  "openapi": "3.1.0",
  "info": {
    "title": "Starkslab API",
    "version": "1.0.0",
    "summary": "Read-only JSON for Starkslab's notes on AI coding tools, agents, security and infrastructure.",
    "description": "The same notes, tool pages, concept pages and comparisons as starkslab.com, built from the same index.\n\nNo key or sign-up. Responses are cached for a few minutes; a client sending more than about 120 requests a minute gets 429.\n\nEvery note carries an evidence label: tested, source-read, documented. See https://starkslab.com/about#evidence-labels.\n\nContent signals: search=yes, ai-input=yes, ai-train=no. Cite a note's url (the HTML page) and its date.\n\nStability: v1 only grows. Fields and endpoints are added, never renamed, retyped or removed; a breaking change ships as v2 beside it.",
    "contact": {
      "name": "Starkslab",
      "url": "https://starkslab.com/developers"
    }
  },
  "externalDocs": {
    "description": "Documentation",
    "url": "https://starkslab.com/developers"
  },
  "servers": [
    {
      "url": "https://starkslab.com/api/v1"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getIndex",
        "summary": "API index",
        "responses": {
          "200": {
            "description": "Endpoints and usage terms.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/status": {
      "get": {
        "operationId": "getStatus",
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "The API is up.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notes": {
      "get": {
        "operationId": "listNotes",
        "summary": "List notes, newest first",
        "parameters": [
          {
            "name": "tool",
            "in": "query",
            "description": "Only notes about this tool (a slug from /tools).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "concept",
            "in": "query",
            "description": "Only notes on this concept (a slug from /concepts).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "guide",
                "review",
                "comparison",
                "checklist",
                "explainer",
                "source-read"
              ]
            }
          },
          {
            "name": "evidence",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "tested",
                "source-read",
                "documented"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of notes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteList"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notes/{slug}": {
      "get": {
        "operationId": "getNote",
        "summary": "One note with its full text",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The note's slug, as in its URL.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteDetail"
                }
              }
            }
          },
          "404": {
            "description": "No such note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "List tools",
        "responses": {
          "200": {
            "description": "Every tool with at least one note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tools/{slug}": {
      "get": {
        "operationId": "getTool",
        "summary": "One tool with its notes",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The tool's slug, as in /tools/{slug}.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tool.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolDetail"
                }
              }
            }
          },
          "404": {
            "description": "No such tool.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/concepts": {
      "get": {
        "operationId": "listConcepts",
        "summary": "List concepts",
        "responses": {
          "200": {
            "description": "Every concept with a reading path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConceptList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/concepts/{slug}": {
      "get": {
        "operationId": "getConcept",
        "summary": "One concept with its reading path",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The concept's slug, as in /learn/{slug}.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The concept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConceptDetail"
                }
              }
            }
          },
          "404": {
            "description": "No such concept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/comparisons": {
      "get": {
        "operationId": "listComparisons",
        "summary": "List comparison notes",
        "responses": {
          "200": {
            "description": "Every comparison note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComparisonList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "search",
        "summary": "Search tools, concepts and notes",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Words that must all appear.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matches; at most 30 notes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            }
          },
          "400": {
            "description": "q is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client; retry after the Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The content store is unavailable; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "This document",
        "responses": {
          "200": {
            "description": "The OpenAPI 3.1 document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EvidenceVersion": {
        "type": "object",
        "required": [
          "name",
          "version"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "Evidence": {
        "type": "object",
        "required": [
          "label",
          "versions",
          "verifiedAt"
        ],
        "properties": {
          "label": {
            "type": "string",
            "enum": [
              "tested",
              "source-read",
              "documented"
            ]
          },
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvidenceVersion"
            },
            "description": "Versions the note tested or read."
          },
          "verifiedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the claim was last checked, usually YYYY-MM-DD."
          }
        }
      },
      "NoteSummary": {
        "type": "object",
        "required": [
          "slug",
          "title",
          "summary",
          "url",
          "markdownUrl",
          "apiUrl",
          "published",
          "updated",
          "format",
          "evidence",
          "tools",
          "concepts"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The canonical HTML page; cite this."
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri",
            "description": "The same note as Markdown."
          },
          "apiUrl": {
            "type": "string",
            "format": "uri",
            "description": "This note in the API, with its full text."
          },
          "published": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First published."
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last changed; equals published when never updated."
          },
          "format": {
            "type": "string",
            "enum": [
              "guide",
              "review",
              "comparison",
              "checklist",
              "explainer",
              "source-read"
            ]
          },
          "evidence": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Evidence"
              },
              {
                "type": "null"
              }
            ]
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tool slugs."
          },
          "concepts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Concept slugs."
          }
        }
      },
      "NoteDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/NoteSummary"
          },
          {
            "type": "object",
            "required": [
              "authors",
              "bodyFormat",
              "body"
            ],
            "properties": {
              "authors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "bodyFormat": {
                "type": "string",
                "enum": [
                  "markdown"
                ]
              },
              "body": {
                "type": "string",
                "description": "The note's full text."
              }
            }
          }
        ]
      },
      "ToolSummary": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "kind",
          "description",
          "aliases",
          "noteCount",
          "testedCount",
          "updated",
          "url",
          "markdownUrl",
          "apiUrl"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "What sort of tool it is, such as Coding agent."
          },
          "description": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "noteCount": {
            "type": "integer"
          },
          "testedCount": {
            "type": "integer",
            "description": "Notes that tested it first-hand."
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Most recent change to one of its notes."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The tool's HTML page."
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri",
            "description": "The tool page as Markdown."
          },
          "apiUrl": {
            "type": "string",
            "format": "uri",
            "description": "This tool in the API."
          }
        }
      },
      "ToolDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ToolSummary"
          },
          {
            "type": "object",
            "required": [
              "notes",
              "concepts"
            ],
            "properties": {
              "notes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NoteSummary"
                }
              },
              "concepts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConceptSummary"
                }
              }
            }
          }
        ]
      },
      "ConceptSummary": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "description",
          "aliases",
          "noteCount",
          "updated",
          "url",
          "markdownUrl",
          "apiUrl"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "noteCount": {
            "type": "integer"
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Most recent change to one of its notes."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The concept's HTML page."
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri",
            "description": "The concept page as Markdown."
          },
          "apiUrl": {
            "type": "string",
            "format": "uri",
            "description": "This concept in the API."
          }
        }
      },
      "ConceptDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ConceptSummary"
          },
          {
            "type": "object",
            "required": [
              "readingPath",
              "tools"
            ],
            "properties": {
              "readingPath": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NoteSummary"
                },
                "description": "Notes in the suggested reading order."
              },
              "tools": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ToolSummary"
                }
              }
            }
          }
        ]
      },
      "NoteList": {
        "type": "object",
        "required": [
          "notes",
          "total",
          "limit",
          "offset",
          "next"
        ],
        "properties": {
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoteSummary"
            }
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "next": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The next page, or null."
          }
        }
      },
      "ToolList": {
        "type": "object",
        "required": [
          "tools",
          "total"
        ],
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolSummary"
            }
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "ConceptList": {
        "type": "object",
        "required": [
          "concepts",
          "total"
        ],
        "properties": {
          "concepts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConceptSummary"
            }
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "ComparisonList": {
        "type": "object",
        "required": [
          "notes",
          "total"
        ],
        "properties": {
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoteSummary"
            }
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "SearchResults": {
        "type": "object",
        "required": [
          "query",
          "tools",
          "concepts",
          "notes"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolSummary"
            }
          },
          "concepts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConceptSummary"
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoteSummary"
            }
          }
        }
      },
      "Status": {
        "type": "object",
        "required": [
          "status",
          "version",
          "notes",
          "tools",
          "concepts",
          "comparisons",
          "updated"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "version": {
            "type": "string"
          },
          "notes": {
            "type": "integer"
          },
          "tools": {
            "type": "integer"
          },
          "concepts": {
            "type": "integer"
          },
          "comparisons": {
            "type": "integer"
          },
          "updated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Most recent change to any note."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "docs"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "not_found",
                  "invalid_parameter",
                  "rate_limited",
                  "unavailable"
                ]
              },
              "message": {
                "type": "string"
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}
