{
  "openapi": "3.1.0",
  "info": {
    "title": "Base Layer example specification API",
    "description": "Read-only API for the example specifications published on this site. Base Layer is an open-source pipeline that turns your writing into a specification for AI agents. The specification contains plain-text claims about how a person reasons, communicates and decides. The pipeline runs on your own machine (https://github.com/agulaya24/BaseLayer, version 0.5.0, not on PyPI). It sends text to the Anthropic API. Extraction can instead run locally through Ollama. Nothing is sent to Base Layer. This API does not accept personal data. All ten examples were made with an earlier version of the pipeline, before it supported citations. See the documentation at https://www.base-layer.ai/llms.txt",
    "version": "2026-10-19",
    "contact": {
      "email": "aarik@base-layer.ai",
      "url": "https://www.base-layer.ai"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://opensource.org/licenses/Apache-2.0"
    }
  },
  "servers": [
    {
      "url": "https://www.base-layer.ai",
      "description": "Production. Use this host. The bare domain redirects, and a redirected POST loses its body."
    }
  ],
  "paths": {
    "/api/identity/{slug}": {
      "get": {
        "operationId": "getExampleSpecification",
        "summary": "Get an example specification",
        "description": "Returns an example specification with anchors, core, predictions, an optional prose brief, and stats. It does not return facts or fact traces. The open slugs are franklin, douglass, wollstonecraft, roosevelt, buffett, marks, patents, baselayer, aria and agentic.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Example identifier",
            "schema": {
              "type": "string",
              "enum": ["franklin", "douglass", "wollstonecraft", "roosevelt", "buffett", "marks", "patents", "baselayer", "aria", "agentic"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The example specification",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Specification"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not an open example"
          }
        }
      }
    },
    "/api/agent-feedback": {
      "post": {
        "operationId": "submitAgentFeedback",
        "summary": "Report how you used a specification",
        "description": "Optional. No authentication is required. The endpoint stores the submission with the request's IP address and user agent. The rate limit is 50 per IP address per hour.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["agent", "action"],
                "properties": {
                  "agent": { "type": "string", "description": "Who or what you are", "maxLength": 200 },
                  "action": { "type": "string", "description": "What you did with the specification", "maxLength": 500 },
                  "subject": { "type": "string", "description": "Which example specification you used, such as 'franklin'", "maxLength": 100 },
                  "feedback": { "type": "string", "description": "Any observations", "maxLength": 2000 },
                  "context": { "type": "string", "description": "How you found Base Layer, such as 'llms.txt'", "maxLength": 200 }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Feedback received",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": { "type": "boolean" },
                    "message": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": { "description": "Invalid JSON, or agent or action is missing" },
          "429": { "description": "Rate limited (50 per IP address per hour)" }
        }
      },
      "get": {
        "operationId": "getAgentFeedbackInstructions",
        "summary": "Get instructions for submitting agent feedback",
        "responses": {
          "200": {
            "description": "Instructions and an example payload"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Specification": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "description": "Subject name" },
          "slug": { "type": "string" },
          "anchors": {
            "type": "array",
            "description": "ANCHORS describes the certainties the person reasons from",
            "items": { "$ref": "#/components/schemas/Anchor" }
          },
          "core": {
            "type": "array",
            "description": "CORE describes how the person communicates and the context needed to read them",
            "items": { "$ref": "#/components/schemas/CoreClaim" }
          },
          "predictions": {
            "type": "array",
            "description": "PREDICTIONS describes how the person is likely to respond in a given kind of situation",
            "items": { "$ref": "#/components/schemas/Prediction" }
          },
          "brief": {
            "type": ["string", "null"],
            "description": "Optional prose brief composed from the layers. It is separate from the specification."
          },
          "stats": {
            "type": ["object", "null"],
            "description": "Counts from the build, such as total and active facts"
          },
          "meta": {
            "type": "object",
            "properties": {
              "sourceDescription": { "type": "string" },
              "version": { "type": "string" },
              "source": { "type": "string", "description": "'static-example' for the published examples" },
              "generatedAt": { "type": "string" }
            }
          }
        }
      },
      "Anchor": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "description": "A1, A2, ..." },
          "name": { "type": "string" },
          "description": { "type": "string" },
          "activeWhen": { "type": ["string", "null"], "description": "When the claim applies" },
          "contested": { "type": "boolean", "description": "Present in some responses only" }
        }
      },
      "CoreClaim": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "description": { "type": "string" }
        }
      },
      "Prediction": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "description": "P1, P2, ..." },
          "name": { "type": "string" },
          "description": { "type": "string" },
          "directive": { "type": ["string", "null"], "description": "What the agent should do when the situation applies" },
          "falsePositive": { "type": ["string", "null"], "description": "When the situation appears to be present but is absent" }
        }
      }
    }
  }
}
