{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yonyon-ai/json-schema/yonyon-ai-api-root-schema.json",
  "title": "ApiRoot",
  "description": "Index of the live public API surface, served at GET /api.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yonyon-ai-openapi.yml#/components/schemas/ApiRoot",
  "type": "object",
  "required": [
    "name",
    "version",
    "code",
    "auth",
    "rate_limit",
    "endpoints",
    "openapi",
    "docs"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "version": {
      "type": "integer",
      "description": "Current major version of the REST surface."
    },
    "code": {
      "type": "string",
      "const": "api_root"
    },
    "message": {
      "type": "string"
    },
    "auth": {
      "type": "string",
      "description": "Always describes anonymous access. No credential is issued or accepted anywhere on this site."
    },
    "auth_docs": {
      "type": "string",
      "format": "uri"
    },
    "protected_resource_metadata": {
      "type": "string",
      "format": "uri"
    },
    "rate_limit": {
      "$ref": "#/$defs/RateLimitPolicy"
    },
    "endpoints": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Endpoint"
      }
    },
    "openapi": {
      "type": "string",
      "format": "uri"
    },
    "api_catalog": {
      "type": "string",
      "format": "uri"
    },
    "docs": {
      "type": "string",
      "format": "uri"
    }
  },
  "$defs": {
    "Endpoint": {
      "type": "object",
      "description": "One endpoint that is live on this API today.",
      "required": [
        "method",
        "path",
        "description"
      ],
      "properties": {
        "method": {
          "type": "string",
          "description": "HTTP method the endpoint answers."
        },
        "path": {
          "type": "string",
          "description": "Path relative to https://yonyon.ai."
        },
        "description": {
          "type": "string"
        }
      }
    },
    "RateLimitPolicy": {
      "type": "object",
      "description": "The rate limit actually enforced on this API, as machine-readable JSON.",
      "required": [
        "requests",
        "window_seconds",
        "scope"
      ],
      "properties": {
        "requests": {
          "type": "integer",
          "description": "Requests allowed per window."
        },
        "window_seconds": {
          "type": "integer",
          "description": "Window length in seconds."
        },
        "scope": {
          "type": "string",
          "description": "What the window is keyed on.",
          "enum": [
            "ip"
          ]
        }
      }
    }
  }
}