{
  "openapi": "3.0.3",
  "info": {
    "title": "Scriptured Public & Agent API",
    "description": "API endpoints for Scriptured Bible study, apologetics, scripture memorization, and AI dialectical interaction.",
    "version": "1.0.0",
    "contact": {
      "name": "Scriptured Support",
      "url": "https://scriptured.app",
      "email": "support@scriptured.app"
    }
  },
  "servers": [
    {
      "url": "https://api.scriptured.app",
      "description": "Production API Server"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Health check",
        "description": "Returns status 200 when backend services are operational",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chat-stream": {
      "post": {
        "summary": "Dialectical chat streaming",
        "description": "Streams AI dialectical responses including thesis, antithesis, and synthesis for apologetics and Bible study.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["message"],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "conversationId": {
                    "type": "string"
                  },
                  "bibleVersion": {
                    "type": "string",
                    "default": "ESV"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event stream of chunks",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/agent/auth": {
      "post": {
        "summary": "Agent registration and authentication",
        "description": "Register or authenticate an autonomous AI agent per Auth.md specification.",
        "responses": {
          "200": {
            "description": "Authentication credentials issued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": { "type": "string" },
                    "token_type": { "type": "string", "example": "Bearer" },
                    "expires_in": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
