{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentField Website API",
    "version": "1.0.0",
    "summary": "Read-only documentation search and retrieval for AgentField, plus run-share publishing.",
    "description": "The public HTTP surface of agentfield.ai. It exists so an agent can answer questions\nabout AgentField — the open-source AI backend for production agent systems — without\nscraping HTML: search the documentation, browse every page, and fetch a single page as\nmarkdown.\n\nThis API describes the **website**. It is not the AgentField control plane API that your\nown deployment exposes; for that, see the REST API guide linked under `externalDocs`.\n\nNo authentication is required. All endpoints are read-only except `POST /api/v1/shares`.\n\n## Versioning and deprecation\n\nThe supported surface is versioned in the URL path (`/api/v1/...`).\n\n- **Breaking changes** ship under a new path prefix (`/api/v2/...`). An existing\n  version keeps its response shape for as long as it is served.\n- **Additive changes** — new endpoints, new optional response fields — ship inside\n  the current version without a version bump.\n- Every response carries `X-API-Version` so a caller can assert what it reached.\n- When a version is scheduled for removal it begins returning `Deprecation`\n  (RFC 9745) and `Sunset` (RFC 8594) headers, plus `Link; rel=\"successor-version\"`,\n  at least 180 days before the sunset date.\n- The older unversioned `/api/agent/*` paths are aliases. They keep working and\n  have no sunset date, and they advertise their versioned successor via\n  `Link; rel=\"successor-version\"`.\n\nThe full policy is published at https://agentfield.ai/docs/reference/site-api#versioning-and-deprecation, and every response links\nit with `Link; rel=\"deprecation-policy\"`.\n\n## Rate limits\n\nReads are limited to 120 requests per 60-second\nwindow per client address. Every response carries `RateLimit-Limit`,\n`RateLimit-Remaining`, `RateLimit-Reset` and `RateLimit-Policy`; pace against those\nrather than retrying blindly. Exceeding the budget returns `429` with `Retry-After`.\n\n## Errors\n\nEvery error response is an RFC 9457 problem document served as\n`application/problem+json`. Alongside the standard `type`, `title`, `status`,\n`detail` and `instance` members, each document carries a machine-readable\n`code`, a `resolution` describing what to do next, and a `documentation_url`.\nBranch on `code`, not on `detail`.",
    "contact": {
      "name": "AgentField",
      "url": "https://agentfield.ai/contact",
      "email": "contact@agentfield.com"
    },
    "license": {
      "name": "Apache-2.0",
      "identifier": "Apache-2.0"
    }
  },
  "jsonSchemaDialect": "https://spec.openapis.org/oas/3.1/dialect/base",
  "servers": [
    {
      "url": "https://agentfield.ai",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Site API reference — endpoints, error model, versioning policy, rate limits",
    "url": "https://agentfield.ai/docs/reference/site-api"
  },
  "tags": [
    {
      "name": "documentation",
      "description": "Search, browse, and read the AgentField documentation corpus."
    },
    {
      "name": "shares",
      "description": "Publish an AgentField run bundle to a public permalink."
    }
  ],
  "x-api-lifecycle": {
    "current_version": "v1",
    "versioning": "url-path",
    "deprecation_policy_url": "https://agentfield.ai/docs/reference/site-api#versioning-and-deprecation",
    "deprecation_notice_days": 180,
    "deprecation_headers": [
      "Deprecation",
      "Sunset",
      "Link; rel=\"successor-version\""
    ],
    "unversioned_aliases": {
      "/api/agent/search": "/api/v1/search",
      "/api/agent/topics": "/api/v1/topics",
      "/api/agent/page": "/api/v1/page"
    }
  },
  "x-rate-limit": {
    "requests": 120,
    "window_seconds": 60,
    "scope": "client-address",
    "headers": [
      "RateLimit-Limit",
      "RateLimit-Remaining",
      "RateLimit-Reset",
      "RateLimit-Policy",
      "Retry-After"
    ]
  },
  "paths": {
    "/api/v1/search": {
      "get": {
        "operationId": "searchDocumentation",
        "tags": [
          "documentation"
        ],
        "summary": "Search the AgentField documentation",
        "description": "Full-text BM25 search across every AgentField documentation page. Use this first when answering a question about AgentField: it returns ranked passages with the page URL, so you can follow up with getDocumentationPage for the full text.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search terms, for example \"shared memory between agents\".",
            "schema": {
              "type": "string",
              "minLength": 1,
              "examples": [
                "shared memory between agents"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked search results.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "The \"q\" parameter is missing or empty.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/missing-parameter",
                  "title": "Missing required parameter",
                  "status": 400,
                  "detail": "The \"q\" parameter is missing or empty.",
                  "instance": "/api/v1/search",
                  "code": "missing_parameter",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          },
          "429": {
            "description": "The client exceeded its request budget.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "The documentation search index could not be loaded.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/upstream-unavailable",
                  "title": "Upstream unavailable",
                  "status": 502,
                  "detail": "The documentation search index could not be loaded.",
                  "instance": "/api/v1/search",
                  "code": "upstream_unavailable",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/topics": {
      "get": {
        "operationId": "listDocumentationTopics",
        "tags": [
          "documentation"
        ],
        "summary": "List every documentation page",
        "description": "Returns the full documentation index: title, description, URL, category, and keywords for every page. Use this to discover what exists before searching, or to enumerate valid values for the path parameter of getDocumentationPage.",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Return only pages in this category, for example \"quick-guides\".",
            "schema": {
              "type": "string",
              "examples": [
                "quick-guides"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The documentation index.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopicsResponse"
                }
              }
            }
          },
          "429": {
            "description": "The client exceeded its request budget.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "The documentation manifest could not be loaded.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/upstream-unavailable",
                  "title": "Upstream unavailable",
                  "status": 502,
                  "detail": "The documentation manifest could not be loaded.",
                  "instance": "/api/v1/search",
                  "code": "upstream_unavailable",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/page": {
      "get": {
        "operationId": "getDocumentationPage",
        "tags": [
          "documentation"
        ],
        "summary": "Read one documentation page as markdown",
        "description": "Returns the complete markdown body of a single documentation page along with its metadata. Use this after searchDocumentation or listDocumentationTopics has given you a page path.",
        "parameters": [
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "Documentation path beginning with /docs/.",
            "schema": {
              "type": "string",
              "pattern": "^/docs/.+",
              "examples": [
                "/docs/build/building-blocks/agents"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page content and metadata.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageResponse"
                }
              }
            }
          },
          "400": {
            "description": "The \"path\" parameter is missing or does not start with /docs/.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/invalid-request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "The \"path\" parameter is missing or does not start with /docs/.",
                  "instance": "/api/v1/search",
                  "code": "invalid_request",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          },
          "404": {
            "description": "No documentation page exists at that path.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/not-found",
                  "title": "Resource not found",
                  "status": 404,
                  "detail": "No documentation page exists at that path.",
                  "instance": "/api/v1/search",
                  "code": "not_found",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          },
          "429": {
            "description": "The client exceeded its request budget.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "The page content could not be rendered.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/upstream-unavailable",
                  "title": "Upstream unavailable",
                  "status": 502,
                  "detail": "The page content could not be rendered.",
                  "instance": "/api/v1/search",
                  "code": "upstream_unavailable",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shares": {
      "post": {
        "operationId": "createRunShare",
        "tags": [
          "shares"
        ],
        "summary": "Publish a run bundle to a permalink",
        "description": "Stores a self-contained AgentField run bundle and returns a public permalink that renders it. This is the endpoint the `af share --public` CLI calls; bundles are normally produced by that CLI rather than by hand.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareBundle"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The bundle was stored.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareCreated"
                }
              }
            }
          },
          "400": {
            "description": "The bundle is not valid JSON or fails schema validation.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/invalid-request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "The bundle is not valid JSON or fails schema validation.",
                  "instance": "/api/v1/search",
                  "code": "invalid_request",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          },
          "413": {
            "description": "The bundle exceeds the 512 KB limit.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/payload-too-large",
                  "title": "Payload too large",
                  "status": 413,
                  "detail": "The bundle exceeds the 512 KB limit.",
                  "instance": "/api/v1/search",
                  "code": "payload_too_large",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          },
          "429": {
            "description": "The client exceeded its request budget.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Hosted sharing is not configured on this deployment.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Request budget for the current window.",
                "schema": {
                  "type": "integer",
                  "example": 120
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 119
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "RateLimit-Policy": {
                "description": "The quota policy in force, as `<limit>;w=<window-seconds>`.",
                "schema": {
                  "type": "string",
                  "example": "120;w=60"
                }
              },
              "X-API-Version": {
                "description": "The API version that served this response.",
                "schema": {
                  "type": "string",
                  "example": "v1"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://agentfield.ai/docs/reference/site-api/errors/service-unavailable",
                  "title": "Service unavailable",
                  "status": 503,
                  "detail": "Hosted sharing is not configured on this deployment.",
                  "instance": "/api/v1/search",
                  "code": "service_unavailable",
                  "resolution": "See the endpoint description for the expected request shape.",
                  "documentation_url": "https://agentfield.ai/docs/reference/site-api#errors"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "title": "Problem",
        "description": "RFC 9457 problem document. `code` is the stable, machine-readable discriminator — branch on it rather than on `detail`.",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code",
          "resolution",
          "documentation_url"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "URI reference identifying the problem type."
          },
          "title": {
            "type": "string",
            "description": "Short human-readable summary, stable for a given type."
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code, repeated for detached payloads."
          },
          "detail": {
            "type": "string",
            "description": "Human-readable explanation of this specific occurrence."
          },
          "instance": {
            "type": "string",
            "description": "Path of the request that produced this problem."
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code.",
            "enum": [
              "invalid_request",
              "missing_parameter",
              "not_found",
              "method_not_allowed",
              "not_acceptable",
              "payload_too_large",
              "rate_limited",
              "internal_error",
              "upstream_unavailable",
              "service_unavailable"
            ]
          },
          "resolution": {
            "type": "string",
            "description": "What the caller should do next to succeed."
          },
          "documentation_url": {
            "type": "string",
            "format": "uri",
            "description": "Where to read more about this class of error."
          },
          "available_endpoints": {
            "type": "object",
            "description": "Endpoints the caller can try instead.",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "title": "SearchResult",
        "required": [
          "score",
          "title",
          "section",
          "url",
          "anchor",
          "snippet"
        ],
        "properties": {
          "score": {
            "type": "number",
            "description": "BM25 relevance score; higher is better."
          },
          "title": {
            "type": "string",
            "description": "Title of the page the passage came from."
          },
          "section": {
            "type": "string",
            "description": "Heading of the matching section."
          },
          "url": {
            "type": "string",
            "description": "Site-relative path of the page."
          },
          "anchor": {
            "type": "string",
            "description": "Fragment identifier for the section."
          },
          "snippet": {
            "type": "string",
            "description": "First 200 characters of the passage."
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "title": "SearchResponse",
        "required": [
          "api_version",
          "query",
          "limit",
          "total",
          "results",
          "links"
        ],
        "properties": {
          "api_version": {
            "type": "string",
            "description": "API version that served the response."
          },
          "query": {
            "type": "string",
            "description": "The query as received."
          },
          "limit": {
            "type": "integer",
            "description": "Effective result limit after clamping."
          },
          "total": {
            "type": "integer",
            "description": "Number of results returned."
          },
          "results": {
            "type": "array",
            "description": "Ranked passages, best first.",
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            }
          },
          "links": {
            "type": "object",
            "description": "Related endpoints to follow next.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "hint": {
            "type": "string",
            "description": "Present only when nothing matched; suggests how to broaden the query."
          }
        }
      },
      "Topic": {
        "type": "object",
        "title": "Topic",
        "required": [
          "title",
          "description",
          "url",
          "category",
          "keywords"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "Page title."
          },
          "description": {
            "type": "string",
            "description": "One-line summary of the page."
          },
          "url": {
            "type": "string",
            "description": "Site-relative path of the page."
          },
          "category": {
            "type": "string",
            "description": "Documentation section the page belongs to."
          },
          "keywords": {
            "type": "array",
            "description": "Keywords declared in the page front matter.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TopicsResponse": {
        "type": "object",
        "title": "TopicsResponse",
        "required": [
          "api_version",
          "total",
          "topics",
          "links"
        ],
        "properties": {
          "api_version": {
            "type": "string",
            "description": "API version that served the response."
          },
          "total": {
            "type": "integer",
            "description": "Number of pages returned."
          },
          "category": {
            "type": "string",
            "description": "Echoes the category filter when one was given."
          },
          "topics": {
            "type": "array",
            "description": "Every documentation page, or those in the requested category.",
            "items": {
              "$ref": "#/components/schemas/Topic"
            }
          },
          "links": {
            "type": "object",
            "description": "Related endpoints to follow next.",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "PageResponse": {
        "type": "object",
        "title": "PageResponse",
        "required": [
          "api_version",
          "path",
          "url",
          "title",
          "description",
          "category",
          "keywords",
          "content",
          "links"
        ],
        "properties": {
          "api_version": {
            "type": "string",
            "description": "API version that served the response."
          },
          "path": {
            "type": "string",
            "description": "Site-relative path that was requested."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Absolute URL of the page."
          },
          "title": {
            "type": "string",
            "description": "Page title."
          },
          "description": {
            "type": "string",
            "description": "One-line summary of the page."
          },
          "category": {
            "type": "string",
            "description": "Documentation section the page belongs to."
          },
          "keywords": {
            "type": "array",
            "description": "Keywords declared in the page front matter.",
            "items": {
              "type": "string"
            }
          },
          "last_modified": {
            "type": "string",
            "format": "date-time",
            "description": "When the source file last changed."
          },
          "content": {
            "type": "string",
            "description": "The full page as markdown, with a YAML front-matter header."
          },
          "links": {
            "type": "object",
            "description": "Related endpoints and alternate representations.",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "ShareBundle": {
        "type": "object",
        "title": "ShareBundle",
        "description": "A self-contained run bundle produced by `af share --public`. Capped at 512 KB.",
        "required": [
          "workflow_id",
          "nodes",
          "totals"
        ],
        "properties": {
          "workflow_id": {
            "type": "string",
            "description": "Identifier of the workflow that ran."
          },
          "nodes": {
            "type": "array",
            "description": "One entry per executed node, carrying previews rather than full payloads.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "totals": {
            "type": "object",
            "description": "Aggregate counters for the run, such as cost in USD.",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "ShareCreated": {
        "type": "object",
        "title": "ShareCreated",
        "required": [
          "url",
          "token"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public permalink for the run."
          },
          "token": {
            "type": "string",
            "description": "Opaque identifier embedded in the permalink."
          }
        }
      }
    }
  }
}
