{
  "openapi": "3.1.0",
  "info": {
    "title": "Silo Agent API",
    "version": "0.1.0",
    "description": "Agent-facing discovery, catalog, safe search, preview, and controlled authority endpoints."
  },
  "servers": [
    {
      "url": "https://silo-499817.web.app"
    }
  ],
  "paths": {
    "/v1/agent/directory": {
      "get": {
        "summary": "Return canonical Silo agent directory metadata.",
        "responses": {
          "200": {
            "description": "Directory metadata."
          }
        }
      }
    },
    "/v1/agent/offers": {
      "get": {
        "summary": "Return public Silo authority offers.",
        "responses": {
          "200": {
            "description": "Offer catalog."
          }
        }
      }
    },
    "/v1/agent/offers/{access_id}": {
      "get": {
        "summary": "Return one public Silo authority offer.",
        "parameters": [
          {
            "name": "access_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 160
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Offer metadata."
          },
          "404": {
            "description": "Offer not found."
          }
        }
      }
    },
    "/v1/agent/search": {
      "get": {
        "summary": "Search safe public Silo preview metadata.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 240
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Safe public search results."
          },
          "400": {
            "description": "Unsafe search query."
          }
        }
      }
    },
    "/v1/agent/works/{access_id}/preview": {
      "get": {
        "summary": "Return a safe public preview contract for one work.",
        "parameters": [
          {
            "name": "access_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 160
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preview contract."
          },
          "404": {
            "description": "Offer not found."
          }
        }
      }
    },
    "/v1/agent/works/{access_id}/authority": {
      "get": {
        "summary": "Return controlled authority record when access is valid, or controlled-access state before release.",
        "parameters": [
          {
            "name": "access_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 160
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Controlled authority record after valid access."
          },
          "402": {
            "description": "Controlled access required."
          },
          "404": {
            "description": "Offer not found."
          }
        }
      }
    },
    "/v1/agent/receipts/{payment_id}/citation": {
      "get": {
        "summary": "Return citation record metadata after authority access is enabled.",
        "parameters": [
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 160
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Citation record metadata."
          },
          "404": {
            "description": "Citation record not found."
          }
        }
      }
    }
  }
}
