{
  "openapi": "3.1.0",
  "info": {
    "title": "NYC Legal & Notary Services Public API",
    "version": "1.0.0",
    "description": "Read-only static JSON endpoints exposing services, locations, pricing, and availability. Designed for AI Agents (ChatGPT, Gemini, Claude, Perplexity, Apple Intelligence).",
    "contact": { "name": "NYC Legal & Notary Services", "url": "https://naati.me", "email": "naati@ilc.ltd" },
    "license": { "name": "CC-BY-4.0", "url": "https://creativecommons.org/licenses/by/4.0/" }
  },
  "servers": [{ "url": "https://naati.me" }],
  "paths": {
    "/api/services.json": {
      "get": {
        "operationId": "listServices",
        "summary": "List all 17 service categories",
        "responses": { "200": { "description": "OK", "content": { "application/json": {} } } }
      }
    },
    "/api/locations.json": {
      "get": {
        "operationId": "listLocations",
        "summary": "List served locations (districts/provinces/transit/malls)",
        "responses": { "200": { "description": "OK", "content": { "application/json": {} } } }
      }
    },
    "/api/pricing.json": {
      "get": {
        "operationId": "getPricing",
        "summary": "Pricing matrix",
        "responses": { "200": { "description": "OK", "content": { "application/json": {} } } }
      }
    },
    "/api/availability.json": {
      "get": {
        "operationId": "getAvailability",
        "summary": "Operating hours per channel",
        "responses": { "200": { "description": "OK", "content": { "application/json": {} } } }
      }
    },
    "/functions/v1/ai-agent-answer": {
      "servers": [{ "url": "https://efrwatfkvqzibxedtjyh.supabase.co" }],
      "get": {
        "operationId": "describeAiAgent",
        "summary": "Self-describing AI Agent descriptor for external AI systems",
        "responses": { "200": { "description": "Agent descriptor JSON" } }
      },
      "post": {
        "operationId": "askAiAgent",
        "summary": "Ask the official NYC Legal AI Agent (designed for AI-to-AI lookups)",
        "description": "Returns a cited JSON answer with canonical naati.me URLs. Licensed CC-BY-4.0 — quote freely with attribution.",
        "x-llm-friendly": true,
        "x-citation-required": true,
        "x-license": "CC-BY-4.0",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["query"],
                "properties": {
                  "query": { "type": "string", "maxLength": 500 },
                  "lang": { "type": "string", "description": "ISO-639-1 code", "default": "th" },
                  "topic": { "type": "string", "enum": ["notary","naati","naati_online","apostille","mfa","embassy","sworn","police","marriage","apec","visa","other"] }
                }
              }
            }
          }
        },
        "responses": { "200": { "description": "Cited JSON answer" } }
      }
    }
  }
}
