{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nanostudiopro-com/json-schema/nanostudiopro-com-search-scope-schema.json",
  "title": "SearchScope",
  "description": "Per-key narrowing carried by publishable (`pk_sf_live_`) keys. Every field is optional; an absent field means no restriction on that axis. Enforcement is silent — filters outside the scope produce an empty 200 page, oversized `image_size` requests are served the cap, and `include_regions` is ignored unless allowed. The one hard rejection is `origins`: a browser request from an origin not on the list gets `403 forbidden`.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nanostudiopro-com-openapi.json#/components/schemas/SearchScope",
  "type": "object",
  "properties": {
    "projects": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "description": "The key sees ONLY these project ids. Absent = the whole library."
    },
    "types": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "asset",
          "generation"
        ]
      },
      "description": "Result types the key may return. Absent (or both) = no restriction."
    },
    "max_image_size": {
      "type": "string",
      "enum": [
        "xs",
        "thumb",
        "preview",
        "large",
        "original"
      ],
      "description": "Largest `image_size` variant the key may be served. Requests above it — the `preview` default included — are silently clamped down to this rung."
    },
    "origins": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 20,
      "description": "Exact-match browser `Origin` allowlist. Entries must be bare http(s) origins (no path, no default port). Absent = any origin. Requests with no Origin header (curl, server-to-server) always pass."
    },
    "include_regions": {
      "type": "boolean",
      "description": "Whether the key may request detection regions via `include_regions=true`. Default false — the request flag is silently ignored without it."
    },
    "include_narrative": {
      "type": "boolean",
      "description": "Whether results carry `narrative` (the AI-written photo description). Default false — publishable-key results omit the field unless the scope opts in. Secret keys always get it."
    }
  }
}