{
  "openapi": "3.1.0",
  "info": {
    "title": "SENTIO Protocol Public API",
    "version": "1.0.0",
    "summary": "Privacy-first AI agent discovery, local browser redaction metadata, and Robinhood Chain (4663) software entitlement endpoints.",
    "description": "Public HTTP API served at https://sentiocore.xyz on Robinhood Chain (Chain ID 4663).",
    "contact": {
      "name": "SENTIO Core",
      "url": "https://github.com/SentioCore/sentio"
    },
    "license": {
      "name": "MIT",
      "url": "https://github.com/SentioCore/sentio/blob/main/LICENSE"
    }
  },
  "externalDocs": {
    "description": "SENTIO Protocol Documentation & Architecture",
    "url": "https://sentiocore.xyz/docs"
  },
  "servers": [
    {
      "url": "https://sentiocore.xyz",
      "description": "Production Cloudflare Edge Runtime"
    }
  ],
  "paths": {
    "/api/agents": {
      "get": {
        "operationId": "listCatalogAgents",
        "summary": "List verified AI agents and integrated SENTIO runtimes",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verified catalog agent list with official, pricing, and privacy URLs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "agents",
                    "total"
                  ],
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "agents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CatalogAgent"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/agents/{slug}": {
      "get": {
        "operationId": "getCatalogAgentBySlug",
        "summary": "Retrieve full metadata and provenance links for a catalog agent",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed agent record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "agent"
                  ],
                  "properties": {
                    "agent": {
                      "$ref": "#/components/schemas/CatalogAgent"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Agent slug not found"
          }
        }
      }
    },
    "/api/discover": {
      "post": {
        "operationId": "discoverAgentsForTask",
        "summary": "Rank catalog agents for a sanitized task description using 128d hybrid embeddings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 4000
                  },
                  "privacyMode": {
                    "type": "string",
                    "enum": [
                      "private",
                      "standard"
                    ],
                    "default": "private"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Grounded agent recommendations with privacy trade-off notes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/access": {
      "get": {
        "operationId": "getAccessEntitlement",
        "summary": "Inspect Robinhood Chain (4663) token configuration, tier thresholds, and daily software quota",
        "responses": {
          "200": {
            "description": "Resolved tier and Robinhood Chain token configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessEntitlementResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CatalogAgent": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "category",
          "productType",
          "summary",
          "officialUrl"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "productType": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "officialUrl": {
            "type": "string",
            "format": "uri"
          },
          "pricingUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "privacyPolicyUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AccessEntitlementResponse": {
        "type": "object",
        "required": [
          "holderAccessEnabled",
          "activeTier",
          "tokenConfig"
        ],
        "properties": {
          "holderAccessEnabled": {
            "type": "boolean"
          },
          "activeTier": {
            "type": "string",
            "enum": [
              "PUBLIC",
              "NODE",
              "NEXUS",
              "SOVEREIGN"
            ]
          },
          "tokenConfig": {
            "type": "object",
            "required": [
              "chainId",
              "chainExplorerUrl",
              "tokenSymbol",
              "tokenDecimals"
            ],
            "properties": {
              "holderAccessEnabled": {
                "type": "boolean"
              },
              "tokenContractAddress": {
                "type": "string"
              },
              "chainId": {
                "type": "integer",
                "example": 4663
              },
              "chainExplorerUrl": {
                "type": "string",
                "format": "uri"
              },
              "tokenSymbol": {
                "type": "string",
                "example": "SENTIO"
              },
              "tokenDecimals": {
                "type": "integer",
                "example": 18
              }
            }
          }
        }
      }
    }
  }
}
