{
  "openapi": "3.1.0",
  "info": {
    "title": "BestCityToLive Partner City Intelligence",
    "version": "1.0.0",
    "description": "Read published source-linked city guides and separately scoped evidence. Requires a separately provisioned partner bearer token. No official Civometra winners; legacy scores are unverified. Preserve citations, geography, units, observation periods and review dates."
  },
  "servers": [
    {
      "url": "https://bestcitytolive-intelligence.withered-glade-985a.workers.dev"
    }
  ],
  "security": [
    {
      "partnerBearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "partnerBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Server-side partner token with cities:read scope. Expiring and revocable. Never put tokens in the schema or a URL."
      }
    }
  },
  "paths": {
    "/v1/catalog": {
      "get": {
        "operationId": "getCityIntelligenceCatalog",
        "summary": "Read published resource coverage and source dates",
        "responses": {
          "200": {
            "description": "Published catalog JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired credential"
          },
          "429": {
            "description": "Retry after request limit"
          }
        }
      }
    },
    "/v1/cities/{slug}": {
      "get": {
        "operationId": "getCityDossier",
        "summary": "Read a sourced city guide and contextual observations",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "maxLength": 80
            },
            "description": "Published city slug such as calgary or tokyo"
          }
        ],
        "responses": {
          "200": {
            "description": "City dossier with canonical citation, guide review dates, contextual observations and primary source links",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired credential"
          },
          "404": {
            "description": "City not covered"
          },
          "429": {
            "description": "Retry after request limit"
          }
        }
      }
    }
  }
}
