{
  "openapi": "3.1.0",
  "info": {
    "title": "Yep Public API",
    "description": "Stable, API-key authenticated access to Yep public services.",
    "license": {
      "name": ""
    },
    "version": "1.2.0"
  },
  "servers": [
    {
      "url": "https://platform.yep.com"
    }
  ],
  "paths": {
    "/api/v1/api-keys": {
      "get": {
        "tags": [
          "management"
        ],
        "summary": "List API keys.",
        "description": "Lists the active and disabled keys of the authenticated key's owner, newest first, including the calling key. A management key lists only the keys it issued, not itself. Revoked and expired keys are omitted, and no secret is returned. The reply holds one page of the keys, and `total` gives the number of keys on all pages.",
        "operationId": "list_api_keys",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100; 100 when omitted.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "maximum": 100,
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "One-based page number, at most 10,000; the first page when omitted.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "maximum": 10000,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the owner's keys, newest first.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiKeyList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid page or limit.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "403": {
            "description": "The API key lacks key-management permission.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "429": {
            "description": "A rate limit for key lists rejected the request. All keys of one owner share one limit, and the workspace has a second limit.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Minimum retry delay in seconds"
              },
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      },
      "post": {
        "tags": [
          "management"
        ],
        "summary": "Create an API key.",
        "description": "Creates a scoped credential and returns its secret once. A key that a management key issues cannot hold `keys-create-own`.",
        "operationId": "create_api_key",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Key created; the secret is present only in this response.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCreatedApiKey"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "403": {
            "description": "Requested permissions exceed current authority, or a management key requested `keys-create-own`.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "409": {
            "description": "The account is unavailable or its active-key quota is exhausted. A management key holds at most 100,000 active keys that it issued.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "429": {
            "description": "A rate limit for key changes rejected the request. All keys of one owner share one limit, and the workspace has a second limit. A management key has its own limit.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Minimum retry delay in seconds"
              },
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/api/v1/api-keys/{id}": {
      "delete": {
        "tags": [
          "management"
        ],
        "summary": "Revoke an API key.",
        "description": "Permanently revokes one credential owned by the authenticated identity. A management key can revoke only the keys it issued.",
        "operationId": "revoke_api_key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Credential UUID returned at creation.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Key revoked.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            }
          },
          "401": {
            "description": "Authentication required.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "403": {
            "description": "The API key lacks key-management permission.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "404": {
            "description": "Key is absent, owned by another identity, or not issued by the calling management key.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          },
          "429": {
            "description": "A rate limit for key changes rejected the request. All keys of one owner share one limit, and the workspace has a second limit. A management key has its own limit.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Minimum retry delay in seconds"
              },
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/api/v1/search": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Search the web index.",
        "description": "Returns ranked web results in the same envelope as `POST /api/v1/search`, projected to url, title, description, language, and highlights. The result cap is 50 and the API does not paginate.",
        "operationId": "search",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "The search text.",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 512,
              "minLength": 1
            },
            "example": "carbon border tax 2026"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of results.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20,
              "maximum": 50,
              "minimum": 1
            },
            "example": 5
          },
          {
            "name": "lang",
            "in": "query",
            "description": "A two-letter lowercase language code that results must match.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z]{2}$"
            },
            "example": "en"
          },
          {
            "name": "ranking",
            "in": "query",
            "description": "What the ranking favors. The default is balanced.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SearchRanking"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked projected search results",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Capacity of the binding rate-limit bucket"
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Requests the binding bucket admits now"
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Seconds until the binding bucket is full again"
              },
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchPostResponse"
                }
              }
            }
          },
          "400": {
            "description": "The query violated the public contract",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "401": {
            "description": "A valid API key is required",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "402": {
            "description": "Billing or a spend limit rejected execution",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "403": {
            "description": "The API key lacks search permission",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate limit rejected execution",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Minimum retry delay in seconds"
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Capacity of the binding rate-limit bucket"
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Requests the binding bucket admits now"
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Seconds until the binding bucket is full again"
              },
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "500": {
            "description": "The service could not safely complete the request",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "502": {
            "description": "The search request could not be completed",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "503": {
            "description": "Search is temporarily unavailable",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      },
      "post": {
        "tags": [
          "search"
        ],
        "summary": "Search with typed filters and result projection.",
        "description": "Returns ranked web results using the shared typed filter and projection contract.",
        "operationId": "searchPost",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchPostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ranked projected search results",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Capacity of the binding rate-limit bucket"
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Requests the binding bucket admits now"
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Seconds until the binding bucket is full again"
              },
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchPostResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request violated the public contract",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "401": {
            "description": "A valid API key is required",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "402": {
            "description": "Billing or a spend limit rejected execution",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "403": {
            "description": "The API key lacks search permission",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate limit rejected execution",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Minimum retry delay in seconds"
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Capacity of the binding rate-limit bucket"
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Requests the binding bucket admits now"
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                },
                "description": "Seconds until the binding bucket is full again"
              },
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "502": {
            "description": "The search request could not be completed",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          },
          "503": {
            "description": "Search is temporarily unavailable",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchV1Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiKeyExpiration": {
        "type": "string",
        "description": "A named API-key lifetime: one day, one week, one month (30 days), one year (365 days), or a key\nthat never expires.",
        "enum": [
          "1d",
          "7d",
          "30d",
          "365d",
          "never"
        ]
      },
      "ApiKeyState": {
        "type": "string",
        "description": "API-key lifecycle state visible in listings.",
        "enum": [
          "active",
          "disabled"
        ]
      },
      "BooleanOperator": {
        "type": "string",
        "description": "Boolean connective used by a filter group.",
        "enum": [
          "and",
          "or"
        ]
      },
      "ErrorCode": {
        "type": "string",
        "description": "Machine-readable product API failure.",
        "enum": [
          "unauthenticated",
          "forbidden",
          "invalid_request",
          "not_found",
          "conflict",
          "payment_required",
          "too_many_requests",
          "upstream",
          "internal"
        ]
      },
      "ErrorRecovery": {
        "oneOf": [
          {
            "type": "object",
            "description": "Open prepaid funding for the exact product that rejected execution.",
            "required": [
              "product_key",
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "add_funds"
                ]
              },
              "product_key": {
                "type": "string",
                "description": "Stable product catalog discriminator."
              }
            }
          },
          {
            "type": "object",
            "description": "Retry a transient refusal after the server-provided delay.",
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "retry"
                ]
              },
              "retry_after_ms": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64",
                "description": "Minimum delay before retrying, or `None` when the upstream gave no hint.",
                "minimum": 0
              }
            }
          }
        ],
        "description": "Browser-safe recovery action selected by the authoritative product boundary."
      },
      "FilterOperator": {
        "type": "string",
        "description": "Operator applied by a typed predicate.",
        "enum": [
          "eq",
          "not_eq",
          "in",
          "not_in",
          "lt",
          "lte",
          "gt",
          "gte",
          "between",
          "contains",
          "not_contains",
          "contains_phrase",
          "not_contains_phrase",
          "starts_with",
          "not_starts_with",
          "includes_any",
          "includes_all",
          "includes_none"
        ]
      },
      "PageResultFields": {
        "type": "object",
        "description": "Optional nullable projected fields. Each property is omitted when not selected, `null` when selected but unavailable, or carries its typed value.",
        "properties": {
          "anchor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Aggregated inbound anchor text."
          },
          "author": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Page author."
          },
          "categories": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "One category returned by the public projection.",
                  "required": [
                    "path",
                    "score"
                  ],
                  "properties": {
                    "path": {
                      "type": "string",
                      "description": "Stable taxonomy path."
                    },
                    "score": {
                      "type": "number",
                      "format": "double",
                      "description": "Normalized confidence in the inclusive range zero through one.",
                      "maximum": 1,
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                }
              }
            ],
            "description": "Scored taxonomy categories."
          },
          "content_angle": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Classified content angle."
          },
          "description": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Result description."
          },
          "document_intent": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Classified document intent."
          },
          "domain": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Registrable or host domain."
          },
          "domain_refdomains": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              }
            ],
            "description": "Domain referring-domain count."
          },
          "first_seen": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "First-seen timestamp."
          },
          "highlights": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "Up to three query-relevant passages."
          },
          "language": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Document language."
          },
          "location": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Geographic location code."
          },
          "page_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Page content type."
          },
          "publish_time": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Published timestamp."
          },
          "refdomains": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              }
            ],
            "description": "Referring-domain count."
          },
          "republished": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "boolean"
              }
            ],
            "description": "Whether the document was republished."
          },
          "rule_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Applied rule type."
          },
          "site_name": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Site display name."
          },
          "title": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Page title."
          },
          "url": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Canonical page URL."
          },
          "word_count": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              }
            ],
            "description": "Visible word count."
          }
        },
        "additionalProperties": false
      },
      "ProjectedPageResult": {
        "type": "object",
        "description": "One ranked projected result.",
        "required": [
          "rank",
          "fields"
        ],
        "properties": {
          "fields": {
            "$ref": "#/components/schemas/PageResultFields",
            "description": "Exactly the requested fields."
          },
          "rank": {
            "type": "integer",
            "format": "int64",
            "description": "One-based result rank.",
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "PublicApiError": {
        "type": "object",
        "description": "Stable public error envelope for APIs whose reason vocabulary is extensible.",
        "required": [
          "code",
          "reason",
          "message"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/ErrorCode",
            "description": "Closed status category suitable for program control flow."
          },
          "message": {
            "type": "string",
            "description": "Safe diagnostic intended for operators, not program branching."
          },
          "reason": {
            "type": "string",
            "description": "Extensible machine-readable detail; clients must accept unknown values."
          },
          "recovery": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ErrorRecovery",
                "description": "Browser-oriented recovery for account or billing state, when available."
              }
            ]
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The request reference, equal to the response's `X-Request-ID`; quote it to support."
          },
          "validation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ValidationReport",
                "description": "Correct every issue at its RFC 6901 path, then retry.\nMCP uses the same report in structured tool-error content."
              }
            ]
          }
        }
      },
      "PublicApiKey": {
        "type": "object",
        "description": "Public metadata for one API key; it never carries the secret or any digest of it.",
        "required": [
          "id",
          "name",
          "display_prefix",
          "state",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "description": "Creation timestamp in UTC."
          },
          "display_prefix": {
            "type": "string",
            "description": "Non-secret prefix used to identify the key."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Expiry timestamp in UTC, null for a key that never expires."
          },
          "id": {
            "type": "string",
            "description": "Stable credential id used for revocation."
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Most recent use in UTC, absent until the key is first used."
          },
          "monthly_spend_limit_microusd": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Monthly spend ceiling in millionths of a US dollar, absent when the key has none.",
            "minimum": 0
          },
          "name": {
            "type": "string",
            "description": "User-provided display name."
          },
          "state": {
            "$ref": "#/components/schemas/ApiKeyState",
            "description": "Whether the key may authenticate now."
          }
        }
      },
      "PublicApiKeyList": {
        "type": "object",
        "description": "One page of the API keys of the calling credential's owner, newest first.",
        "required": [
          "api_keys",
          "total"
        ],
        "properties": {
          "api_keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicApiKey"
            },
            "description": "The active and disabled keys of the page, newest first; revoked and expired keys are\nomitted."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "The number of keys on all pages.",
            "minimum": 0
          }
        }
      },
      "PublicApiKeyPermission": {
        "type": "string",
        "description": "Stable permission names accepted by the public API-key endpoint.",
        "enum": [
          "search-read",
          "keys-create-own",
          "keys-manage-own"
        ]
      },
      "PublicCreateApiKeyRequest": {
        "type": "object",
        "description": "Stable public input for issuing a user-owned API key.",
        "required": [
          "name",
          "permissions"
        ],
        "properties": {
          "expiration": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiKeyExpiration",
                "description": "Named lifetime, `never` for a key that does not expire. It cannot be combined with\n`expires_in_days`."
              }
            ]
          },
          "expires_in_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Requested lifetime in days; omission of both this field and `expiration` selects 90 days.\nIt cannot be combined with `expiration`.",
            "default": 90,
            "maximum": 365,
            "minimum": 1
          },
          "monthly_spend_limit_microusd": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Optional positive monthly spend ceiling in millionths of a US dollar.",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "description": "Human-readable key name.",
            "maxLength": 100,
            "minLength": 1
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicApiKeyPermission"
            },
            "description": "Nonempty grants bounded by the caller's current effective permissions. A management key\ncannot request `keys-create-own`.",
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "PublicCreatedApiKey": {
        "type": "object",
        "description": "Public metadata for a newly issued API key.",
        "required": [
          "id",
          "name",
          "display_prefix",
          "created_at",
          "expires_at",
          "secret"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "description": "Creation timestamp in UTC."
          },
          "display_prefix": {
            "type": "string",
            "description": "Non-secret prefix used to identify the key."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Expiry timestamp in UTC, null for a key that never expires."
          },
          "id": {
            "type": "string",
            "description": "Stable credential id used for revocation."
          },
          "name": {
            "type": "string",
            "description": "User-provided display name."
          },
          "secret": {
            "type": "string",
            "description": "Plaintext secret present only in the creation response."
          }
        }
      },
      "RelativeTimeUnit": {
        "type": "string",
        "description": "Unit supported by a relative timestamp.",
        "enum": [
          "minute",
          "hour",
          "day",
          "week"
        ]
      },
      "ScoredCategory": {
        "type": "object",
        "description": "One category returned by the public projection.",
        "required": [
          "path",
          "score"
        ],
        "properties": {
          "path": {
            "type": "string",
            "description": "Stable taxonomy path."
          },
          "score": {
            "type": "number",
            "format": "double",
            "description": "Normalized confidence in the inclusive range zero through one.",
            "maximum": 1,
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "SearchBooleanOperatorDescriptor": {
        "type": "object",
        "description": "Canonical documentation for one boolean connective.",
        "required": [
          "operator",
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Connective semantics."
          },
          "operator": {
            "$ref": "#/components/schemas/BooleanOperator",
            "description": "Public connective."
          }
        },
        "additionalProperties": false
      },
      "SearchFilterDescriptor": {
        "type": "object",
        "description": "One public filter-field capability descriptor.",
        "required": [
          "field",
          "description",
          "query_guidance",
          "value_kind",
          "operators",
          "value_options",
          "closed_values"
        ],
        "properties": {
          "closed_values": {
            "type": "boolean",
            "description": "Whether operands must belong to `value_options`."
          },
          "description": {
            "type": "string",
            "description": "Short canonical field documentation."
          },
          "field": {
            "$ref": "#/components/schemas/SearchFilterField",
            "description": "Public field."
          },
          "operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilterOperator"
            },
            "description": "Complete supported operator set."
          },
          "query_guidance": {
            "type": "string",
            "description": "Semantic guidance used by generated query builders and reference documentation."
          },
          "value_kind": {
            "$ref": "#/components/schemas/SearchValueKind",
            "description": "Expected value category."
          },
          "value_options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Suggested or authoritative values for a bounded vocabulary."
          }
        },
        "additionalProperties": false
      },
      "SearchFilterField": {
        "type": "string",
        "description": "Public fields that may participate in filters.",
        "enum": [
          "title",
          "description",
          "url",
          "site_name",
          "author",
          "language",
          "domain",
          "categories",
          "location",
          "page_type",
          "publish_time",
          "first_seen",
          "word_count",
          "rule_type",
          "document_intent",
          "content_angle",
          "republished",
          "content"
        ]
      },
      "SearchFilterGrammarDescriptor": {
        "type": "object",
        "description": "Generated filter grammar shared by query builders, documentation, and SDKs.",
        "required": [
          "group_shape",
          "predicate_shape",
          "value_shapes",
          "timestamp_shapes",
          "boolean_operators",
          "operators",
          "relative_time_units"
        ],
        "properties": {
          "boolean_operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchBooleanOperatorDescriptor"
            },
            "description": "Boolean connective registry."
          },
          "group_shape": {
            "type": "string",
            "description": "JSON form of a boolean group."
          },
          "operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchFilterOperatorDescriptor"
            },
            "description": "Filter operator registry."
          },
          "predicate_shape": {
            "type": "string",
            "description": "JSON form of a predicate."
          },
          "relative_time_units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchRelativeTimeUnitDescriptor"
            },
            "description": "Relative-time unit registry."
          },
          "timestamp_shapes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Supported timestamp operand forms."
          },
          "value_shapes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Supported tagged operand forms."
          }
        },
        "additionalProperties": false
      },
      "SearchFilterOperatorDescriptor": {
        "type": "object",
        "description": "Canonical documentation for one filter operator.",
        "required": [
          "operator",
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Operand semantics."
          },
          "operator": {
            "$ref": "#/components/schemas/FilterOperator",
            "description": "Public operator."
          }
        },
        "additionalProperties": false
      },
      "SearchPostRequest": {
        "type": "object",
        "description": "Public POST search request.",
        "required": [
          "query"
        ],
        "properties": {
          "filter": {
            "type": [
              "string",
              "null"
            ],
            "description": "An expression in the filter language that every result must satisfy.",
            "maxLength": 65536,
            "minLength": 1
          },
          "lang": {
            "type": [
              "string",
              "null"
            ],
            "description": "A two-letter lowercase language code that results must match.",
            "pattern": "^[a-z]{2}$"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The maximum number of results. The default is 20.",
            "maximum": 50,
            "minimum": 1
          },
          "max_results_per_domain": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The maximum number of results from one registrable domain.",
            "maximum": 10,
            "minimum": 1
          },
          "query": {
            "type": "string",
            "description": "The search text.",
            "maxLength": 512,
            "minLength": 1
          },
          "ranking": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchRanking",
                "description": "What the ranking favors. The default is balanced."
              }
            ]
          },
          "select": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResultField"
            },
            "description": "The fields each result returns.",
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "SearchPostResponse": {
        "type": "object",
        "description": "Public POST search response.",
        "required": [
          "request_id",
          "duration_ms",
          "select",
          "results"
        ],
        "properties": {
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "description": "The time taken to answer, in milliseconds.",
            "minimum": 0
          },
          "request_id": {
            "type": "string",
            "description": "The reference of the request, to quote when contacting support."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectedPageResult"
            },
            "description": "The results, best first."
          },
          "select": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResultField"
            },
            "description": "The fields each result returns, after the default is applied."
          }
        },
        "additionalProperties": false
      },
      "SearchQuery": {
        "type": "object",
        "description": "Public machine-search input.",
        "required": [
          "query"
        ],
        "properties": {
          "lang": {
            "type": [
              "string",
              "null"
            ],
            "description": "A two-letter lowercase language code that results must match.",
            "example": "en",
            "pattern": "^[a-z]{2}$"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The maximum number of results.",
            "default": 20,
            "example": 5,
            "maximum": 50,
            "minimum": 1
          },
          "query": {
            "type": "string",
            "description": "The search text.",
            "example": "carbon border tax 2026",
            "maxLength": 512,
            "minLength": 1
          },
          "ranking": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchRanking",
                "description": "What the ranking favors. The default is balanced."
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "SearchRanking": {
        "type": "string",
        "description": "What the results should prioritize.",
        "enum": [
          "precision",
          "balanced",
          "authority",
          "content_gap"
        ]
      },
      "SearchRelativeTimeUnitDescriptor": {
        "type": "object",
        "description": "Canonical documentation for one relative-time unit.",
        "required": [
          "unit",
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Unit semantics and conversion policy."
          },
          "unit": {
            "$ref": "#/components/schemas/RelativeTimeUnit",
            "description": "Public unit."
          }
        },
        "additionalProperties": false
      },
      "SearchResultDescriptor": {
        "type": "object",
        "description": "One selectable result-field descriptor.",
        "required": [
          "field",
          "description",
          "value_kind",
          "nullable"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Short canonical field documentation."
          },
          "field": {
            "$ref": "#/components/schemas/SearchResultField",
            "description": "Public field."
          },
          "nullable": {
            "type": "boolean",
            "description": "Whether selected results may explicitly contain null."
          },
          "value_kind": {
            "$ref": "#/components/schemas/SearchResultValueKind",
            "description": "JSON-facing value category."
          }
        },
        "additionalProperties": false
      },
      "SearchResultField": {
        "type": "string",
        "description": "Public fields that may be selected in a search response.",
        "enum": [
          "url",
          "title",
          "description",
          "anchor",
          "site_name",
          "author",
          "language",
          "domain",
          "categories",
          "location",
          "page_type",
          "publish_time",
          "first_seen",
          "refdomains",
          "domain_refdomains",
          "word_count",
          "rule_type",
          "document_intent",
          "content_angle",
          "republished",
          "highlights"
        ]
      },
      "SearchResultValueKind": {
        "type": "string",
        "description": "JSON-facing category for one projected result field.",
        "enum": [
          "string",
          "timestamp",
          "integer",
          "number",
          "boolean",
          "category_array",
          "string_array"
        ]
      },
      "SearchV1Error": {
        "type": "object",
        "description": "Search v1's original closed error envelope.",
        "required": [
          "code",
          "reason",
          "message"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/ErrorCode",
            "description": "Closed status category."
          },
          "message": {
            "type": "string",
            "description": "Safe operator diagnostic."
          },
          "reason": {
            "$ref": "#/components/schemas/SearchV1ErrorReason",
            "description": "Closed Search v1 reason."
          },
          "recovery": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ErrorRecovery",
                "description": "Browser-oriented recovery for billing state, when available."
              }
            ]
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The request reference, equal to the response's `X-Request-ID`; quote it to support."
          },
          "validation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ValidationReport",
                "description": "Correct every issue at its RFC 6901 path, then retry.\nMCP uses the same report in structured tool-error content."
              }
            ]
          }
        }
      },
      "SearchV1ErrorReason": {
        "type": "string",
        "description": "Closed failure-reason vocabulary retained for the published Search v1 contract.",
        "enum": [
          "malformed_request",
          "authentication_required",
          "permission_denied",
          "api_key_name_invalid",
          "spend_policy_invalid",
          "rate_policy_invalid",
          "resource_not_found",
          "state_conflict",
          "insufficient_funds",
          "spend_limit_exceeded",
          "rate_limit_exceeded",
          "dependency_unavailable",
          "internal_failure"
        ]
      },
      "SearchValueKind": {
        "type": "string",
        "description": "Value category exposed to generated query-builder controls.",
        "enum": [
          "keyword",
          "text",
          "integer",
          "number",
          "boolean",
          "timestamp",
          "keyword_array"
        ]
      },
      "SearchViewDescriptor": {
        "type": "object",
        "description": "Generated public field view shared with query builders and SDKs.",
        "required": [
          "version",
          "contract_digest",
          "max_group_depth",
          "filters",
          "results",
          "filter_grammar"
        ],
        "properties": {
          "contract_digest": {
            "type": "string",
            "description": "Digest of all generated field and filter metadata."
          },
          "filter_grammar": {
            "$ref": "#/components/schemas/SearchFilterGrammarDescriptor",
            "description": "Canonical filter wire grammar and documentation."
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchFilterDescriptor"
            },
            "description": "Filterable fields and capabilities."
          },
          "max_group_depth": {
            "type": "integer",
            "description": "Maximum supported boolean-group nesting depth.",
            "minimum": 0
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResultDescriptor"
            },
            "description": "Selectable result fields."
          },
          "version": {
            "type": "string",
            "description": "Contract version of the registry."
          }
        },
        "additionalProperties": false
      },
      "ValidationIssue": {
        "type": "object",
        "description": "One actionable, privacy-safe contract violation.",
        "required": [
          "code",
          "path",
          "suggestion"
        ],
        "properties": {
          "allowed_values": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "maxLength": 128
                }
              ]
            },
            "maxItems": 16
          },
          "code": {
            "type": "string",
            "description": "Stable, extensible machine-readable category.",
            "maxLength": 64
          },
          "path": {
            "type": "string",
            "description": "RFC 6901 pointer to the rejected location; empty means the root value.",
            "maxLength": 1024
          },
          "suggestion": {
            "type": "string",
            "description": "Code-owned instruction for correcting the request.",
            "maxLength": 512
          }
        }
      },
      "ValidationReport": {
        "type": "object",
        "description": "Bounded validation feedback shared by model, REST, and MCP boundaries.",
        "required": [
          "contract",
          "issues",
          "truncated"
        ],
        "properties": {
          "contract": {
            "type": "string",
            "description": "Stable contract name, normally the published schema component name.",
            "maxLength": 128
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            },
            "description": "At most eight deterministic violations. Correct every issue before retrying.",
            "maxItems": 8
          },
          "truncated": {
            "type": "boolean",
            "description": "Whether more violations were omitted; retry after correcting the listed issues."
          }
        }
      }
    },
    "securitySchemes": {
      "bearer_auth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "search",
      "description": "The public Yep search API"
    },
    {
      "name": "management",
      "description": "Public credential management"
    }
  ]
}
