{
  "openapi": "3.1.0",
  "info": {
    "title": "Idea Explorer public catalog",
    "version": "1.0.0",
    "description": "Read-only endpoints. No authentication or LLM calls. Generation, accounts, billing, private history and admin actions are excluded. Cache responses; do not enumerate the catalog."
  },
  "servers": [
    {
      "url": "https://caimeo.com/ideas"
    }
  ],
  "security": [],
  "paths": {
    "/data/{topic}.manifest.json": {
      "get": {
        "operationId": "getManifest",
        "summary": "Get current catalog snapshot and availability",
        "parameters": [
          {
            "name": "topic",
            "in": "path",
            "required": true,
            "description": "Catalog category",
            "schema": {
              "type": "string",
              "enum": [
                "games",
                "movies",
                "music"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog manifest with snapshot, ready and corpus counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "snapshot",
                    "ready"
                  ],
                  "properties": {
                    "snapshot": {
                      "type": "string"
                    },
                    "ready": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/search": {
      "get": {
        "operationId": "searchWorks",
        "summary": "Search titles or genres without an LLM call",
        "description": "At most 20 points. more=true means refine your query; this is not a bulk export API.",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "description": "Catalog category",
            "schema": {
              "type": "string",
              "enum": [
                "games",
                "movies",
                "music"
              ]
            }
          },
          {
            "name": "snapshot",
            "in": "query",
            "required": true,
            "description": "Current snapshot from the topic manifest. Refresh once after HTTP 409.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Two to eighty characters, at most ten words",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 80
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public catalog result; honor Cache-Control.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "points",
                    "more",
                    "population"
                  ],
                  "properties": {
                    "points": {
                      "type": "array",
                      "maxItems": 20,
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "title"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "more": {
                      "type": "boolean"
                    },
                    "population": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "409": {
            "description": "Snapshot changed; refetch manifest"
          },
          "503": {
            "description": "Catalog temporarily unavailable"
          }
        }
      }
    },
    "/api/compare": {
      "get": {
        "operationId": "compareWorks",
        "summary": "Measure semantic distances between selected works",
        "description": "Use IDs from search in the same topic and snapshot. Lower distances mean closer descriptions. Map spacing is approximate.",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "description": "Catalog category",
            "schema": {
              "type": "string",
              "enum": [
                "games",
                "movies",
                "music"
              ]
            }
          },
          {
            "name": "snapshot",
            "in": "query",
            "required": true,
            "description": "Current snapshot from the topic manifest. Refresh once after HTTP 409.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Repeat id for each selected work",
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 6,
              "uniqueItems": true,
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "Public catalog result; honor Cache-Control.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "pairs",
                    "canBlend"
                  ],
                  "properties": {
                    "pairs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "a",
                          "b",
                          "distance"
                        ],
                        "properties": {
                          "a": {
                            "type": "string"
                          },
                          "b": {
                            "type": "string"
                          },
                          "distance": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 2
                          }
                        }
                      }
                    },
                    "canBlend": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "409": {
            "description": "Snapshot changed; refetch manifest"
          },
          "503": {
            "description": "Catalog temporarily unavailable"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check service and catalog availability",
        "responses": {
          "200": {
            "description": "Release and topic readiness",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
