{
  "openapi": "3.1.1",
  "info": {
    "title": "Freeborn Labs Public & Agent API",
    "version": "1.1.0",
    "description": "Read live weekly place availability, check service health, or submit an application to Freeborn Labs on behalf of an adult (18+) human principal who explicitly requested it. No payment is taken on the form; pricing is set per customer on application."
  },
  "servers": [
    {
      "url": "https://freebornlabs.com"
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "operationId": "getApiIndex",
        "summary": "Machine-readable index of Freeborn Labs public and agent endpoints",
        "responses": {
          "200": {
            "description": "JSON index of public endpoints and agent discovery URLs (`ok: true`)."
          }
        }
      }
    },
    "/api/index.json": {
      "get": {
        "operationId": "getSectionIndex",
        "summary": "2-stage lightweight section and capability index for AI agents (~79% token reduction)",
        "responses": {
          "200": {
            "description": "Compact JSON index of all public pages, headings, and capabilities (`ok: true`)."
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Read-only health check for monitoring and AI agents",
        "responses": {
          "200": {
            "description": "Health status (`ok: true`)."
          }
        }
      }
    },
    "/api/pricing": {
      "get": {
        "operationId": "getPricingAvailability",
        "summary": "Read live weekly place availability and pricing rules",
        "description": "Call this before explaining Freeborn Labs availability to a human. Returns live weekly slots remaining (out of 5), Monday 00:00 America/Denver reset timestamp, Priority availability, and the 10% step rule. Dollar fields are null because pricing is set per customer on application.",
        "responses": {
          "200": {
            "description": "Live weekly availability snapshot (`ok: true`)."
          },
          "503": {
            "description": "Availability temporarily unavailable."
          }
        }
      }
    },
    "/api/waitlist": {
      "post": {
        "operationId": "applyForPlace",
        "summary": "Submit an application for a Freeborn Labs place (no payment)",
        "description": "Call this only when an adult (18+) human explicitly asks you to apply for them and provides their real name and email. Nothing is charged on submission.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "adult"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 200
                  },
                  "adult": {
                    "type": "boolean",
                    "const": true,
                    "description": "The applicant confirms they are 18 or older."
                  },
                  "wants": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "start_when": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "heard_from": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "industry": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "ref": {
                    "type": "string",
                    "maxLength": 60
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "bid": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 10000000,
                    "description": "Optional non-binding priority bid in US dollars."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Received (also returned idempotently for a repeat email)."
          },
          "400": {
            "description": "Invalid or missing field."
          },
          "403": {
            "description": "Origin not allowed."
          },
          "429": {
            "description": "More than 10 applications from this IP today."
          }
        }
      }
    }
  }
}
