{
  "openapi": "3.1.0",
  "info": {
    "title": "thequant.space research corpus API",
    "version": "1.0.0",
    "summary": "Query 5,000+ scored quantitative-finance research papers.",
    "description": "thequant.space scores quant-finance papers from arXiv q-fin and SSRN on two 0-10 axes, math_complexity and empirical_rigor, assigns a quadrant (Holy Grail / Street Traders / Lab Rats / Philosophers), topic hubs, method and asset-class labels, and publishes a plain-language summary, a written score rationale and a Mermaid research flowchart per paper. hub_score = 0.6*empirical_rigor + 0.4*math_complexity is the default ranking. Scores are LLM-assisted rubric judgements, not peer review (https://thequant.space/score-guide/). No authentication. Responses are cached at the edge for up to an hour; the corpus updates daily. Free for personal and research use with attribution to thequant.space; terms at https://thequant.space/agents/. An MCP server with the same capabilities is at https://thequant.space/mcp.",
    "contact": {
      "url": "https://thequant.space/about/"
    },
    "license": {
      "name": "Free for personal and research use with attribution",
      "url": "https://thequant.space/agents/"
    },
    "x-premium-status": {
      "state": "live",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "networkName": "solana",
      "summary": "Live. The premium endpoints accept x402 payments in USDC on Solana. Free endpoints and tools are unchanged."
    },
    "x-contract-revision": "2026-11-18-hardening-1.2.1"
  },
  "servers": [
    {
      "url": "https://thequant.space"
    }
  ],
  "paths": {
    "/api/papers": {
      "get": {
        "operationId": "searchPapers",
        "summary": "Search and filter scored papers",
        "description": "Returns compact paper records (no abstract or flowchart) plus the total match count. Combine filters freely. Use min_rigor=7 for credible empirical work and has_code=true for reproducible papers. Records carry the paper's reported performance (reports_backtest, sharpe, annual_return_pct, max_drawdown_pct, sample_start, sample_end, transaction_costs, out_of_sample) when it discloses a backtest; these are the authors' own claims, LLM-extracted and verified verbatim against the paper, not reproduced. Records also carry execution-realism flags (evaluation_type, tcost_modeled, oos_method, data_resolution) and, when the Empirical Rigor cap applied, empirical_rigor_raw and rigor_cap_reason (https://thequant.space/score-guide/#penalty-flags).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Free-text search over title, abstract, keywords and authors. Terms are ANDed.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "topic",
            "in": "query",
            "description": "Topic-hub slug (see /api/topics).",
            "schema": {
              "type": "string"
            },
            "example": "market-microstructure"
          },
          {
            "name": "method",
            "in": "query",
            "description": "Method slug (see /api/methods).",
            "schema": {
              "type": "string"
            },
            "example": "deep-learning"
          },
          {
            "name": "asset",
            "in": "query",
            "description": "Asset-class slug.",
            "schema": {
              "type": "string",
              "enum": [
                "equities",
                "macro-multi-asset",
                "derivatives",
                "crypto",
                "fixed-income",
                "insurance",
                "credit",
                "commodities-energy",
                "fx",
                "esg-climate",
                "private-markets",
                "real-estate"
              ]
            }
          },
          {
            "name": "quadrant",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "Holy Grail",
                "Street Traders",
                "Lab Rats",
                "Philosophers"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Paper type from the classifier.",
            "schema": {
              "type": "string",
              "enum": [
                "empirical",
                "theoretical",
                "methodological",
                "survey-review",
                "perspective-policy",
                "dataset-benchmark",
                "software-tool"
              ]
            }
          },
          {
            "name": "author",
            "in": "query",
            "description": "Author name substring.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_rigor",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "max_rigor",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "min_math",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "max_math",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "Earliest paper date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "Latest paper date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "has_code",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_backtest",
            "in": "query",
            "description": "Only papers that report (true) or do not report (false) a backtest of their own strategy on real market data.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_sharpe",
            "in": "query",
            "description": "Only papers that disclose a Sharpe ratio for their own strategy.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "min_sharpe",
            "in": "query",
            "description": "Reported Sharpe ratio at least this.",
            "schema": {
              "type": "number",
              "minimum": -10,
              "maximum": 50
            }
          },
          {
            "name": "max_sharpe",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": -10,
              "maximum": 50
            }
          },
          {
            "name": "min_annual_return",
            "in": "query",
            "description": "Reported annualized return (%) at least this.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "max_drawdown",
            "in": "query",
            "description": "Reported maximum drawdown (%) at most this.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "tcost_modeled",
            "in": "query",
            "description": "Transaction costs applied to the reported results (decision-model flag). Comma-separate several values. Values: yes, partial, no, n/a, unclear.",
            "schema": {
              "type": "string",
              "example": "yes"
            }
          },
          {
            "name": "oos_method",
            "in": "query",
            "description": "Out-of-sample validation of the reported results. Values: holdout, walk-forward, cross-validation, none, unclear.",
            "schema": {
              "type": "string",
              "example": "holdout"
            }
          },
          {
            "name": "data_resolution",
            "in": "query",
            "description": "Finest resolution of market data used in the evaluation. Values: l2-book, tick, intraday-bars, daily, weekly-monthly, synthetic, none, unclear.",
            "schema": {
              "type": "string",
              "example": "l2-book"
            }
          },
          {
            "name": "evaluation_type",
            "in": "query",
            "description": "Headline empirical result. Values: trading-pnl, execution-cost, forecast-accuracy, pricing-calibration, none.",
            "schema": {
              "type": "string",
              "example": "trading-pnl"
            }
          },
          {
            "name": "rigor_capped",
            "in": "query",
            "description": "true: only papers whose empirical_rigor was capped at 6.0 (trading/execution results without modelled transaction costs, or trading/execution/forecast results without out-of-sample testing); empirical_rigor_raw holds the uncapped score. false: only uncapped papers.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Default: relevance when q is given, otherwise hub_score. sharpe, annual_return and drawdown sort by the paper's reported figures, papers without one last.",
            "schema": {
              "type": "string",
              "enum": [
                "hub_score",
                "rigor",
                "math",
                "date",
                "sharpe",
                "annual_return",
                "drawdown",
                "relevance"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "desc",
                "asc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000,
              "default": 0
            }
          },
          {
            "name": "match",
            "in": "query",
            "description": "How the terms of q are matched (needs q, ignored without it). Left out: every term must match and, when no paper has them all, the papers that match most of the terms are returned instead, most terms first; the answer then carries params.match = \"partial\", params.min_terms and a warnings entry. all: strict, no fallback (the list can be empty). any: papers with at least one term, ranked by how many terms they match, then relevance. exact: every term exactly as typed, stop words included (the original matching). q ignores stop words and also matches the singular or plural of a term.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "any",
                "exact"
              ]
            }
          },
          {
            "name": "dataset",
            "in": "query",
            "description": "Comma-separated dataset ids (OR), for example lobster,crsp, or the token unclassified (papers with no relation of the selected kind to any dataset). A paper matches when it has one of the relations in dataset_relation (default used,benchmarked) to one of the datasets. An id that is not a known, facet-visible dataset is a 400, never a silent widening to all papers. At most 30 values. The ids and counts are listed by GET /api/facets (facets.dataset).",
            "schema": {
              "type": "string",
              "example": "lobster"
            }
          },
          {
            "name": "dataset_relation",
            "in": "query",
            "description": "Comma-separated relations that count for the dataset filter (OR). Default used,benchmarked. Without dataset it only changes the dataset facet of /api/facets.",
            "schema": {
              "type": "string",
              "example": "used,benchmarked"
            },
            "x-values": [
              "used",
              "benchmarked",
              "mentioned",
              "unknown"
            ]
          },
          {
            "name": "date_reliable",
            "in": "query",
            "description": "true: a paper whose date is a placeholder (date_precision unknown) never matches since/until and sorts after every real date under sort=date, in both directions. Without since, until or sort=date it has no effect. Any other value is ignored.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Batch retrieval: up to 25 comma-separated paper ids (at most 1,000 characters in all). Combinable only with limit; any other parameter is a 400. Returns the compact records in the order asked: duplicates collapse to the first occurrence after normalisation, ids that match no paper are omitted, and total is the number found. There is no `missing` field: the missing ids are params.ids (the normalised request) minus papers[].paper_id. Accepted spellings: 2409.01234, arXiv:2409.01234, a version suffix (v2), arxiv.org abs and pdf URLs, ssrn-1234567 and SSRN abstract_id= URLs. A malformed id makes the whole request a 400. The answer has no next link and no cursor.",
            "schema": {
              "type": "string",
              "example": "2409.01234,ssrn-1234567"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset paging with no offset ceiling. Pass start to begin, then the next_cursor of the previous answer (also inside next). Supported for sort=hub_score, rigor, math and date, and for sort=relevance when q is given (relevance cursors and cursor=start together with offset need the 1.2.1 hardening release). total stays the full match count on every page. A cursor belongs to one query: another q, filter, sort or order is a 400 (cursor was issued for a different query / sort or order); a cursor is opaque, do not build or edit one. cursor=start may carry offset (at most 1000) so a numbered page 51 can hand over to the next page; a real token with offset is a 400. A cursor also belongs to one snapshot: after the daily data refresh it is a 409 snapshot_changed (start again with cursor=start). Relevance cursors are token version 2 (rank, hub_score, paper_id); all tokens are opaque and not authenticated, a forged one can only start a walk at another row of the same public data. Keep limit constant for one walk. A cursor walk has no offset ceiling.",
            "schema": {
              "type": "string",
              "example": "start"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching papers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperList"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Successful GET answers are cacheable: public, max-age=300, s-maxage=3600 (the corpus changes once a day). Error answers are never cached.",
                "schema": {
                  "type": "string",
                  "examples": [
                    "public, max-age=300, s-maxage=3600"
                  ]
                }
              },
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/FreeSnapshotChanged"
          },
          "429": {
            "$ref": "#/components/responses/FreeRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/FreeInternalError"
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        },
        "x-filter-semantics": {
          "comma_lists": {
            "parameters": [
              "topic",
              "method",
              "asset",
              "quadrant",
              "type",
              "tcost_modeled",
              "oos_method",
              "data_resolution",
              "evaluation_type",
              "dataset",
              "dataset_relation"
            ],
            "within_one_parameter": "OR: any of the values matches",
            "across_parameters": "AND: every given parameter has to match",
            "limits": {
              "max_values_per_list": 30,
              "max_values_in_total": 50,
              "max_characters_per_list": 1000
            }
          },
          "tokens": {
            "unclassified": {
              "parameters": [
                "topic",
                "method",
                "asset",
                "dataset"
              ],
              "meaning": "papers that have no label (or no dataset relation) of that kind"
            },
            "unknown": {
              "parameters": [
                "tcost_modeled",
                "oos_method",
                "data_resolution",
                "evaluation_type"
              ],
              "meaning": "never assessed (NULL); not the same as unclear, where the model abstained"
            }
          },
          "evaluation_type": "also accepts unclear (the model abstained)",
          "dates": "since and until also accept YYYY and YYYY-MM; until=2024 means 2024-12-31 and until=2024-02 means 2024-02-29 (full dates are checked by shape only)",
          "ordering": "null sort keys last in both directions; ties are broken by paper_date descending then paper_id ascending",
          "unavailable_filters": "a parameter whose column or table is not live yet is ignored and named in warnings"
        }
      }
    },
    "/api/papers/{id}": {
      "get": {
        "operationId": "getPaper",
        "summary": "Get one paper's full record",
        "description": "Abstract, summary, the written 'why this score' rationale, the Mermaid research flowchart, all labels, and five related papers from the same hub.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "arXiv id (2409.01234), SSRN id (ssrn-1234567), or an arXiv abs/pdf URL.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The paper.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperFull"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/FreeRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/FreeInternalError"
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        }
      }
    },
    "/api/topics": {
      "get": {
        "operationId": "listTopics",
        "summary": "List topic hubs",
        "description": "The topic hubs with slug, description, paper count, share of papers with empirical rigor >= 7, hub URL and per-topic data file.",
        "responses": {
          "200": {
            "description": "Topic hubs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/FreeRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/FreeInternalError"
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        }
      }
    },
    "/api/methods": {
      "get": {
        "operationId": "listMethods",
        "summary": "List method hubs",
        "description": "The method hubs with description, counts, rigor share, and the slugs of the guides that teach each method's evaluation pitfalls.",
        "responses": {
          "200": {
            "description": "Method hubs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubList"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/FreeRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/FreeInternalError"
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        }
      }
    },
    "/api/stats": {
      "get": {
        "operationId": "corpusStats",
        "summary": "Corpus statistics",
        "description": "Totals, counts by quadrant, by year (with average rigor), by paper type, and the last update date. Includes reported_performance: how many papers disclose a backtest / Sharpe / annual return, the maximum reported Sharpe and annual return, and the papers behind them.",
        "responses": {
          "200": {
            "description": "Statistics.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/FreeRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/FreeInternalError"
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        }
      }
    },
    "/api/search": {
      "get": {
        "operationId": "semanticSearch",
        "summary": "Semantic search over papers, guides, tools and posts",
        "description": "Meaning-based hybrid (vector + keyword) search over the full text of every paper page, practitioner guide, learning path, calculator and post, backed by Cloudflare AI Search. Use it for natural-language questions or when /api/papers?q= finds nothing; use /api/papers for structured filters. Responses are edge-cached per query for an hour. Metered upstream: a daily budget applies and returns 429 when exhausted (keyword search on /api/papers keeps working).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Natural-language query.",
            "schema": {
              "type": "string",
              "maxLength": 300
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "Restrict to one page kind.",
            "schema": {
              "type": "string",
              "enum": [
                "paper",
                "guide",
                "path",
                "tool",
                "post",
                "page"
              ]
            }
          },
          {
            "name": "min_score",
            "in": "query",
            "description": "Drop matches below this relevance score.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "rewrite",
            "in": "query",
            "description": "Let the service rewrite the query for retrieval first.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked pages.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "search_query": {
                      "type": "string",
                      "description": "The query actually run (after optional rewriting)."
                    },
                    "count": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "paper",
                              "guide",
                              "path",
                              "tool",
                              "post",
                              "page"
                            ]
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          },
                          "snippet": {
                            "type": "string"
                          },
                          "matched_chunks": {
                            "type": "integer"
                          },
                          "paper_id": {
                            "type": "string"
                          },
                          "paper_date": {
                            "type": "string"
                          },
                          "quadrant": {
                            "type": "string"
                          },
                          "math_complexity": {
                            "type": "number"
                          },
                          "empirical_rigor": {
                            "type": "number"
                          },
                          "hub_score": {
                            "type": "number"
                          },
                          "topics": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "methods": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "paper_url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "code_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    },
                    "engine": {
                      "type": "string"
                    },
                    "docs": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters."
          },
          "429": {
            "description": "Daily semantic-search budget exhausted.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "RateLimit-Policy": {
                "description": "The budget that applied, as an HTTP structured field list (draft-ietf-httpapi-ratelimit-headers): one item per window, \"<scope>-<window>\";q=<quota>;qu=\"cost-units\";w=<window seconds>. The quota unit cost-units is this API's own weighted unit (a cached read costs 1, a facet count that misses the cache 10), not a request count. Provisional values that can change without notice. Sent only on a refusal.",
                "schema": {
                  "type": "string",
                  "examples": [
                    "\"client-minute\";q=120;qu=\"cost-units\";w=60, \"client-day\";q=3000;qu=\"cost-units\";w=86400"
                  ]
                }
              },
              "RateLimit": {
                "description": "Remaining budget and seconds until the window resets, e.g. \"route-day\";r=0;t=1800. Sent on a refusal ONLY when the counter is exact (the strict daily budgets); the flood limiter is approximate and never advertises a remaining count. Retry-After takes precedence.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/RateLimitError"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ],
                  "description": "Either the application limiter's rate_limit_exceeded body, or the legacy budget body {error: <reason>} (daily search budget, chat per-minute and per-day caps) with Retry-After."
                }
              }
            }
          },
          "502": {
            "description": "Upstream search failed."
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        }
      }
    },
    "/api/chat": {
      "post": {
        "operationId": "askCorpus",
        "summary": "Ask a question, answered from the corpus with cited sources (streaming)",
        "description": "Retrieval-augmented answer over every paper page, guide, learning path, calculator and post (Cloudflare AI Search retrieval, Llama 3.3 70B generation on Workers AI). The model answers only from the retrieved pages and cites them as markdown links. The response is a text/event-stream of lines `data: {\"response\": \"<token>\"}`; concatenate the tokens. Multi-turn: send the prior turns too (max 10 messages, 2,000 characters each); the last user message is the retrieval query. Metered: 5 requests per minute and 60 per day per client, 500 per day overall; 429 when exceeded. For a non-streaming JSON answer with a sources array use the MCP tool ask_papers. Aggregate questions (how many papers disclose a Sharpe ratio, the highest reported annual return, average drawdown, top-N) are detected and answered exactly from the database with linked papers instead of retrieval; the response carries X-Answer-Engine: sql.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "type": "string",
                          "maxLength": 2000
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "messages": [
                  {
                    "role": "user",
                    "content": "Does momentum survive transaction costs in crypto?"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Server-sent events; each `data:` line is a JSON object with a `response` token.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body."
          },
          "429": {
            "description": "Rate or budget limit; see Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "RateLimit-Policy": {
                "description": "The budget that applied, as an HTTP structured field list (draft-ietf-httpapi-ratelimit-headers): one item per window, \"<scope>-<window>\";q=<quota>;qu=\"cost-units\";w=<window seconds>. The quota unit cost-units is this API's own weighted unit (a cached read costs 1, a facet count that misses the cache 10), not a request count. Provisional values that can change without notice. Sent only on a refusal.",
                "schema": {
                  "type": "string",
                  "examples": [
                    "\"client-minute\";q=120;qu=\"cost-units\";w=60, \"client-day\";q=3000;qu=\"cost-units\";w=86400"
                  ]
                }
              },
              "RateLimit": {
                "description": "Remaining budget and seconds until the window resets, e.g. \"route-day\";r=0;t=1800. Sent on a refusal ONLY when the counter is exact (the strict daily budgets); the flood limiter is approximate and never advertises a remaining count. Retry-After takes precedence.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/RateLimitError"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ],
                  "description": "Either the application limiter's rate_limit_exceeded body, or the legacy budget body {error: <reason>} (daily search budget, chat per-minute and per-day caps) with Retry-After."
                }
              }
            }
          },
          "502": {
            "description": "Upstream retrieval or generation failed."
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        }
      }
    },
    "/api/papers/{id}/evidence": {
      "get": {
        "operationId": "getPaperEvidence",
        "summary": "Get one paper's evidence card",
        "description": "What the paper proposes, the assumptions its results depend on, the datasets it used, how it treated transaction costs, the findings it reports, which papers by other authors support or contradict those findings, how other corpus papers cite it, and whether an implementation is public. Every item carries a verbatim quote and every section a status. These are the authors' claims; nothing is reproduced.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "arXiv id (2409.01234), SSRN id (ssrn-1234567), or an arXiv abs/pdf URL.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "card",
            "in": "query",
            "required": false,
            "description": "Set to `replication` to get only the replication card: {paper_id, title, replication} when one exists, otherwise {paper_id, replication: null, status}.",
            "schema": {
              "type": "string",
              "enum": [
                "replication"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The evidence card.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperEvidence"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/FreeRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/FreeInternalError"
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        }
      }
    },
    "/api/facets": {
      "get": {
        "operationId": "getFacets",
        "summary": "Facet counts for a filtered paper set",
        "description": "Counts per facet value for the papers that match the same filters as GET /api/papers (including q): quadrant, topic, method, asset, the four execution flags, dataset, has_code and rigor_capped. Counts are disjunctive: each facet is counted with every filter except its own, so choosing a value does not hide its siblings. total equals total of /api/papers for the same filters. sort, order, limit, offset and cursor are accepted and ignored (they do not change the counts or the cache key); unknown parameters are ignored; ids is a 400 (use /api/papers?ids=). Cost: a facet count is the most expensive read of the free API, so it is edge-cached for an hour under a key built from the parsed parameters (parameter order, paging parameters, empty values and case do not split the cache) and is the first route a rate limit reaches. A 400 is never cached. Comma lists, unclassified and unknown follow the same rules as /api/papers.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Free-text search; the same matching as GET /api/papers (see match). The counts describe the papers the list shows for the same q, including the partial-match fallback.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "topic",
            "in": "query",
            "description": "Topic-hub slug (see /api/topics).",
            "schema": {
              "type": "string"
            },
            "example": "market-microstructure"
          },
          {
            "name": "method",
            "in": "query",
            "description": "Method slug (see /api/methods).",
            "schema": {
              "type": "string"
            },
            "example": "deep-learning"
          },
          {
            "name": "asset",
            "in": "query",
            "description": "Asset-class slug.",
            "schema": {
              "type": "string",
              "enum": [
                "equities",
                "macro-multi-asset",
                "derivatives",
                "crypto",
                "fixed-income",
                "insurance",
                "credit",
                "commodities-energy",
                "fx",
                "esg-climate",
                "private-markets",
                "real-estate"
              ]
            }
          },
          {
            "name": "quadrant",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "Holy Grail",
                "Street Traders",
                "Lab Rats",
                "Philosophers"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Paper type from the classifier.",
            "schema": {
              "type": "string",
              "enum": [
                "empirical",
                "theoretical",
                "methodological",
                "survey-review",
                "perspective-policy",
                "dataset-benchmark",
                "software-tool"
              ]
            }
          },
          {
            "name": "author",
            "in": "query",
            "description": "Author name substring.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_rigor",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "max_rigor",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "min_math",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "max_math",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "Earliest paper date. Accepts YYYY, YYYY-MM or YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "example": "2024"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "Latest paper date. Accepts YYYY, YYYY-MM or YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "example": "2024"
            }
          },
          {
            "name": "has_code",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_backtest",
            "in": "query",
            "description": "Only papers that report (true) or do not report (false) a backtest of their own strategy on real market data.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_sharpe",
            "in": "query",
            "description": "Only papers that disclose a Sharpe ratio for their own strategy.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "min_sharpe",
            "in": "query",
            "description": "Reported Sharpe ratio at least this.",
            "schema": {
              "type": "number",
              "minimum": -10,
              "maximum": 50
            }
          },
          {
            "name": "max_sharpe",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": -10,
              "maximum": 50
            }
          },
          {
            "name": "min_annual_return",
            "in": "query",
            "description": "Reported annualized return (%) at least this.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "max_drawdown",
            "in": "query",
            "description": "Reported maximum drawdown (%) at most this.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "tcost_modeled",
            "in": "query",
            "description": "Transaction costs applied to the reported results (decision-model flag). Comma-separate several values. Values: yes, partial, no, n/a, unclear.",
            "schema": {
              "type": "string",
              "example": "yes"
            }
          },
          {
            "name": "oos_method",
            "in": "query",
            "description": "Out-of-sample validation of the reported results. Values: holdout, walk-forward, cross-validation, none, unclear.",
            "schema": {
              "type": "string",
              "example": "holdout"
            }
          },
          {
            "name": "data_resolution",
            "in": "query",
            "description": "Finest resolution of market data used in the evaluation. Values: l2-book, tick, intraday-bars, daily, weekly-monthly, synthetic, none, unclear.",
            "schema": {
              "type": "string",
              "example": "l2-book"
            }
          },
          {
            "name": "evaluation_type",
            "in": "query",
            "description": "Headline empirical result. Values: trading-pnl, execution-cost, forecast-accuracy, pricing-calibration, none.",
            "schema": {
              "type": "string",
              "example": "trading-pnl"
            }
          },
          {
            "name": "rigor_capped",
            "in": "query",
            "description": "true: only papers whose empirical_rigor was capped at 6.0 (trading/execution results without modelled transaction costs, or trading/execution/forecast results without out-of-sample testing); empirical_rigor_raw holds the uncapped score. false: only uncapped papers.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "match",
            "in": "query",
            "description": "How the terms of q are matched (needs q, ignored without it). Left out: every term must match and, when no paper has them all, the papers that match most of the terms are returned instead, most terms first; the answer then carries params.match = \"partial\", params.min_terms and a warnings entry. all: strict, no fallback (the list can be empty). any: papers with at least one term, ranked by how many terms they match, then relevance. exact: every term exactly as typed, stop words included (the original matching). q ignores stop words and also matches the singular or plural of a term.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "any",
                "exact"
              ]
            }
          },
          {
            "name": "dataset",
            "in": "query",
            "description": "Comma-separated dataset ids (OR), for example lobster,crsp, or the token unclassified (papers with no relation of the selected kind to any dataset). A paper matches when it has one of the relations in dataset_relation (default used,benchmarked) to one of the datasets. An id that is not a known, facet-visible dataset is a 400, never a silent widening to all papers. At most 30 values. The ids and counts are listed by GET /api/facets (facets.dataset).",
            "schema": {
              "type": "string",
              "example": "lobster"
            }
          },
          {
            "name": "dataset_relation",
            "in": "query",
            "description": "Comma-separated relations that count for the dataset filter (OR). Default used,benchmarked. Without dataset it only changes the dataset facet of /api/facets.",
            "schema": {
              "type": "string",
              "example": "used,benchmarked"
            },
            "x-values": [
              "used",
              "benchmarked",
              "mentioned",
              "unknown"
            ]
          },
          {
            "name": "date_reliable",
            "in": "query",
            "description": "true: a paper whose date is a placeholder (date_precision unknown) never matches since/until and sorts after every real date under sort=date, in both directions. Without since, until or sort=date it has no effect. Any other value is ignored.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Facet counts.",
            "headers": {
              "Cache-Control": {
                "description": "Successful GET answers are cacheable: public, max-age=300, s-maxage=3600 (the corpus changes once a day). Error answers are never cached.",
                "schema": {
                  "type": "string",
                  "examples": [
                    "public, max-age=300, s-maxage=3600"
                  ]
                }
              },
              "X-Request-Id": {
                "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{8,64}$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacetsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/FreeRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/FreeInternalError"
          },
          "503": {
            "$ref": "#/components/responses/FreeUnavailable"
          }
        },
        "x-filter-semantics": {
          "comma_lists": {
            "parameters": [
              "topic",
              "method",
              "asset",
              "quadrant",
              "type",
              "tcost_modeled",
              "oos_method",
              "data_resolution",
              "evaluation_type",
              "dataset",
              "dataset_relation"
            ],
            "within_one_parameter": "OR: any of the values matches",
            "across_parameters": "AND: every given parameter has to match",
            "limits": {
              "max_values_per_list": 30,
              "max_values_in_total": 50,
              "max_characters_per_list": 1000
            }
          },
          "tokens": {
            "unclassified": {
              "parameters": [
                "topic",
                "method",
                "asset",
                "dataset"
              ],
              "meaning": "papers that have no label (or no dataset relation) of that kind"
            },
            "unknown": {
              "parameters": [
                "tcost_modeled",
                "oos_method",
                "data_resolution",
                "evaluation_type"
              ],
              "meaning": "never assessed (NULL); not the same as unclear, where the model abstained"
            }
          },
          "evaluation_type": "also accepts unclear (the model abstained)",
          "dates": "since and until also accept YYYY and YYYY-MM; until=2024 means 2024-12-31 and until=2024-02 means 2024-02-29 (full dates are checked by shape only)",
          "ordering": "null sort keys last in both directions; ties are broken by paper_date descending then paper_id ascending",
          "unavailable_filters": "a parameter whose column or table is not live yet is ignored and named in warnings"
        }
      }
    },
    "/api/v1/premium/compare-papers": {
      "post": {
        "operationId": "comparePapers",
        "tags": [
          "premium"
        ],
        "summary": "Compare quant research papers (paid, $0.10 USDC per call via x402)",
        "description": "Side-by-side comparison of 2 to 10 corpus papers on methodology, datasets, transaction-cost treatment, out-of-sample validation, reproducibility and reported performance. Each cell is labelled author-reported or platform-classified and unknown values are explicit.\n\nPayment: $0.10 USDC per call (x402 v2, exact scheme, Solana). On Solana the payment is a signed USDC transfer transaction; the facilitator account named in the requirement (extra.feePayer) pays the network fee, and the transaction embeds a recent blockhash that expires after a short time, so sign it right before sending. Solana addresses are case-sensitive: use payTo and asset exactly as given. Send the request without a PAYMENT-SIGNATURE header (an empty body also works) to receive 402 with the PAYMENT-REQUIRED header, sign the requirement with an x402 client and resend the same request with PAYMENT-SIGNATURE. Invalid input and unknown ids are rejected with 4xx before any payment challenge. Settlement completes before the analysis runs; a retry with the X-Quant-Receipt token, or with a newly signed payment from the same payer (verified, never settled again), returns the stored result without a second charge; a replayed, already settled payment payload is refused with 402 `authorization_already_settled`.\n\nProvenance: Deterministic lookup of the corpus records (arXiv/SSRN metadata plus daily LLM-assisted extraction and scoring, verified verbatim against paper text); no language model runs at request time; every cell cites its source paper.\n\nError behaviour: Invalid input and unknown identifiers are rejected with 4xx before any payment challenge is issued. If execution fails after settlement the transaction is marked recoverable: repeating the same request with the platform receipt token (X-Quant-Receipt / _meta['x402/receipt-token']) or with a newly signed payment from the same payer (verified, never settled again) re-executes it without a second charge (bounded attempts). A replayed, already settled payment payload is refused. No automatic on-chain refund is issued and none is promised.\n\nThe same product is available as MCP tool compare_quant_research on https://thequant.space/mcp.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/PaymentSignature"
          },
          {
            "$ref": "#/components/parameters/QuantReceipt"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Request body. A request with NO body is treated as a probe and receives the 402 challenge.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComparePapersRequest"
              },
              "examples": {
                "default": {
                  "summary": "Registry example (papers and entities exist in the corpus)",
                  "value": {
                    "paper_ids": [
                      "2308.01112",
                      "2501.08822",
                      "2511.08571"
                    ],
                    "dimensions": [
                      "methodology",
                      "transaction_costs",
                      "out_of_sample_validation",
                      "reported_performance"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The paid document, after successful payment (or a stored result released against the receipt token or a fresh authorization of the same payer). The body is an envelope: `result` is the analysis document, `payment` the platform receipt, `meta` the identifiers. HTTP 200 is returned ONLY when the document was delivered; a failure after settlement is a 502 paid_execution_failed.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "$ref": "#/components/headers/PaymentResponse"
              },
              "X-Quant-Receipt": {
                "$ref": "#/components/headers/QuantReceipt"
              },
              "Cache-Control": {
                "description": "Always no-store.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComparePapersPaidResponse"
                },
                "examples": {
                  "abbreviated": {
                    "summary": "Abbreviated: envelope only",
                    "description": "Not a complete document; it shows the envelope. The complete structure is the response schema.",
                    "x-abbreviated": true,
                    "value": {
                      "result": {
                        "schema_version": "1.0",
                        "product": "compare_quant_research",
                        "product_version": "1.0.0",
                        "request": {
                          "paper_ids": [
                            "2308.01112",
                            "2501.08822",
                            "2511.08571"
                          ],
                          "dimensions": [
                            "methodology",
                            "transaction_costs",
                            "out_of_sample_validation",
                            "reported_performance"
                          ]
                        },
                        "_abbreviated": "Remaining sections omitted here; the complete structure is the response schema."
                      },
                      "payment": {
                        "receiptId": "rc_…",
                        "token": "…",
                        "transactionId": "tx_…",
                        "requestId": "req_…"
                      },
                      "meta": {
                        "transactionId": "tx_…",
                        "requestId": "req_…"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/PremiumBadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PremiumPaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/PremiumForbidden"
          },
          "404": {
            "$ref": "#/components/responses/PremiumNotFound"
          },
          "409": {
            "$ref": "#/components/responses/PremiumConflict"
          },
          "413": {
            "$ref": "#/components/responses/PremiumPayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/PremiumUnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/PremiumRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/PremiumInternalError"
          },
          "502": {
            "$ref": "#/components/responses/PremiumBadGateway"
          },
          "503": {
            "$ref": "#/components/responses/PremiumUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/PremiumGatewayTimeout"
          }
        },
        "x-payment-info": {
          "protocols": [
            {
              "x402": {}
            }
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.10"
          },
          "protocol": "x402",
          "x402Version": 2,
          "scheme": "exact",
          "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
          "networkName": "solana",
          "networkFamily": "svm",
          "testnet": false,
          "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          "currency": "USDC",
          "decimals": 6,
          "priceUsd": "0.10",
          "amountAtomic": "100000",
          "payTo": "configured at deployment",
          "pricingVersion": "p-81b60860",
          "maxTimeoutSeconds": 60,
          "challengeHeader": "PAYMENT-REQUIRED",
          "paymentHeader": "PAYMENT-SIGNATURE",
          "responseHeader": "PAYMENT-RESPONSE",
          "receiptHeader": "X-Quant-Receipt",
          "mcpTool": "compare_quant_research",
          "status": "live"
        },
        "x-limitations": [
          "Performance, cost-treatment, out-of-sample and reproducibility values are the authors' own claims, extracted by an LLM and verified verbatim against the paper text. The platform does not re-run or reproduce any result, so no value is marked independently verified.",
          "Reported metrics (Sharpe, returns, drawdown) come from different markets, samples and frequencies and are not comparable across papers; no performance ranking is produced.",
          "A value is returned as unknown when the paper does not report it or extraction confidence is below the platform gate; unknown does not mean zero or absent.",
          "Rigor, math-complexity and execution-realism scores are LLM-assisted classifications of each paper, not peer review.",
          "Only papers present in the platform corpus can be compared; at most 10 papers per request."
        ]
      }
    },
    "/api/v1/premium/literature-review": {
      "post": {
        "operationId": "generateLiteratureReview",
        "tags": [
          "premium"
        ],
        "summary": "Generate quant literature review (paid, $0.25 USDC per call via x402)",
        "description": "Source-grounded literature review for a quantitative-finance research question: ranked relevant papers, optional books, methodological comparison, supporting and contradictory evidence, limitations and open questions. Every claim cites corpus sources.\n\nPayment: $0.25 USDC per call (x402 v2, exact scheme, Solana). On Solana the payment is a signed USDC transfer transaction; the facilitator account named in the requirement (extra.feePayer) pays the network fee, and the transaction embeds a recent blockhash that expires after a short time, so sign it right before sending. Solana addresses are case-sensitive: use payTo and asset exactly as given. Send the request without a PAYMENT-SIGNATURE header (an empty body also works) to receive 402 with the PAYMENT-REQUIRED header, sign the requirement with an x402 client and resend the same request with PAYMENT-SIGNATURE. Invalid input and unknown ids are rejected with 4xx before any payment challenge. Settlement completes before the analysis runs; a retry with the X-Quant-Receipt token, or with a newly signed payment from the same payer (verified, never settled again), returns the stored result without a second charge; a replayed, already settled payment payload is refused with 402 `authorization_already_settled`.\n\nProvenance: Deterministic corpus retrieval (D1 full-text and Cloudflare AI Search) followed by at most one Workers AI call for stance and interpretation; claims cite corpus sources and unverifiable quotes are dropped.\n\nError behaviour: Invalid input and unknown identifiers are rejected with 4xx before any payment challenge is issued. If execution fails after settlement the transaction is marked recoverable: repeating the same request with the platform receipt token (X-Quant-Receipt / _meta['x402/receipt-token']) or with a newly signed payment from the same payer (verified, never settled again) re-executes it without a second charge (bounded attempts). A replayed, already settled payment payload is refused. No automatic on-chain refund is issued and none is promised.\n\nThe same product is available as MCP tool generate_quant_literature_review on https://thequant.space/mcp.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/PaymentSignature"
          },
          {
            "$ref": "#/components/parameters/QuantReceipt"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Request body. A request with NO body is treated as a probe and receives the 402 challenge.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateLiteratureReviewRequest"
              },
              "examples": {
                "default": {
                  "summary": "Registry example (papers and entities exist in the corpus)",
                  "value": {
                    "research_question": "How do transaction costs and market impact change the reported profitability of limit order book trading strategies?",
                    "max_papers": 5,
                    "include_books": false,
                    "include_contradictory_evidence": true,
                    "output_format": "json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The paid document, after successful payment (or a stored result released against the receipt token or a fresh authorization of the same payer). The body is an envelope: `result` is the analysis document, `payment` the platform receipt, `meta` the identifiers. HTTP 200 is returned ONLY when the document was delivered; a failure after settlement is a 502 paid_execution_failed.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "$ref": "#/components/headers/PaymentResponse"
              },
              "X-Quant-Receipt": {
                "$ref": "#/components/headers/QuantReceipt"
              },
              "Cache-Control": {
                "description": "Always no-store.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateLiteratureReviewPaidResponse"
                },
                "examples": {
                  "abbreviated": {
                    "summary": "Abbreviated: envelope only",
                    "description": "Not a complete document; it shows the envelope. The complete structure is the response schema.",
                    "x-abbreviated": true,
                    "value": {
                      "result": {
                        "schema_version": "1.0",
                        "product": "generate_quant_literature_review",
                        "product_version": "1.0.0",
                        "request": {
                          "research_question": "How do transaction costs and market impact change the reported profitability of limit order book trading strategies?",
                          "max_papers": 5,
                          "include_books": false,
                          "include_contradictory_evidence": true,
                          "output_format": "json"
                        },
                        "_abbreviated": "Remaining sections omitted here; the complete structure is the response schema."
                      },
                      "payment": {
                        "receiptId": "rc_…",
                        "token": "…",
                        "transactionId": "tx_…",
                        "requestId": "req_…"
                      },
                      "meta": {
                        "transactionId": "tx_…",
                        "requestId": "req_…"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/PremiumBadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PremiumPaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/PremiumForbidden"
          },
          "404": {
            "$ref": "#/components/responses/PremiumNotFound"
          },
          "409": {
            "$ref": "#/components/responses/PremiumConflict"
          },
          "413": {
            "$ref": "#/components/responses/PremiumPayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/PremiumUnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/PremiumRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/PremiumInternalError"
          },
          "502": {
            "$ref": "#/components/responses/PremiumBadGateway"
          },
          "503": {
            "$ref": "#/components/responses/PremiumUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/PremiumGatewayTimeout"
          }
        },
        "x-payment-info": {
          "protocols": [
            {
              "x402": {}
            }
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.25"
          },
          "protocol": "x402",
          "x402Version": 2,
          "scheme": "exact",
          "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
          "networkName": "solana",
          "networkFamily": "svm",
          "testnet": false,
          "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          "currency": "USDC",
          "decimals": 6,
          "priceUsd": "0.25",
          "amountAtomic": "250000",
          "payTo": "configured at deployment",
          "pricingVersion": "p-81b60860",
          "maxTimeoutSeconds": 60,
          "challengeHeader": "PAYMENT-REQUIRED",
          "paymentHeader": "PAYMENT-SIGNATURE",
          "responseHeader": "PAYMENT-RESPONSE",
          "receiptHeader": "X-Quant-Receipt",
          "mcpTool": "generate_quant_literature_review",
          "status": "live"
        },
        "x-limitations": [
          "Papers are selected by lexical and semantic retrieval over the platform corpus only; relevant work outside the corpus is not found.",
          "Stance classification and interpretation come from at most one language-model call over paper abstracts and are labelled model_interpretation, not peer review. When the model is disabled or unavailable, stances are returned as unclassified.",
          "Claims are tied to source ids; quoted excerpts are verified as verbatim substrings of the source text and dropped otherwise, but an interpretation can still be wrong or incomplete.",
          "Books are catalogue metadata (titles, authors, editions); book contents are not analysed.",
          "Rigor, math-complexity and execution-realism scores are LLM-assisted classifications of each paper, not peer review.",
          "The platform does not reproduce any reported result; reported performance is author-reported. The review is research support, not investment advice."
        ]
      }
    },
    "/api/v1/premium/graph-query": {
      "post": {
        "operationId": "exploreKnowledgeGraph",
        "tags": [
          "premium"
        ],
        "summary": "Explore quant knowledge graph (paid, $0.02 USDC per call via x402)",
        "description": "Typed neighbourhood of a topic, method, paper, book or author in the quant knowledge graph, with stable ids, deterministic ordering, per-edge provenance and an explicit verified or inferred flag. Depth up to 3, up to 100 nodes.\n\nPayment: $0.02 USDC per call (x402 v2, exact scheme, Solana). On Solana the payment is a signed USDC transfer transaction; the facilitator account named in the requirement (extra.feePayer) pays the network fee, and the transaction embeds a recent blockhash that expires after a short time, so sign it right before sending. Solana addresses are case-sensitive: use payTo and asset exactly as given. Send the request without a PAYMENT-SIGNATURE header (an empty body also works) to receive 402 with the PAYMENT-REQUIRED header, sign the requirement with an x402 client and resend the same request with PAYMENT-SIGNATURE. Invalid input and unknown ids are rejected with 4xx before any payment challenge. Settlement completes before the analysis runs; a retry with the X-Quant-Receipt token, or with a newly signed payment from the same payer (verified, never settled again), returns the stored result without a second charge; a replayed, already settled payment payload is refused with 402 `authorization_already_settled`.\n\nProvenance: Deterministic traversal of the published books-and-papers graph (graph-v1, edges carry evidence type, confidence and algorithm version) joined with corpus topic, method and author tables; no language model is used.\n\nError behaviour: Invalid input and unknown identifiers are rejected with 4xx before any payment challenge is issued. If execution fails after settlement the transaction is marked recoverable: repeating the same request with the platform receipt token (X-Quant-Receipt / _meta['x402/receipt-token']) or with a newly signed payment from the same payer (verified, never settled again) re-executes it without a second charge (bounded attempts). A replayed, already settled payment payload is refused. No automatic on-chain refund is issued and none is promised.\n\nThe same product is available as MCP tool explore_quant_knowledge_graph on https://thequant.space/mcp.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/PaymentSignature"
          },
          {
            "$ref": "#/components/parameters/QuantReceipt"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Request body. A request with NO body is treated as a probe and receives the 402 challenge.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExploreKnowledgeGraphRequest"
              },
              "examples": {
                "default": {
                  "summary": "Registry example (papers and entities exist in the corpus)",
                  "value": {
                    "entity_type": "topic",
                    "entity_id": "market-microstructure",
                    "relationships": [
                      "papers",
                      "books"
                    ],
                    "max_depth": 2,
                    "max_nodes": 25
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The paid document, after successful payment (or a stored result released against the receipt token or a fresh authorization of the same payer). The body is an envelope: `result` is the analysis document, `payment` the platform receipt, `meta` the identifiers. HTTP 200 is returned ONLY when the document was delivered; a failure after settlement is a 502 paid_execution_failed.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "$ref": "#/components/headers/PaymentResponse"
              },
              "X-Quant-Receipt": {
                "$ref": "#/components/headers/QuantReceipt"
              },
              "Cache-Control": {
                "description": "Always no-store.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphPaidResponse"
                },
                "examples": {
                  "abbreviated": {
                    "summary": "Abbreviated: envelope only",
                    "description": "Not a complete document; it shows the envelope. The complete structure is the response schema.",
                    "x-abbreviated": true,
                    "value": {
                      "result": {
                        "schema_version": "1.0",
                        "product": "explore_quant_knowledge_graph",
                        "product_version": "1.0.0",
                        "request": {
                          "entity_type": "topic",
                          "entity_id": "market-microstructure",
                          "relationships": [
                            "papers",
                            "books"
                          ],
                          "max_depth": 2,
                          "max_nodes": 25
                        },
                        "_abbreviated": "Remaining sections omitted here; the complete structure is the response schema."
                      },
                      "payment": {
                        "receiptId": "rc_…",
                        "token": "…",
                        "transactionId": "tx_…",
                        "requestId": "req_…"
                      },
                      "meta": {
                        "transactionId": "tx_…",
                        "requestId": "req_…"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/PremiumBadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PremiumPaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/PremiumForbidden"
          },
          "404": {
            "$ref": "#/components/responses/PremiumNotFound"
          },
          "409": {
            "$ref": "#/components/responses/PremiumConflict"
          },
          "413": {
            "$ref": "#/components/responses/PremiumPayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/PremiumUnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/PremiumRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/PremiumInternalError"
          },
          "502": {
            "$ref": "#/components/responses/PremiumBadGateway"
          },
          "503": {
            "$ref": "#/components/responses/PremiumUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/PremiumGatewayTimeout"
          }
        },
        "x-payment-info": {
          "protocols": [
            {
              "x402": {}
            }
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          },
          "protocol": "x402",
          "x402Version": 2,
          "scheme": "exact",
          "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
          "networkName": "solana",
          "networkFamily": "svm",
          "testnet": false,
          "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          "currency": "USDC",
          "decimals": 6,
          "priceUsd": "0.02",
          "amountAtomic": "20000",
          "payTo": "configured at deployment",
          "pricingVersion": "p-81b60860",
          "maxTimeoutSeconds": 60,
          "challengeHeader": "PAYMENT-REQUIRED",
          "paymentHeader": "PAYMENT-SIGNATURE",
          "responseHeader": "PAYMENT-RESPONSE",
          "receiptHeader": "X-Quant-Receipt",
          "mcpTool": "explore_quant_knowledge_graph",
          "status": "live"
        },
        "x-limitations": [
          "Only AUTHORED and HAS_EDITION edges are verified (identifier-backed records). COVERS_TOPIC, COVERS_METHOD, USES_METHOD, RELATED_TO and SIMILAR_TO edges are rule-based inferences with a confidence score, not facts.",
          "Author-to-paper links that are not identifier-backed are name matches and are marked unverified.",
          "The graph is a snapshot built by a batch pipeline (algorithm graph-v1) and can lag the daily paper corpus.",
          "Results are truncated deterministically at max_nodes; the truncation block states what was left out."
        ]
      }
    },
    "/api/v1/premium/products": {
      "get": {
        "operationId": "listPremiumProducts",
        "security": [],
        "tags": [
          "premium"
        ],
        "summary": "Premium product catalogue (free)",
        "description": "Free catalogue of the paid products with USD prices, the pricing version, the payment network and status flags. Does not require payment.",
        "responses": {
          "200": {
            "description": "Catalogue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PremiumProductCatalog"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/PremiumNotFound"
          },
          "503": {
            "$ref": "#/components/responses/PremiumUnavailable"
          }
        }
      }
    },
    "/api/v1/premium/health": {
      "get": {
        "operationId": "getPremiumHealth",
        "security": [],
        "tags": [
          "premium"
        ],
        "summary": "Premium service health (free)",
        "description": "Liveness of the premium service. Does not require payment.",
        "responses": {
          "200": {
            "description": "Service is up.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PremiumHealth"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/PremiumUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "BadRequest": {
        "description": "Invalid parameter.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "No such paper.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PremiumBadRequest": {
        "description": "The request was rejected before any payment challenge was issued: malformed JSON, schema violation or limit exceeded.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "invalid_request": {
                "summary": "Schema violation",
                "value": {
                  "error": {
                    "code": "invalid_request",
                    "message": "invalid input",
                    "errors": [
                      {
                        "path": "/paper_ids",
                        "message": "must contain at least 2 items"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "PremiumPaymentRequired": {
        "description": "Payment required (x402 v2). Every 402 carries a fresh PAYMENT-REQUIRED header (machine-readable requirements; resend the same request with a PAYMENT-SIGNATURE header) and is never cached. The body error.code says why: `payment_required` (no payment sent, also for an empty probe body, issued before any work), `payment_invalid` (the payment was sent but rejected: wrong amount, network, asset, payee, resource or expired window, a failed facilitator verification, or an authorization that was already used and failed; details.reason names the cause, nothing was charged), `payment_settlement_failed` (verification passed but the facilitator reported the on-chain settlement as failed: nothing was charged and no analysis ran; sign a new payment).",
        "headers": {
          "PAYMENT-REQUIRED": {
            "$ref": "#/components/headers/PaymentRequired"
          },
          "Cache-Control": {
            "description": "Always no-store.",
            "schema": {
              "type": "string",
              "const": "no-store"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "payment_required": {
                "summary": "No payment sent (challenge)",
                "value": {
                  "error": {
                    "code": "payment_required",
                    "message": "Payment required",
                    "details": {
                      "x402Version": 2,
                      "pricing": {
                        "product": "compare_quant_research",
                        "priceUsd": "0.10",
                        "amountAtomic": "100000",
                        "currency": "USDC",
                        "maxTimeoutSeconds": 60
                      }
                    }
                  }
                }
              },
              "payment_invalid": {
                "summary": "Payment rejected (nothing charged)",
                "value": {
                  "error": {
                    "code": "payment_invalid",
                    "message": "Invalid payment: payment amount is lower than the price (expected 100000 atomic USDC)",
                    "details": {
                      "x402Version": 2,
                      "reason": "amount"
                    }
                  }
                }
              },
              "authorization_already_settled": {
                "summary": "Replayed payload of a settled payment (nothing released)",
                "value": {
                  "error": {
                    "code": "payment_invalid",
                    "message": "This payment authorization was already used for a settled payment. The stored result is released only for the X-Quant-Receipt token of the original response, or for a newly signed authorization from the same payer for this request (it is verified but never settled, so you are not charged again).",
                    "details": {
                      "x402Version": 2,
                      "reason": "authorization_already_settled"
                    }
                  }
                }
              },
              "payment_settlement_failed": {
                "summary": "Settlement failed (nothing charged, no analysis ran)",
                "value": {
                  "error": {
                    "code": "payment_settlement_failed",
                    "message": "Payment settlement failed: settlement_failed",
                    "details": {
                      "x402Version": 2,
                      "reason": "settlement_failed"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PremiumForbidden": {
        "description": "The X-Quant-Receipt token is not valid for this request (unknown, for a different request or payer, or not settled). Nothing was charged and nothing was run.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "receipt_invalid": {
                "summary": "Receipt does not match",
                "value": {
                  "error": {
                    "code": "receipt_invalid",
                    "message": "the receipt token is not valid for this request"
                  }
                }
              }
            }
          }
        }
      },
      "PremiumNotFound": {
        "description": "A paper or graph entity named in the request does not exist in the corpus (checked before any payment challenge), or the path is unknown.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "unknown_paper": {
                "summary": "Unknown paper",
                "value": {
                  "error": {
                    "code": "unknown_paper",
                    "message": "One or more papers are not in the corpus.",
                    "details": {
                      "missing": [
                        "2601.00000"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PremiumConflict": {
        "description": "The request cannot be served right now and nothing was charged twice: either the same request is already being processed (`request_in_progress`, retry with the same payment after Retry-After; a payment authorization that is already settled is answered with a 402 `payment_invalid` / `authorization_already_settled` challenge instead) or the payment authorization is already bound to a different request (`payment_bound_to_other_request`, sign a new payment).",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "request_in_progress": {
                "summary": "Duplicate in flight",
                "value": {
                  "error": {
                    "code": "request_in_progress",
                    "message": "this request is already being processed",
                    "recoverable": true,
                    "retry_after_seconds": 2,
                    "retry": "Repeat the same request (same body, same PAYMENT-SIGNATURE or X-Quant-Receipt) in a few seconds; you will not be charged twice."
                  }
                }
              },
              "payment_bound_to_other_request": {
                "summary": "Authorization used for another request",
                "value": {
                  "error": {
                    "code": "payment_bound_to_other_request",
                    "message": "this payment authorization is already bound to a different request and will not be used again",
                    "request_id": "req_0123456789abcdef0123456789abcdef01234567"
                  }
                }
              }
            }
          }
        }
      },
      "PremiumPayloadTooLarge": {
        "description": "The request body exceeds 16384 bytes (checked before forwarding).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "payload_too_large": {
                "summary": "Body too large",
                "value": {
                  "error": {
                    "code": "payload_too_large",
                    "message": "Request bodies are limited to 16384 bytes."
                  }
                }
              }
            }
          }
        }
      },
      "PremiumUnsupportedMediaType": {
        "description": "The request body is not JSON (Content-Type must be application/json).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "unsupported_media_type": {
                "summary": "Not JSON",
                "value": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Content-Type must be application/json"
                  }
                }
              }
            }
          }
        }
      },
      "PremiumRateLimited": {
        "description": "Rate limited.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "rate_limited": {
                "summary": "Rate limited",
                "value": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests.",
                    "retry_after_seconds": 10
                  }
                }
              }
            }
          }
        }
      },
      "PremiumInternalError": {
        "description": "Unexpected failure or invalid server configuration, before any payment was taken (a failure AFTER settlement is a 502 paid_execution_failed, never a 500).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "internal_error": {
                "summary": "Unexpected failure",
                "value": {
                  "error": {
                    "code": "internal_error",
                    "message": "internal error"
                  }
                }
              },
              "config_invalid": {
                "summary": "Payment configuration invalid (fails closed)",
                "value": {
                  "error": {
                    "code": "config_invalid",
                    "message": "the payment configuration is invalid; paid routes are unavailable"
                  }
                }
              }
            }
          }
        }
      },
      "PremiumBadGateway": {
        "description": "Two cases, told apart by error.code. `paid_execution_failed`: the payment WAS settled but the analysis failed afterwards. The response is deliberately a 5xx, never a 200 with an error body: HTTP 200 means the paid document was delivered. It carries PAYMENT-RESPONSE (the settlement) and X-Quant-Receipt; error.recoverable is true while recovery attempts remain (3 in total). Repeat the request with the X-Quant-Receipt token, or with a newly signed payment from the same payer (it is verified, never settled again): the analysis is re-run under the original payment, there is no second charge. A replayed, already settled payment payload is refused. There is no automatic on-chain refund. `upstream_unavailable` (from the Pages proxy): the premium service did not answer in time; if a payment was submitted it is not lost (the Worker keeps running): retry with the same PAYMENT-SIGNATURE while it is processing, or with the receipt token / a newly signed payment from the same payer once settled.",
        "headers": {
          "PAYMENT-RESPONSE": {
            "$ref": "#/components/headers/PaymentResponse"
          },
          "X-Quant-Receipt": {
            "$ref": "#/components/headers/QuantReceipt"
          },
          "Cache-Control": {
            "description": "Always no-store.",
            "schema": {
              "type": "string",
              "const": "no-store"
            }
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "paid_execution_failed": {
                "summary": "Failure after settlement (recoverable)",
                "value": {
                  "error": {
                    "code": "paid_execution_failed",
                    "message": "the paid analysis failed after your payment settled",
                    "recoverable": true,
                    "request_id": "req_0123456789abcdef0123456789abcdef01234567",
                    "transaction_id": "tx_01hzzzzzzzzzzzzzzzzzzzzzzz",
                    "retry": "Repeat the same request with the X-Quant-Receipt token (details.receiptToken), or with a newly signed payment from the same payer (it is verified, never settled). The payment is already settled: you will not be charged again. No automatic on-chain refund exists.",
                    "details": {
                      "transactionId": "tx_01hzzzzzzzzzzzzzzzzzzzzzzz",
                      "requestId": "req_0123456789abcdef0123456789abcdef01234567",
                      "receiptToken": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
                      "attempts": 1,
                      "cause": "timeout"
                    }
                  }
                }
              },
              "upstream_unavailable": {
                "summary": "Proxy did not get an answer",
                "value": {
                  "error": {
                    "code": "upstream_unavailable",
                    "message": "The premium research service did not answer in time. If a payment was submitted it is not lost: repeat the same request with the same PAYMENT-SIGNATURE header while it is still being processed, or with the X-Quant-Receipt token (or a newly signed payment from the same payer) once it is settled, and you will not be charged twice.",
                    "recoverable": true,
                    "retry_after_seconds": 5,
                    "retry": "Repeat the identical request with the same PAYMENT-SIGNATURE or X-Quant-Receipt after a few seconds. A settled payment is released only against the receipt token or a newly signed payment from the same payer (verified, never settled again)."
                  }
                }
              }
            }
          }
        }
      },
      "PremiumUnavailable": {
        "description": "The request cannot be served right now. error.code: `premium_unavailable` (not enabled on this deployment), `payments_disabled` (payments are switched off; no challenge is issued), `product_disabled`, `upstream_unavailable` (a dependency such as the facilitator, the ledger or the graph data is down; checked BEFORE any payment is taken whenever possible), and `settlement_unconfirmed` (the payment was submitted but its on-chain settlement is not yet confirmed; nothing was executed and the payer is not charged twice: repeat the same request with the same PAYMENT-SIGNATURE after Retry-After, the outcome is resolved from chain state, and the stored result is then released only against the receipt token or a newly signed payment from the same payer).",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "premium_unavailable": {
                "summary": "Not enabled",
                "value": {
                  "error": {
                    "code": "premium_unavailable",
                    "message": "The premium research API is not enabled on this deployment."
                  }
                }
              },
              "payments_disabled": {
                "summary": "Payments off",
                "value": {
                  "error": {
                    "code": "payments_disabled",
                    "message": "payments are disabled on this deployment; no payment challenge is issued"
                  }
                }
              },
              "upstream_unavailable": {
                "summary": "Dependency down (nothing charged)",
                "value": {
                  "error": {
                    "code": "upstream_unavailable",
                    "message": "graph data could not be fetched",
                    "retry_after_seconds": 5
                  }
                }
              },
              "settlement_unconfirmed": {
                "summary": "Settlement outcome not known yet (recoverable)",
                "value": {
                  "error": {
                    "code": "settlement_unconfirmed",
                    "message": "the settlement outcome is not known yet. No result was produced and nothing will be executed until the settlement is confirmed.",
                    "recoverable": true,
                    "retry_after_seconds": 5,
                    "request_id": "req_0123456789abcdef0123456789abcdef01234567",
                    "transaction_id": "tx_01hzzzzzzzzzzzzzzzzzzzzzzz",
                    "retry": "Repeat the same request with the same PAYMENT-SIGNATURE payload in a few seconds. The settlement is resolved from chain state; you will not be charged twice. Once it is confirmed the stored result is released only against the X-Quant-Receipt token or a newly signed payment from the same payer (verified, never settled).",
                    "details": {
                      "transactionId": "tx_01hzzzzzzzzzzzzzzzzzzzzzzz",
                      "requestId": "req_0123456789abcdef0123456789abcdef01234567"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PremiumGatewayTimeout": {
        "description": "The payment facilitator did not answer the verification in time. No payment was taken and nothing ran; sign a new payment and retry.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PremiumError"
            },
            "examples": {
              "timeout": {
                "summary": "Facilitator verify timeout",
                "value": {
                  "error": {
                    "code": "timeout",
                    "message": "the payment facilitator did not answer in time; no payment was taken. Sign a new payment and retry.",
                    "recoverable": false,
                    "retry_after_seconds": 5
                  }
                }
              }
            }
          }
        }
      },
      "FreeRateLimited": {
        "description": "Too many requests. Emitted by the application limiter once quota enforcement is switched on (it is off by default: a shadow mode only records the decision), and by the zone rule at the edge (whose body is not JSON and cannot be relied on). Wait Retry-After seconds. The limit is per caller and per cost class, approximate and eventually consistent: do not read it as a quota counter, no remaining count is returned. Cheaper requests (cache hits, ids batches) cost less than facet counts or semantic search. Never cached.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          "RateLimit-Policy": {
            "description": "The budget that applied, as an HTTP structured field list (draft-ietf-httpapi-ratelimit-headers): one item per window, \"<scope>-<window>\";q=<quota>;qu=\"cost-units\";w=<window seconds>. The quota unit cost-units is this API's own weighted unit (a cached read costs 1, a facet count that misses the cache 10), not a request count. Provisional values that can change without notice. Sent only on a refusal.",
            "schema": {
              "type": "string",
              "examples": [
                "\"client-minute\";q=120;qu=\"cost-units\";w=60, \"client-day\";q=3000;qu=\"cost-units\";w=86400"
              ]
            }
          },
          "RateLimit": {
            "description": "Remaining budget and seconds until the window resets, e.g. \"route-day\";r=0;t=1800. Sent on a refusal ONLY when the counter is exact (the strict daily budgets); the flood limiter is approximate and never advertises a remaining count. Retry-After takes precedence.",
            "schema": {
              "type": "string"
            }
          },
          "X-Request-Id": {
            "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{8,64}$"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RateLimitError"
            }
          }
        }
      },
      "FreeUnavailable": {
        "description": "Temporarily unavailable: the database or a required backend is not answering, an operator switched this route off, or a strict budget could not be checked. Nothing was changed. Retry after Retry-After seconds. Never cached.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          "X-Request-Id": {
            "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{8,64}$"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ServiceError"
            }
          }
        }
      },
      "FreeInternalError": {
        "description": "The request failed on the server. The body is a fixed string (no database or upstream error text); the detail is only in the server log, found through request_id / X-Request-Id when the guard is active. Never cached. Retrying later is reasonable; repeating the identical request at once is not.",
        "headers": {
          "X-Request-Id": {
            "description": "Id of this request, also written to the server logs. A caller-supplied X-Request-Id of 8 to 64 characters from A-Z a-z 0-9 . _ - is echoed, otherwise a new one is generated. Quote it when reporting a problem. Never contains the caller's address or query text. Present on every answer of the hardened routes.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{8,64}$"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ServiceError"
            }
          }
        }
      },
      "FreeSnapshotChanged": {
        "description": "409 snapshot_changed: the data was updated (the daily sync published a new snapshot) after the cursor was issued, so continuing would mix two states of the corpus. Start again with cursor=start. Tokens issued before this check existed carry no snapshot and keep working.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "Machine-readable reason, present on some errors: snapshot_changed (409, cursor from another snapshot), schema_probe_failed (503)."
          }
        },
        "required": [
          "error"
        ]
      },
      "Paper": {
        "type": "object",
        "properties": {
          "paper_id": {
            "type": "string",
            "description": "arXiv id or ssrn-<id>."
          },
          "title": {
            "type": "string"
          },
          "paper_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Topic-hub slugs; hub page at https://thequant.space/topics/<slug>/."
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Method slugs; hub page at https://thequant.space/methods/<slug>/."
          },
          "asset_classes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Keywords extracted from the abstract."
          },
          "paper_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "primary_category": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary arXiv category."
          },
          "quadrant": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Holy Grail",
              "Street Traders",
              "Lab Rats",
              "Philosophers",
              null
            ]
          },
          "math_complexity": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 10
          },
          "empirical_rigor": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 10
          },
          "hub_score": {
            "type": [
              "number",
              "null"
            ],
            "description": "0.6*empirical_rigor + 0.4*math_complexity."
          },
          "code_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "paper_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The paper (arXiv PDF or SSRN page)."
          },
          "page_url": {
            "type": "string",
            "description": "The paper's page on thequant.space."
          },
          "summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "reports_backtest": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "true when the paper reports a backtest of its own strategy on real market data. null: not assessed."
          },
          "sharpe": {
            "type": [
              "number",
              "null"
            ],
            "description": "Reported Sharpe ratio of the paper's own strategy (the authors' claim, extracted and verified verbatim; not reproduced). null: none reported."
          },
          "annual_return_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Reported annualised return, percent."
          },
          "max_drawdown_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Reported maximum drawdown, percent."
          },
          "sample_start": {
            "type": [
              "string",
              "null"
            ],
            "description": "Start of the reported sample (as written, YYYY or YYYY-MM-DD)."
          },
          "sample_end": {
            "type": [
              "string",
              "null"
            ],
            "description": "End of the reported sample."
          },
          "transaction_costs": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Headline result stated net of transaction costs. false is an extraction default, not an authors' statement; see tcost_modeled."
          },
          "out_of_sample": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The paper reports an out-of-sample result."
          },
          "evaluation_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Headline empirical result. null: never assessed; unclear: the model abstained.",
            "enum": [
              "trading-pnl",
              "execution-cost",
              "forecast-accuracy",
              "pricing-calibration",
              "none",
              "unclear",
              null
            ]
          },
          "tcost_modeled": {
            "type": [
              "string",
              "null"
            ],
            "description": "Transaction costs applied to the reported results. null: never assessed, which is not the same as unclear (assessed, no admissible answer). n/a: not applicable.",
            "enum": [
              "yes",
              "partial",
              "no",
              "n/a",
              "unclear",
              null
            ]
          },
          "tcost_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where tcost_modeled comes from, once the canonical transaction-cost rule is live: front_matter (the platform classifier), evidence_card (the evidence-card extractor, only with a verbatim quote), conflict (the two disagree; tcost_modeled is then unclear), none (nothing admissible). Absent or null before that.",
            "enum": [
              "front_matter",
              "evidence_card",
              "conflict",
              "none",
              null
            ]
          },
          "oos_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "Out-of-sample validation of the reported results. none means no method found, not bad.",
            "enum": [
              "holdout",
              "walk-forward",
              "cross-validation",
              "none",
              "unclear",
              null
            ]
          },
          "data_resolution": {
            "type": [
              "string",
              "null"
            ],
            "description": "Finest resolution of market data used in the evaluation.",
            "enum": [
              "l2-book",
              "tick",
              "intraday-bars",
              "daily",
              "weekly-monthly",
              "synthetic",
              "none",
              "unclear",
              null
            ]
          },
          "empirical_rigor_raw": {
            "type": [
              "number",
              "null"
            ],
            "description": "Empirical rigor before the rule-based cap. Present (not null) only when empirical_rigor was capped."
          },
          "rigor_cap_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the cap applied."
          },
          "score_basis": {
            "type": "string",
            "enum": [
              "abstract"
            ],
            "description": "Present only on provisional scores: both scores were made from the abstract alone."
          },
          "date_precision": {
            "type": "string",
            "enum": [
              "day",
              "year",
              "unknown"
            ],
            "description": "Precision of paper_date. year: only the year is known (placeholder 01-01). unknown: paper_date is a placeholder. Never print a year or unknown date as an exact day."
          }
        }
      },
      "PaperFull": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Paper"
          },
          {
            "type": "object",
            "properties": {
              "abstract": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "rationale": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The written justification for the two scores."
              },
              "flowchart": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Mermaid source of the research flowchart (goal, data, method, computation, findings)."
              },
              "doi": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "journal_ref": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "related": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Paper"
                }
              },
              "strategy": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Strategy the paper evaluates, when it reports a backtest."
              },
              "backtest_market": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "backtest_asset_class": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "backtest_frequency": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "sharpe_benchmark": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "total_return_pct": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "metrics_confidence": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        ]
      },
      "PaperList": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Papers matching the filters."
          },
          "count": {
            "type": "integer",
            "description": "Papers in this page."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "params": {
            "type": "object",
            "additionalProperties": true,
            "description": "The normalised filters that were applied.",
            "properties": {
              "match": {
                "type": "string",
                "enum": [
                  "all",
                  "any",
                  "exact",
                  "partial"
                ],
                "description": "partial: no paper had every term, the answer shows the papers that match most of them (see warnings)."
              },
              "min_terms": {
                "type": "integer",
                "description": "With match=partial: the minimum number of q terms a listed paper matches."
              },
              "ids": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "With ids: the normalised, de-duplicated request, including ids that matched no paper."
              },
              "sort": {
                "type": "string"
              },
              "order": {
                "type": "string"
              },
              "limit": {
                "type": "integer"
              },
              "offset": {
                "type": "integer"
              },
              "q": {
                "type": "string"
              }
            }
          },
          "next": {
            "type": "string",
            "description": "Relative URL of the next page, when there is one."
          },
          "papers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Paper"
            }
          },
          "snapshot": {
            "type": "string",
            "description": "Id of the discovery snapshot (D1 meta row written by the daily sync) the answer belongs to; the same id is on GET /api/facets and in the static index manifest. Left out when the database has none. A walk across pages or requests that sees a changed snapshot crossed a data refresh."
          },
          "next_cursor": {
            "type": "string",
            "description": "Token for the next page; present only on cursor requests and only when another page exists. Opaque."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "For example: a filter that is not live yet and was ignored, or the partial-match notice when no paper has every term of q."
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Hub": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          },
          "data_url": {
            "type": "string",
            "description": "Per-topic JSON shard (topics only)."
          },
          "count": {
            "type": "integer"
          },
          "rigor7_share": {
            "type": "integer",
            "description": "Percent of papers with empirical_rigor >= 7."
          },
          "with_code": {
            "type": "integer"
          },
          "guides": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Guide slugs (methods only); text via https://thequant.space/guides/<slug>/."
          }
        }
      },
      "HubList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "topics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Hub"
            }
          },
          "methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Hub"
            }
          }
        }
      },
      "PaperEvidence": {
        "type": "object",
        "description": "Evidence card of one paper. Everything is the authors' own claim; nothing is reproduced. See https://thequant.space/agents/#paper-evidence",
        "properties": {
          "paper_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paper_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "paper_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "paper_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "page_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "scores": {
            "type": "object",
            "properties": {
              "empirical_rigor": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "math_complexity": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "quadrant": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "proposes": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "none_found",
                  "not_extracted",
                  "not_applicable"
                ],
                "description": "available = the section has content; none_found = the paper was processed and nothing was found; not_extracted = the paper has not been processed; not_applicable = the question does not apply."
              },
              "statement": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "quote": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "summary": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "strategy": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "assumptions": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "none_found",
                  "not_extracted",
                  "not_applicable"
                ],
                "description": "available = the section has content; none_found = the paper was processed and nothing was found; not_extracted = the paper has not been processed; not_applicable = the question does not apply."
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "assumption": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "market",
                        "model",
                        "data",
                        "execution",
                        "statistical",
                        "other"
                      ]
                    },
                    "stated": {
                      "type": "string",
                      "enum": [
                        "explicit",
                        "implied"
                      ]
                    },
                    "quote": {
                      "type": "string",
                      "description": "Verbatim text from the paper."
                    },
                    "support": {
                      "type": "string",
                      "enum": [
                        "full",
                        "partial"
                      ],
                      "description": "full = every figure in the item is in the quoted sentences; partial = a figure is stated elsewhere in the paper. Absent on older cards."
                    }
                  }
                }
              }
            }
          },
          "datasets": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "none_found",
                  "not_extracted",
                  "not_applicable"
                ],
                "description": "available = the section has content; none_found = the paper was processed and nothing was found; not_extracted = the paper has not been processed; not_applicable = the question does not apply."
              },
              "items": {
                "type": "array",
                "description": "Data the paper itself uses, as the paper names it.",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "provider": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "kind": {
                      "type": "string"
                    },
                    "access": {
                      "type": "string",
                      "enum": [
                        "public",
                        "commercial",
                        "proprietary",
                        "unknown"
                      ]
                    },
                    "period": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "universe": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "known_id": {
                      "type": "string",
                      "description": "Stable id when the dataset is in the dictionary."
                    },
                    "quote": {
                      "type": "string",
                      "description": "Verbatim text from the paper."
                    },
                    "support": {
                      "type": "string",
                      "enum": [
                        "full",
                        "partial"
                      ],
                      "description": "full = every figure in the item is in the quoted sentences; partial = a figure is stated elsewhere in the paper. Absent on older cards."
                    }
                  }
                }
              },
              "known": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "Well-known vendors and public datasets found by a dictionary over the full text (no model). null = the pass has not run.",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "access": {
                      "type": "string"
                    },
                    "quote": {
                      "type": "string",
                      "description": "Verbatim text from the paper."
                    },
                    "mentions": {
                      "type": "integer"
                    },
                    "used_in": {
                      "type": "integer"
                    }
                  }
                }
              },
              "sample": {
                "type": "object",
                "properties": {
                  "start": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "end": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "market": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "asset_class": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "frequency": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "data_resolution": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "transaction_costs": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "none_found",
                  "not_extracted",
                  "not_applicable"
                ],
                "description": "available = the section has content; none_found = the paper was processed and nothing was found; not_extracted = the paper has not been processed; not_applicable = the question does not apply."
              },
              "modeled": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "yes",
                  "partial",
                  "no",
                  "n/a",
                  "unclear",
                  null
                ]
              },
              "headline_net_of_costs": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "detail": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The cost level as the paper states it."
              },
              "quote": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "meaning": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "results": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "none_found",
                  "not_extracted",
                  "not_applicable"
                ],
                "description": "available = the section has content; none_found = the paper was processed and nothing was found; not_extracted = the paper has not been processed; not_applicable = the question does not apply."
              },
              "evaluation_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "finding": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "quote": {
                      "type": "string",
                      "description": "Verbatim text from the paper."
                    },
                    "support": {
                      "type": "string",
                      "enum": [
                        "full",
                        "partial"
                      ],
                      "description": "full = every figure in the item is in the quoted sentences; partial = a figure is stated elsewhere in the paper. Absent on older cards."
                    }
                  }
                }
              },
              "reported_performance": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Sharpe, returns and drawdown when the paper reports a backtest."
              },
              "out_of_sample": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "headline_out_of_sample": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "independent_evidence": {
            "type": "object",
            "description": "Findings of papers by other authors that bear on the same question, and corpus-internal citations. Model-judged pointers, not verified replications; coverage is partial.",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "none_found",
                  "not_extracted",
                  "not_applicable"
                ],
                "description": "available = the section has content; none_found = the paper was processed and nothing was found; not_extracted = the paper has not been processed; not_applicable = the question does not apply."
              },
              "supports": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "paper": {
                      "type": "object",
                      "properties": {
                        "paper_id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "paper_date": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "authors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "empirical_rigor": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "page_url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "question": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The question both findings answer."
                    },
                    "this_paper_finding": {
                      "type": "string"
                    },
                    "other_paper_finding": {
                      "type": "string"
                    },
                    "other_paper_quote": {
                      "type": "string",
                      "description": "Verbatim text from the paper."
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "confidence": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "contradicts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "paper": {
                      "type": "object",
                      "properties": {
                        "paper_id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "paper_date": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "authors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "empirical_rigor": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "page_url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "question": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The question both findings answer."
                    },
                    "this_paper_finding": {
                      "type": "string"
                    },
                    "other_paper_finding": {
                      "type": "string"
                    },
                    "other_paper_quote": {
                      "type": "string",
                      "description": "Verbatim text from the paper."
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "confidence": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "qualifies": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "paper": {
                      "type": "object",
                      "properties": {
                        "paper_id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "paper_date": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "authors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "empirical_rigor": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "page_url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "question": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The question both findings answer."
                    },
                    "this_paper_finding": {
                      "type": "string"
                    },
                    "other_paper_finding": {
                      "type": "string"
                    },
                    "other_paper_quote": {
                      "type": "string",
                      "description": "Verbatim text from the paper."
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "confidence": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "compared_with": {
                "type": "integer",
                "description": "Other papers whose findings were compared with this paper's."
              },
              "citations": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "cited_by_in_corpus": {
                    "type": "integer"
                  },
                  "by_independent_authors": {
                    "type": "integer"
                  },
                  "how_cited": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    }
                  },
                  "independent_papers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "paper": {
                          "type": "object",
                          "properties": {
                            "paper_id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            },
                            "paper_date": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "authors": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "empirical_rigor": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "page_url": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        },
                        "how": {
                          "type": "string",
                          "enum": [
                            "used_as_baseline",
                            "uses_method_or_data",
                            "extends",
                            "discusses_findings"
                          ]
                        },
                        "quote": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  },
                  "scope": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "implementation": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "none_found",
                  "not_extracted",
                  "not_applicable"
                ],
                "description": "available = the section has content; none_found = the paper was processed and nothing was found; not_extracted = the paper has not been processed; not_applicable = the question does not apply."
              },
              "public": {
                "type": "boolean"
              },
              "code_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "replication": {
            "type": "object",
            "description": "What thequant.space's own replication harness re-ran for this paper, finding by finding. Present on every card; `card` is null unless a replication exists. Not run by the authors or a third party.",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "none_found",
                  "not_extracted",
                  "not_applicable"
                ],
                "description": "available = the section has content; none_found = the paper was processed and nothing was found; not_extracted = the paper has not been processed; not_applicable = the question does not apply."
              },
              "card": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "REPLICATED",
                      "PARTIALLY_REPLICATED"
                    ],
                    "description": "REPLICATED = every tested finding passed; PARTIALLY_REPLICATED = at least one passed and at least one was not tested. A paper with no passed finding has no card."
                  },
                  "claims": {
                    "type": "object",
                    "properties": {
                      "replicated": {
                        "type": "integer"
                      },
                      "not_tested": {
                        "type": "integer"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "finding": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "outcome": {
                              "type": "string",
                              "enum": [
                                "replicated",
                                "not_tested"
                              ]
                            },
                            "reason": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "description": "A finding counts as replicated only when a test of it passed through the re-implementation."
                  },
                  "proposes": {
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "assumptions": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "datasets": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "transaction_costs": {
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "findings": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "deviations": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "What was not tested and where the data differs from the paper's."
                  },
                  "attempts": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "text_source": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "model": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "version": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "extracted_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "extraction": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "text_source": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "version": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "extracted_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "provenance": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "docs": {
            "type": "string"
          }
        }
      },
      "PremiumError": {
        "title": "premium error",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "enum": [
                  "invalid_request",
                  "invalid_json",
                  "payload_too_large",
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "method_not_allowed",
                  "unknown_paper",
                  "unknown_entity",
                  "unsupported_media_type",
                  "payment_required",
                  "payment_invalid",
                  "payment_settlement_failed",
                  "payment_bound_to_other_request",
                  "request_in_progress",
                  "receipt_invalid",
                  "rate_limited",
                  "config_invalid",
                  "internal_error",
                  "paid_execution_failed",
                  "recovery_required",
                  "premium_unavailable",
                  "product_disabled",
                  "payments_disabled",
                  "upstream_unavailable",
                  "timeout",
                  "settlement_unconfirmed",
                  "illegal_transition"
                ]
              },
              "message": {
                "type": "string",
                "maxLength": 1000
              },
              "errors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "path",
                    "message"
                  ],
                  "properties": {
                    "path": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "message": {
                      "type": "string",
                      "maxLength": 500
                    }
                  }
                },
                "maxItems": 50,
                "description": "Field-level validation problems (JSON-pointer paths)."
              },
              "details": {
                "type": "object"
              },
              "request_id": {
                "type": "string",
                "maxLength": 80
              },
              "transaction_id": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 80
              },
              "recoverable": {
                "type": "boolean",
                "description": "True when a retry with the same payment or receipt token completes the request without a second charge."
              },
              "retry": {
                "type": "string",
                "maxLength": 500
              },
              "retry_after_seconds": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      },
      "PremiumPaymentRequired": {
        "type": "object",
        "description": "Decoded content of the PAYMENT-REQUIRED header (x402 v2): what to pay and how.",
        "required": [
          "x402Version",
          "accepts"
        ],
        "properties": {
          "x402Version": {
            "const": 2
          },
          "error": {
            "type": "string"
          },
          "resource": {
            "type": "object",
            "required": [
              "url"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "description": {
                "type": "string"
              },
              "mimeType": {
                "type": "string"
              },
              "serviceName": {
                "type": "string"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "accepts": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "scheme",
                "network",
                "amount",
                "asset",
                "payTo",
                "maxTimeoutSeconds"
              ],
              "properties": {
                "scheme": {
                  "const": "exact"
                },
                "network": {
                  "type": "string",
                  "pattern": "^(?:eip155:[0-9]+|solana:[1-9A-HJ-NP-Za-km-z]{32})$",
                  "description": "CAIP-2 network id: eip155:<chain id> (EVM) or solana:<genesis prefix> (Solana, case-sensitive)."
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]{0,29})$",
                  "description": "Price in atomic USDC units (6 decimals) as a decimal string."
                },
                "asset": {
                  "type": "string",
                  "pattern": "^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$",
                  "description": "USDC token: contract address (EVM, 0x hex) or mint address (Solana, base58, case-sensitive)."
                },
                "payTo": {
                  "type": "string",
                  "description": "Receiving address configured at deployment: 0x hex on EVM networks, base58 on Solana networks. Solana addresses are case-sensitive; use the value exactly as given."
                },
                "maxTimeoutSeconds": {
                  "type": "integer",
                  "minimum": 1
                },
                "extra": {
                  "type": "object",
                  "description": "Scheme-specific data. EVM networks: the EIP-712 domain of the token (name, version). Solana networks: feePayer (base58 address of the facilitator account that pays the network fee and co-signs the transaction) and transactionVersions (accepted transaction versions)."
                }
              }
            }
          },
          "extensions": {
            "type": "object",
            "description": "Protocol extensions; carries the Bazaar discovery metadata."
          }
        }
      },
      "PremiumPaymentReceipt": {
        "title": "premium platform receipt",
        "description": "Platform receipt returned next to the x402 settlement response (HTTP: X-Quant-Receipt header; MCP: _meta['x402/receipt']). The token re-fetches the stored result for the same request and payer.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "receiptId",
          "token",
          "transactionId",
          "requestId"
        ],
        "properties": {
          "receiptId": {
            "type": "string",
            "maxLength": 80
          },
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,512}$"
          },
          "transactionId": {
            "type": "string",
            "maxLength": 80
          },
          "requestId": {
            "type": "string",
            "pattern": "^req_[0-9a-f]{40}$"
          },
          "product": {
            "type": "string",
            "maxLength": 80
          },
          "pricingVersion": {
            "type": "string",
            "pattern": "^p-[0-9a-f]{8}$"
          },
          "amountAtomic": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,29})$"
          },
          "priceUsd": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{2,6}$"
          },
          "currency": {
            "const": "USDC"
          },
          "network": {
            "type": "string",
            "pattern": "^(?:eip155:[0-9]+|solana:[1-9A-HJ-NP-Za-km-z]{32})$",
            "description": "CAIP-2 network id (eip155:<chain id> or solana:<genesis prefix>)."
          },
          "asset": {
            "type": "string",
            "pattern": "^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$",
            "description": "Token contract (EVM, 0x hex) or mint (Solana, base58, case-sensitive)."
          },
          "payer": {
            "type": "string",
            "pattern": "^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$",
            "description": "Payer address: 0x hex (EVM, lower case) or base58 (Solana, case-sensitive)."
          },
          "payTo": {
            "type": "string",
            "pattern": "^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$",
            "description": "Receiver address: 0x hex (EVM) or base58 wallet (Solana, case-sensitive)."
          },
          "transactionHash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(?:0x[0-9a-fA-F]{64}|[1-9A-HJ-NP-Za-km-z]{86,88})$",
            "description": "Settlement transaction: 0x + 64 hex (EVM) or base58 signature (Solana, case-sensitive)."
          },
          "settledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PremiumProductCatalog": {
        "type": "object",
        "description": "Free catalogue of the premium products with prices, the pricing version and status flags. The object may gain fields; unknown fields must be ignored.",
        "properties": {
          "pricingVersion": {
            "type": "string",
            "description": "Identifier of the price table (\"p-\" plus 8 hex characters)."
          },
          "network": {
            "type": "string",
            "description": "CAIP-2 network the prices are payable on."
          },
          "products": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One product: id, MCP tool name, endpoint, USD price, atomic amount, enabled flag."
            }
          }
        }
      },
      "PremiumHealth": {
        "type": "object",
        "description": "Liveness report of the premium service. The object may gain fields; unknown fields must be ignored.",
        "properties": {
          "status": {
            "type": "string",
            "description": "ok when the service is up."
          }
        }
      },
      "ComparePapersRequest": {
        "title": "compare_quant_research input",
        "description": "Compare 2 to 10 corpus papers across selected dimensions. Paper ids are normalised (arXiv URL/prefix/version stripped); ids that normalise to the same paper are rejected; the order of paper_ids does not matter.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "paper_ids"
        ],
        "properties": {
          "paper_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1,
              "description": "arXiv id such as \"2511.08571\", \"arXiv:2511.08571v2\", an arxiv.org URL, or \"ssrn-<n>\"."
            },
            "minItems": 2,
            "maxItems": 10,
            "uniqueItems": true
          },
          "dimensions": {
            "type": "array",
            "items": {
              "enum": [
                "methodology",
                "datasets",
                "transaction_costs",
                "out_of_sample_validation",
                "reproducibility",
                "reported_performance"
              ]
            },
            "minItems": 1,
            "maxItems": 6,
            "uniqueItems": true,
            "default": [
              "methodology",
              "datasets",
              "transaction_costs",
              "out_of_sample_validation",
              "reproducibility",
              "reported_performance"
            ],
            "description": "Dimensions to compare; all six when omitted."
          }
        }
      },
      "ComparePapersResponse": {
        "title": "compare_quant_research output",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "product",
          "product_version",
          "request",
          "papers",
          "comparison",
          "evidence_summary",
          "limitations",
          "sources",
          "truncation",
          "provenance"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "product": {
            "const": "compare_quant_research"
          },
          "product_version": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "request": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "paper_ids",
              "dimensions"
            ],
            "properties": {
              "paper_ids": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
                },
                "minItems": 2,
                "maxItems": 10,
                "uniqueItems": true
              },
              "dimensions": {
                "type": "array",
                "items": {
                  "enum": [
                    "methodology",
                    "datasets",
                    "transaction_costs",
                    "out_of_sample_validation",
                    "reproducibility",
                    "reported_performance"
                  ]
                },
                "minItems": 1,
                "maxItems": 6,
                "uniqueItems": true
              }
            }
          },
          "papers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "paper_id",
                "title",
                "authors",
                "paper_date",
                "source_id",
                "links"
              ],
              "properties": {
                "paper_id": {
                  "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
                },
                "title": {
                  "type": "string",
                  "maxLength": 500,
                  "minLength": 1
                },
                "authors": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "maxItems": 50
                },
                "paper_date": {
                  "$ref": "#/components/schemas/ComparePapersResponse_date_or_null"
                },
                "source_id": {
                  "$ref": "#/components/schemas/ComparePapersResponse_source_id"
                },
                "links": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "paper_url",
                    "page_url",
                    "code_url"
                  ],
                  "properties": {
                    "paper_url": {
                      "$ref": "#/components/schemas/ComparePapersResponse_url_or_null"
                    },
                    "page_url": {
                      "$ref": "#/components/schemas/ComparePapersResponse_url_or_null"
                    },
                    "code_url": {
                      "$ref": "#/components/schemas/ComparePapersResponse_url_or_null"
                    }
                  }
                }
              }
            },
            "minItems": 2,
            "maxItems": 10,
            "description": "Sorted by paper_id."
          },
          "comparison": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "dimension",
                    "label",
                    "papers"
                  ],
                  "properties": {
                    "dimension": {
                      "const": "methodology"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "papers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "paper_id",
                          "cells"
                        ],
                        "properties": {
                          "paper_id": {
                            "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
                          },
                          "cells": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "paper_type",
                              "methods",
                              "strategy",
                              "evaluation_type"
                            ],
                            "properties": {
                              "paper_type": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "methods": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "strategy": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "evaluation_type": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              }
                            }
                          }
                        }
                      },
                      "minItems": 2,
                      "maxItems": 10
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "dimension",
                    "label",
                    "papers"
                  ],
                  "properties": {
                    "dimension": {
                      "const": "datasets"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "papers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "paper_id",
                          "cells"
                        ],
                        "properties": {
                          "paper_id": {
                            "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
                          },
                          "cells": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "backtest_market",
                              "backtest_asset_class",
                              "asset_classes",
                              "data_resolution",
                              "backtest_frequency",
                              "sample_period"
                            ],
                            "properties": {
                              "backtest_market": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "backtest_asset_class": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "asset_classes": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "data_resolution": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "backtest_frequency": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "sample_period": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              }
                            }
                          }
                        }
                      },
                      "minItems": 2,
                      "maxItems": 10
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "dimension",
                    "label",
                    "papers"
                  ],
                  "properties": {
                    "dimension": {
                      "const": "transaction_costs"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "papers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "paper_id",
                          "cells"
                        ],
                        "properties": {
                          "paper_id": {
                            "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
                          },
                          "cells": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "tcost_modeled",
                              "net_of_costs"
                            ],
                            "properties": {
                              "tcost_modeled": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "net_of_costs": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              }
                            }
                          }
                        }
                      },
                      "minItems": 2,
                      "maxItems": 10
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "dimension",
                    "label",
                    "papers"
                  ],
                  "properties": {
                    "dimension": {
                      "const": "out_of_sample_validation"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "papers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "paper_id",
                          "cells"
                        ],
                        "properties": {
                          "paper_id": {
                            "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
                          },
                          "cells": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "oos_method",
                              "out_of_sample"
                            ],
                            "properties": {
                              "oos_method": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "out_of_sample": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              }
                            }
                          }
                        }
                      },
                      "minItems": 2,
                      "maxItems": 10
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "dimension",
                    "label",
                    "papers"
                  ],
                  "properties": {
                    "dimension": {
                      "const": "reproducibility"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "papers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "paper_id",
                          "cells"
                        ],
                        "properties": {
                          "paper_id": {
                            "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
                          },
                          "cells": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "code_available",
                              "code_url",
                              "doi",
                              "journal_ref"
                            ],
                            "properties": {
                              "code_available": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "code_url": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "doi": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "journal_ref": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              }
                            }
                          }
                        }
                      },
                      "minItems": 2,
                      "maxItems": 10
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "dimension",
                    "label",
                    "papers"
                  ],
                  "properties": {
                    "dimension": {
                      "const": "reported_performance"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "papers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "paper_id",
                          "cells"
                        ],
                        "properties": {
                          "paper_id": {
                            "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
                          },
                          "cells": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "reports_backtest",
                              "sharpe",
                              "sharpe_benchmark",
                              "annual_return_pct",
                              "total_return_pct",
                              "max_drawdown_pct",
                              "metrics_confidence"
                            ],
                            "properties": {
                              "reports_backtest": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "sharpe": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "sharpe_benchmark": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "annual_return_pct": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "total_return_pct": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "max_drawdown_pct": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              },
                              "metrics_confidence": {
                                "$ref": "#/components/schemas/ComparePapersResponse_cell"
                              }
                            }
                          }
                        }
                      },
                      "minItems": 2,
                      "maxItems": 10
                    }
                  }
                }
              ]
            },
            "minItems": 1,
            "maxItems": 6,
            "description": "One block per requested dimension, in the canonical dimension order; each block has one row per paper (sorted by paper_id)."
          },
          "evidence_summary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "author_reported",
              "platform_classification",
              "model_interpretation",
              "independently_verified",
              "unknown"
            ],
            "properties": {
              "author_reported": {
                "type": "integer",
                "minimum": 0
              },
              "platform_classification": {
                "type": "integer",
                "minimum": 0
              },
              "model_interpretation": {
                "type": "integer",
                "minimum": 0
              },
              "independently_verified": {
                "type": "integer",
                "minimum": 0
              },
              "unknown": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "observations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComparePapersResponse_claim"
            },
            "maxItems": 30,
            "description": "Deterministic observations derived from the cells (e.g. how many papers model transaction costs)."
          },
          "limitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComparePapersResponse_limitation"
            },
            "minItems": 1,
            "maxItems": 100
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComparePapersResponse_source"
            },
            "minItems": 1,
            "maxItems": 200
          },
          "truncation": {
            "$ref": "#/components/schemas/ComparePapersResponse_truncation"
          },
          "provenance": {
            "$ref": "#/components/schemas/ComparePapersResponse_provenance"
          }
        }
      },
      "ComparePapersPaidResponse": {
        "type": "object",
        "description": "Envelope of a delivered paid response: the analysis document, the platform payment receipt and the request identifiers.",
        "required": [
          "result",
          "payment",
          "meta"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/ComparePapersResponse"
          },
          "payment": {
            "$ref": "#/components/schemas/PremiumPaymentReceipt"
          },
          "meta": {
            "type": "object",
            "description": "Identifiers of this paid request.",
            "required": [
              "transactionId",
              "requestId",
              "pricingVersion",
              "productVersion"
            ],
            "properties": {
              "transactionId": {
                "type": "string"
              },
              "requestId": {
                "type": "string",
                "pattern": "^req_[0-9a-f]{40}$"
              },
              "pricingVersion": {
                "type": "string",
                "pattern": "^p-[0-9a-f]{8}$"
              },
              "productVersion": {
                "type": "string"
              }
            }
          }
        }
      },
      "ComparePapersResponse_paper_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]{0,60}$",
        "description": "Canonical paper id (arXiv id, ssrn-<n>); no version suffix."
      },
      "ComparePapersResponse_source_id": {
        "type": "string",
        "pattern": "^src_[A-Za-z0-9_.:-]{1,80}$",
        "description": "Id of an entry of the document's sources[] array."
      },
      "ComparePapersResponse_claim_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{3,64}$",
        "description": "Stable claim id (deterministic from content)."
      },
      "ComparePapersResponse_evidence_class": {
        "enum": [
          "author_reported",
          "platform_classification",
          "model_interpretation",
          "independently_verified"
        ],
        "description": "author_reported: figure stated by the paper's authors; platform_classification: rule- or LLM-assisted label assigned by the platform; model_interpretation: language-model interpretation of retrieved text; independently_verified: reproduced by a third party (never emitted: the platform does not reproduce results)."
      },
      "ComparePapersResponse_date_or_null": {
        "type": [
          "string",
          "null"
        ],
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "ComparePapersResponse_url_or_null": {
        "type": [
          "string",
          "null"
        ],
        "maxLength": 2048,
        "pattern": "^https://"
      },
      "ComparePapersResponse_source_ids": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ComparePapersResponse_source_id"
        },
        "uniqueItems": true,
        "maxItems": 50
      },
      "ComparePapersResponse_source_ids_nonempty": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ComparePapersResponse_source_id"
        },
        "uniqueItems": true,
        "minItems": 1,
        "maxItems": 50
      },
      "ComparePapersResponse_source": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "title",
          "url",
          "identifier"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ComparePapersResponse_source_id"
          },
          "type": {
            "enum": [
              "paper",
              "book",
              "book_edition",
              "author",
              "topic",
              "method",
              "dataset",
              "methodology"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "url": {
            "$ref": "#/components/schemas/ComparePapersResponse_url_or_null"
          },
          "identifier": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "description": "arXiv id, SSRN id, DOI, ISBN or node id when known."
          }
        }
      },
      "ComparePapersResponse_cell": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "value",
          "status",
          "evidence_class",
          "source_ids"
        ],
        "description": "One comparison cell. Unknown values are explicit (status 'unknown', value null, reason set); they are never guessed or omitted.",
        "properties": {
          "value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "maxItems": 50,
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 200
                    },
                    {
                      "type": "number"
                    }
                  ]
                }
              },
              {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 40
                },
                "maxProperties": 4
              },
              {
                "type": "null"
              }
            ],
            "description": "Scalar, list of scalars, or {start,end} object; null only when status is unknown or not_applicable."
          },
          "status": {
            "enum": [
              "reported",
              "classified",
              "unknown",
              "not_applicable"
            ]
          },
          "evidence_class": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComparePapersResponse_evidence_class"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_ids": {
            "$ref": "#/components/schemas/ComparePapersResponse_source_ids"
          },
          "reason": {
            "type": "string",
            "maxLength": 500
          },
          "unit": {
            "type": "string",
            "maxLength": 40
          },
          "note": {
            "type": "string",
            "maxLength": 500
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "unknown"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": "null"
                },
                "evidence_class": {
                  "type": "null"
                },
                "reason": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "reason"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "not_applicable"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": "null"
                },
                "evidence_class": {
                  "const": "platform_classification"
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                },
                "reason": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "reason"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "reported"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "not": {
                    "type": "null"
                  }
                },
                "evidence_class": {
                  "enum": [
                    "author_reported",
                    "independently_verified"
                  ]
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "classified"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "not": {
                    "type": "null"
                  }
                },
                "evidence_class": {
                  "enum": [
                    "platform_classification",
                    "model_interpretation"
                  ]
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                }
              }
            }
          }
        ]
      },
      "ComparePapersResponse_claim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "claim_id",
          "text",
          "evidence_class",
          "source_ids"
        ],
        "properties": {
          "claim_id": {
            "$ref": "#/components/schemas/ComparePapersResponse_claim_id"
          },
          "text": {
            "type": "string",
            "maxLength": 1500,
            "minLength": 1
          },
          "evidence_class": {
            "$ref": "#/components/schemas/ComparePapersResponse_evidence_class"
          },
          "source_ids": {
            "$ref": "#/components/schemas/ComparePapersResponse_source_ids_nonempty"
          },
          "paper_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
            },
            "uniqueItems": true,
            "maxItems": 20
          },
          "quotes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source_id",
                "text"
              ],
              "properties": {
                "source_id": {
                  "$ref": "#/components/schemas/ComparePapersResponse_source_id"
                },
                "text": {
                  "type": "string",
                  "maxLength": 400,
                  "minLength": 1
                }
              }
            },
            "maxItems": 5,
            "description": "Verbatim excerpts of the cited source. Quotes that cannot be matched to the source text are dropped and counted in provenance.llm.dropped_unverifiable_quotes."
          }
        }
      },
      "ComparePapersResponse_limitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "limitation_id",
          "scope",
          "paper_id",
          "text",
          "evidence_class",
          "source_ids"
        ],
        "properties": {
          "limitation_id": {
            "$ref": "#/components/schemas/ComparePapersResponse_claim_id"
          },
          "scope": {
            "enum": [
              "platform",
              "paper",
              "comparison",
              "data",
              "graph",
              "retrieval",
              "model"
            ]
          },
          "paper_id": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComparePapersResponse_paper_id"
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 1500,
            "minLength": 1
          },
          "evidence_class": {
            "$ref": "#/components/schemas/ComparePapersResponse_evidence_class"
          },
          "source_ids": {
            "$ref": "#/components/schemas/ComparePapersResponse_source_ids_nonempty"
          }
        }
      },
      "ComparePapersResponse_truncation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "truncated",
          "reason",
          "returned",
          "omitted"
        ],
        "properties": {
          "truncated": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "returned": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Counts of records returned, by kind."
          },
          "omitted": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Counts of records left out because of limits, by kind."
          }
        }
      },
      "ComparePapersResponse_provenance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "product_version",
          "schema_version",
          "corpus_version",
          "data_updated",
          "graph_version",
          "pipeline",
          "llm",
          "evidence_policy"
        ],
        "properties": {
          "product": {
            "type": "string",
            "maxLength": 80
          },
          "product_version": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "schema_version": {
            "const": "1.0"
          },
          "corpus_version": {
            "type": "string",
            "maxLength": 120,
            "description": "Identifier of the corpus snapshot used: 'corpus-YYYY-MM-DD' (the day the corpus was last synced) or 'corpus-unknown'. Identical across all three products."
          },
          "data_updated": {
            "$ref": "#/components/schemas/ComparePapersResponse_date_or_null"
          },
          "graph_version": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          },
          "pipeline": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 120
            },
            "minItems": 1,
            "maxItems": 20,
            "description": "Ordered processing steps, e.g. d1_lookup, rule_based_comparison."
          },
          "llm": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "used",
              "model",
              "calls",
              "dropped_unverifiable_quotes"
            ],
            "properties": {
              "used": {
                "type": "boolean"
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 120
              },
              "calls": {
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              },
              "dropped_unverifiable_quotes": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "evidence_policy": {
            "type": "string",
            "maxLength": 600
          }
        }
      },
      "ComparePapersResponse_node_id": {
        "type": "string",
        "pattern": "^(?:(?:paper|topic|method):[A-Za-z0-9][A-Za-z0-9._/-]{0,80}|(?:bw|bp|be)_[A-Za-z0-9]{1,40})$"
      },
      "ComparePapersResponse_edge_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{3,64}$"
      },
      "GenerateLiteratureReviewRequest": {
        "title": "generate_quant_literature_review input",
        "description": "Generate a source-grounded literature review for a quantitative-finance research question from the corpus.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "research_question"
        ],
        "properties": {
          "research_question": {
            "type": "string",
            "maxLength": 500,
            "minLength": 10,
            "description": "Plain-language question of 10 to 500 characters; runs of whitespace are collapsed."
          },
          "max_papers": {
            "type": "integer",
            "minimum": 1,
            "maximum": 15,
            "default": 10
          },
          "include_books": {
            "type": "boolean",
            "default": false,
            "description": "Also list relevant books (catalogue metadata only)."
          },
          "include_contradictory_evidence": {
            "type": "boolean",
            "default": true
          },
          "output_format": {
            "enum": [
              "json",
              "markdown"
            ],
            "default": "json",
            "description": "markdown adds a rendered `markdown` field next to the structured sections."
          }
        }
      },
      "GenerateLiteratureReviewResponse": {
        "title": "generate_quant_literature_review output",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "product",
          "product_version",
          "request",
          "sections",
          "markdown",
          "limitations",
          "sources",
          "truncation",
          "provenance"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "product": {
            "const": "generate_quant_literature_review"
          },
          "product_version": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "request": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "research_question",
              "max_papers",
              "include_books",
              "include_contradictory_evidence",
              "output_format"
            ],
            "properties": {
              "research_question": {
                "type": "string",
                "maxLength": 500
              },
              "max_papers": {
                "type": "integer",
                "minimum": 1,
                "maximum": 15
              },
              "include_books": {
                "type": "boolean"
              },
              "include_contradictory_evidence": {
                "type": "boolean"
              },
              "output_format": {
                "enum": [
                  "json",
                  "markdown"
                ]
              }
            }
          },
          "sections": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "research_question",
              "executive_summary",
              "relevant_papers",
              "relevant_books",
              "methodological_comparison",
              "supporting_evidence",
              "contradictory_evidence",
              "research_limitations",
              "open_questions",
              "implementation_considerations",
              "source_references"
            ],
            "properties": {
              "research_question": {
                "type": "string",
                "maxLength": 500
              },
              "executive_summary": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                },
                "maxItems": 30,
                "minItems": 1
              },
              "relevant_papers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "rank",
                    "paper_id",
                    "title",
                    "authors",
                    "paper_date",
                    "stance",
                    "stance_evidence_class",
                    "relevance",
                    "platform_scores",
                    "source_ids"
                  ],
                  "properties": {
                    "rank": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "paper_id": {
                      "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_paper_id"
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 500,
                      "minLength": 1
                    },
                    "authors": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "maxItems": 50
                    },
                    "paper_date": {
                      "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_date_or_null"
                    },
                    "stance": {
                      "enum": [
                        "supporting",
                        "contradicting",
                        "mixed",
                        "neutral",
                        "unclassified"
                      ]
                    },
                    "stance_evidence_class": {
                      "enum": [
                        "platform_classification",
                        "model_interpretation"
                      ]
                    },
                    "relevance": {
                      "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                    },
                    "platform_scores": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "empirical_rigor",
                        "math_complexity",
                        "hub_score",
                        "evidence_class",
                        "note"
                      ],
                      "properties": {
                        "empirical_rigor": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0,
                          "maximum": 10
                        },
                        "math_complexity": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0,
                          "maximum": 10
                        },
                        "hub_score": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0,
                          "maximum": 10
                        },
                        "evidence_class": {
                          "const": "platform_classification"
                        },
                        "note": {
                          "type": "string",
                          "maxLength": 300
                        }
                      }
                    },
                    "source_ids": {
                      "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_ids_nonempty"
                    }
                  }
                },
                "maxItems": 15,
                "description": "Ranked by relevance (rank 1 first); ties broken by paper_id."
              },
              "relevant_books": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "status",
                  "items"
                ],
                "properties": {
                  "status": {
                    "enum": [
                      "included",
                      "not_requested",
                      "none_found",
                      "unavailable"
                    ]
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "rank",
                        "book_id",
                        "title",
                        "authors",
                        "year",
                        "relevance",
                        "source_ids"
                      ],
                      "properties": {
                        "rank": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "book_id": {
                          "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_node_id"
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 500,
                          "minLength": 1
                        },
                        "authors": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "maxLength": 200
                          },
                          "maxItems": 20
                        },
                        "year": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1000,
                          "maximum": 2200
                        },
                        "relevance": {
                          "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                        },
                        "source_ids": {
                          "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_ids_nonempty"
                        }
                      }
                    },
                    "maxItems": 10
                  }
                }
              },
              "methodological_comparison": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                },
                "maxItems": 30
              },
              "supporting_evidence": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                },
                "maxItems": 30
              },
              "contradictory_evidence": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "status",
                  "items"
                ],
                "properties": {
                  "status": {
                    "enum": [
                      "included",
                      "not_requested",
                      "none_found"
                    ]
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                    },
                    "maxItems": 30
                  }
                }
              },
              "research_limitations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                },
                "maxItems": 30
              },
              "open_questions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                },
                "maxItems": 30
              },
              "implementation_considerations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim"
                },
                "maxItems": 30
              },
              "source_references": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "source_id",
                    "citation",
                    "url"
                  ],
                  "properties": {
                    "source_id": {
                      "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_id"
                    },
                    "citation": {
                      "type": "string",
                      "maxLength": 600,
                      "minLength": 1
                    },
                    "url": {
                      "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_url_or_null"
                    }
                  }
                },
                "minItems": 1,
                "maxItems": 200
              }
            }
          },
          "markdown": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120000,
            "description": "Rendered review when output_format is markdown; null otherwise."
          },
          "limitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_limitation"
            },
            "minItems": 1,
            "maxItems": 100
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source"
            },
            "minItems": 1,
            "maxItems": 200
          },
          "truncation": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_truncation"
          },
          "provenance": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_provenance"
          }
        }
      },
      "GenerateLiteratureReviewPaidResponse": {
        "type": "object",
        "description": "Envelope of a delivered paid response: the analysis document, the platform payment receipt and the request identifiers.",
        "required": [
          "result",
          "payment",
          "meta"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse"
          },
          "payment": {
            "$ref": "#/components/schemas/PremiumPaymentReceipt"
          },
          "meta": {
            "type": "object",
            "description": "Identifiers of this paid request.",
            "required": [
              "transactionId",
              "requestId",
              "pricingVersion",
              "productVersion"
            ],
            "properties": {
              "transactionId": {
                "type": "string"
              },
              "requestId": {
                "type": "string",
                "pattern": "^req_[0-9a-f]{40}$"
              },
              "pricingVersion": {
                "type": "string",
                "pattern": "^p-[0-9a-f]{8}$"
              },
              "productVersion": {
                "type": "string"
              }
            }
          }
        }
      },
      "GenerateLiteratureReviewResponse_paper_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]{0,60}$",
        "description": "Canonical paper id (arXiv id, ssrn-<n>); no version suffix."
      },
      "GenerateLiteratureReviewResponse_source_id": {
        "type": "string",
        "pattern": "^src_[A-Za-z0-9_.:-]{1,80}$",
        "description": "Id of an entry of the document's sources[] array."
      },
      "GenerateLiteratureReviewResponse_claim_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{3,64}$",
        "description": "Stable claim id (deterministic from content)."
      },
      "GenerateLiteratureReviewResponse_evidence_class": {
        "enum": [
          "author_reported",
          "platform_classification",
          "model_interpretation",
          "independently_verified"
        ],
        "description": "author_reported: figure stated by the paper's authors; platform_classification: rule- or LLM-assisted label assigned by the platform; model_interpretation: language-model interpretation of retrieved text; independently_verified: reproduced by a third party (never emitted: the platform does not reproduce results)."
      },
      "GenerateLiteratureReviewResponse_date_or_null": {
        "type": [
          "string",
          "null"
        ],
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "GenerateLiteratureReviewResponse_url_or_null": {
        "type": [
          "string",
          "null"
        ],
        "maxLength": 2048,
        "pattern": "^https://"
      },
      "GenerateLiteratureReviewResponse_source_ids": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_id"
        },
        "uniqueItems": true,
        "maxItems": 50
      },
      "GenerateLiteratureReviewResponse_source_ids_nonempty": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_id"
        },
        "uniqueItems": true,
        "minItems": 1,
        "maxItems": 50
      },
      "GenerateLiteratureReviewResponse_source": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "title",
          "url",
          "identifier"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_id"
          },
          "type": {
            "enum": [
              "paper",
              "book",
              "book_edition",
              "author",
              "topic",
              "method",
              "dataset",
              "methodology"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "url": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_url_or_null"
          },
          "identifier": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "description": "arXiv id, SSRN id, DOI, ISBN or node id when known."
          }
        }
      },
      "GenerateLiteratureReviewResponse_cell": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "value",
          "status",
          "evidence_class",
          "source_ids"
        ],
        "description": "One comparison cell. Unknown values are explicit (status 'unknown', value null, reason set); they are never guessed or omitted.",
        "properties": {
          "value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "maxItems": 50,
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 200
                    },
                    {
                      "type": "number"
                    }
                  ]
                }
              },
              {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 40
                },
                "maxProperties": 4
              },
              {
                "type": "null"
              }
            ],
            "description": "Scalar, list of scalars, or {start,end} object; null only when status is unknown or not_applicable."
          },
          "status": {
            "enum": [
              "reported",
              "classified",
              "unknown",
              "not_applicable"
            ]
          },
          "evidence_class": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_evidence_class"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_ids": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_ids"
          },
          "reason": {
            "type": "string",
            "maxLength": 500
          },
          "unit": {
            "type": "string",
            "maxLength": 40
          },
          "note": {
            "type": "string",
            "maxLength": 500
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "unknown"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": "null"
                },
                "evidence_class": {
                  "type": "null"
                },
                "reason": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "reason"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "not_applicable"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": "null"
                },
                "evidence_class": {
                  "const": "platform_classification"
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                },
                "reason": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "reason"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "reported"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "not": {
                    "type": "null"
                  }
                },
                "evidence_class": {
                  "enum": [
                    "author_reported",
                    "independently_verified"
                  ]
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "classified"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "not": {
                    "type": "null"
                  }
                },
                "evidence_class": {
                  "enum": [
                    "platform_classification",
                    "model_interpretation"
                  ]
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                }
              }
            }
          }
        ]
      },
      "GenerateLiteratureReviewResponse_claim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "claim_id",
          "text",
          "evidence_class",
          "source_ids"
        ],
        "properties": {
          "claim_id": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim_id"
          },
          "text": {
            "type": "string",
            "maxLength": 1500,
            "minLength": 1
          },
          "evidence_class": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_evidence_class"
          },
          "source_ids": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_ids_nonempty"
          },
          "paper_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_paper_id"
            },
            "uniqueItems": true,
            "maxItems": 20
          },
          "quotes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source_id",
                "text"
              ],
              "properties": {
                "source_id": {
                  "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_id"
                },
                "text": {
                  "type": "string",
                  "maxLength": 400,
                  "minLength": 1
                }
              }
            },
            "maxItems": 5,
            "description": "Verbatim excerpts of the cited source. Quotes that cannot be matched to the source text are dropped and counted in provenance.llm.dropped_unverifiable_quotes."
          }
        }
      },
      "GenerateLiteratureReviewResponse_limitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "limitation_id",
          "scope",
          "paper_id",
          "text",
          "evidence_class",
          "source_ids"
        ],
        "properties": {
          "limitation_id": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_claim_id"
          },
          "scope": {
            "enum": [
              "platform",
              "paper",
              "comparison",
              "data",
              "graph",
              "retrieval",
              "model"
            ]
          },
          "paper_id": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_paper_id"
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 1500,
            "minLength": 1
          },
          "evidence_class": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_evidence_class"
          },
          "source_ids": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_source_ids_nonempty"
          }
        }
      },
      "GenerateLiteratureReviewResponse_truncation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "truncated",
          "reason",
          "returned",
          "omitted"
        ],
        "properties": {
          "truncated": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "returned": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Counts of records returned, by kind."
          },
          "omitted": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Counts of records left out because of limits, by kind."
          }
        }
      },
      "GenerateLiteratureReviewResponse_provenance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "product_version",
          "schema_version",
          "corpus_version",
          "data_updated",
          "graph_version",
          "pipeline",
          "llm",
          "evidence_policy"
        ],
        "properties": {
          "product": {
            "type": "string",
            "maxLength": 80
          },
          "product_version": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "schema_version": {
            "const": "1.0"
          },
          "corpus_version": {
            "type": "string",
            "maxLength": 120,
            "description": "Identifier of the corpus snapshot used: 'corpus-YYYY-MM-DD' (the day the corpus was last synced) or 'corpus-unknown'. Identical across all three products."
          },
          "data_updated": {
            "$ref": "#/components/schemas/GenerateLiteratureReviewResponse_date_or_null"
          },
          "graph_version": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          },
          "pipeline": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 120
            },
            "minItems": 1,
            "maxItems": 20,
            "description": "Ordered processing steps, e.g. d1_lookup, rule_based_comparison."
          },
          "llm": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "used",
              "model",
              "calls",
              "dropped_unverifiable_quotes"
            ],
            "properties": {
              "used": {
                "type": "boolean"
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 120
              },
              "calls": {
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              },
              "dropped_unverifiable_quotes": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "evidence_policy": {
            "type": "string",
            "maxLength": 600
          }
        }
      },
      "GenerateLiteratureReviewResponse_node_id": {
        "type": "string",
        "pattern": "^(?:(?:paper|topic|method):[A-Za-z0-9][A-Za-z0-9._/-]{0,80}|(?:bw|bp|be)_[A-Za-z0-9]{1,40})$"
      },
      "GenerateLiteratureReviewResponse_edge_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{3,64}$"
      },
      "ExploreKnowledgeGraphRequest": {
        "title": "explore_quant_knowledge_graph input",
        "description": "Traverse the quant knowledge graph around one entity.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_type",
          "entity_id"
        ],
        "properties": {
          "entity_type": {
            "enum": [
              "topic",
              "book",
              "author",
              "paper",
              "method"
            ]
          },
          "entity_id": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "description": "Slug or id: topic/method slug (\"market-microstructure\", \"topic:market-microstructure\"), paper id (\"2511.08571\", \"paper:2511.08571\"), book id (\"bw_...\", \"be_...\") or slug, author id (\"bp_...\") or slug."
          },
          "relationships": {
            "type": "array",
            "items": {
              "enum": [
                "books",
                "authors",
                "papers",
                "topics",
                "methodologies"
              ]
            },
            "minItems": 1,
            "maxItems": 5,
            "uniqueItems": true,
            "default": [
              "books",
              "authors",
              "papers",
              "topics",
              "methodologies"
            ],
            "description": "Kinds of neighbours to traverse: books (book and edition nodes), authors, papers, topics, methodologies (method nodes). All when omitted."
          },
          "max_depth": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3,
            "default": 2
          },
          "max_nodes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 50
          }
        }
      },
      "ExploreKnowledgeGraphResponse": {
        "title": "explore_quant_knowledge_graph output",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "product",
          "product_version",
          "request",
          "resolution",
          "root",
          "nodes",
          "edges",
          "paths",
          "limitations",
          "sources",
          "truncation",
          "provenance"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "product": {
            "const": "explore_quant_knowledge_graph"
          },
          "product_version": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "request": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "entity_type",
              "entity_id",
              "relationships",
              "max_depth",
              "max_nodes"
            ],
            "properties": {
              "entity_type": {
                "enum": [
                  "topic",
                  "book",
                  "author",
                  "paper",
                  "method"
                ]
              },
              "entity_id": {
                "type": "string",
                "maxLength": 100
              },
              "relationships": {
                "type": "array",
                "items": {
                  "enum": [
                    "books",
                    "authors",
                    "papers",
                    "topics",
                    "methodologies"
                  ]
                },
                "minItems": 1,
                "maxItems": 5,
                "uniqueItems": true
              },
              "max_depth": {
                "type": "integer",
                "minimum": 1,
                "maximum": 3
              },
              "max_nodes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              }
            }
          },
          "resolution": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "requested",
              "status",
              "resolved_id",
              "resolved_type",
              "label",
              "matched_by"
            ],
            "properties": {
              "requested": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "entity_type",
                  "entity_id"
                ],
                "properties": {
                  "entity_type": {
                    "enum": [
                      "topic",
                      "book",
                      "author",
                      "paper",
                      "method"
                    ]
                  },
                  "entity_id": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              },
              "status": {
                "const": "resolved"
              },
              "resolved_id": {
                "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_node_id"
              },
              "resolved_type": {
                "enum": [
                  "topic",
                  "book",
                  "edition",
                  "author",
                  "paper",
                  "method"
                ]
              },
              "label": {
                "type": "string",
                "maxLength": 500
              },
              "matched_by": {
                "enum": [
                  "node_id",
                  "slug",
                  "label",
                  "paper_table"
                ]
              }
            }
          },
          "root": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_node_id"
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "type",
                "label",
                "depth",
                "url",
                "attrs"
              ],
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_node_id"
                },
                "type": {
                  "enum": [
                    "topic",
                    "book",
                    "edition",
                    "author",
                    "paper",
                    "method"
                  ]
                },
                "label": {
                  "type": "string",
                  "maxLength": 500
                },
                "depth": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3
                },
                "url": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_url_or_null"
                },
                "attrs": {
                  "type": "object",
                  "maxProperties": 12,
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            },
            "minItems": 1,
            "maxItems": 100,
            "description": "Sorted by depth, then type, then id."
          },
          "edges": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "from",
                "to",
                "relationship",
                "directed",
                "verified",
                "weight",
                "provenance"
              ],
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_edge_id"
                },
                "from": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_node_id"
                },
                "to": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_node_id"
                },
                "relationship": {
                  "enum": [
                    "AUTHORED",
                    "HAS_EDITION",
                    "COVERS_TOPIC",
                    "COVERS_METHOD",
                    "USES_METHOD",
                    "RELATED_TO",
                    "SIMILAR_TO"
                  ]
                },
                "directed": {
                  "const": true
                },
                "verified": {
                  "type": "boolean",
                  "description": "True only for identifier-backed AUTHORED and HAS_EDITION edges; every other edge is a rule-based inference."
                },
                "weight": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 1
                },
                "provenance": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "dataset",
                    "evidence_type",
                    "confidence",
                    "algorithm_version",
                    "basis"
                  ],
                  "properties": {
                    "dataset": {
                      "enum": [
                        "books-graph",
                        "papers-d1"
                      ]
                    },
                    "evidence_type": {
                      "type": "string",
                      "pattern": "^[a-z0-9_+]{1,60}$"
                    },
                    "confidence": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 0,
                      "maximum": 1
                    },
                    "algorithm_version": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 40
                    },
                    "basis": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "maxItems": 10,
                      "description": "Pipeline-recorded evidence strings for the edge (untrusted text)."
                    }
                  }
                }
              },
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "verified": {
                        "const": true
                      }
                    },
                    "required": [
                      "verified"
                    ]
                  },
                  "then": {
                    "properties": {
                      "relationship": {
                        "enum": [
                          "AUTHORED",
                          "HAS_EDITION"
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "provenance": {
                        "type": "object",
                        "properties": {
                          "evidence_type": {
                            "const": "name_match"
                          }
                        },
                        "required": [
                          "evidence_type"
                        ]
                      }
                    },
                    "required": [
                      "provenance"
                    ]
                  },
                  "then": {
                    "properties": {
                      "verified": {
                        "const": false
                      }
                    }
                  }
                }
              ]
            },
            "maxItems": 2000,
            "description": "Sorted by relationship, from, to, id. Both endpoints are always members of nodes[] (no dangling references)."
          },
          "paths": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "path_id",
                "to",
                "node_ids",
                "edge_ids",
                "length",
                "all_edges_verified"
              ],
              "properties": {
                "path_id": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_edge_id"
                },
                "to": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_node_id"
                },
                "node_ids": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_node_id"
                  },
                  "minItems": 2,
                  "maxItems": 4
                },
                "edge_ids": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_edge_id"
                  },
                  "minItems": 1,
                  "maxItems": 3
                },
                "length": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3
                },
                "all_edges_verified": {
                  "type": "boolean"
                }
              }
            },
            "maxItems": 100,
            "description": "One shortest path from the root to every other returned node; ties broken by edge id."
          },
          "limitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_limitation"
            },
            "minItems": 1,
            "maxItems": 100
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_source"
            },
            "minItems": 1,
            "maxItems": 200
          },
          "truncation": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_truncation"
          },
          "provenance": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_provenance"
          }
        }
      },
      "ExploreKnowledgeGraphPaidResponse": {
        "type": "object",
        "description": "Envelope of a delivered paid response: the analysis document, the platform payment receipt and the request identifiers.",
        "required": [
          "result",
          "payment",
          "meta"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse"
          },
          "payment": {
            "$ref": "#/components/schemas/PremiumPaymentReceipt"
          },
          "meta": {
            "type": "object",
            "description": "Identifiers of this paid request.",
            "required": [
              "transactionId",
              "requestId",
              "pricingVersion",
              "productVersion"
            ],
            "properties": {
              "transactionId": {
                "type": "string"
              },
              "requestId": {
                "type": "string",
                "pattern": "^req_[0-9a-f]{40}$"
              },
              "pricingVersion": {
                "type": "string",
                "pattern": "^p-[0-9a-f]{8}$"
              },
              "productVersion": {
                "type": "string"
              }
            }
          }
        }
      },
      "ExploreKnowledgeGraphResponse_paper_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]{0,60}$",
        "description": "Canonical paper id (arXiv id, ssrn-<n>); no version suffix."
      },
      "ExploreKnowledgeGraphResponse_source_id": {
        "type": "string",
        "pattern": "^src_[A-Za-z0-9_.:-]{1,80}$",
        "description": "Id of an entry of the document's sources[] array."
      },
      "ExploreKnowledgeGraphResponse_claim_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{3,64}$",
        "description": "Stable claim id (deterministic from content)."
      },
      "ExploreKnowledgeGraphResponse_evidence_class": {
        "enum": [
          "author_reported",
          "platform_classification",
          "model_interpretation",
          "independently_verified"
        ],
        "description": "author_reported: figure stated by the paper's authors; platform_classification: rule- or LLM-assisted label assigned by the platform; model_interpretation: language-model interpretation of retrieved text; independently_verified: reproduced by a third party (never emitted: the platform does not reproduce results)."
      },
      "ExploreKnowledgeGraphResponse_date_or_null": {
        "type": [
          "string",
          "null"
        ],
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "ExploreKnowledgeGraphResponse_url_or_null": {
        "type": [
          "string",
          "null"
        ],
        "maxLength": 2048,
        "pattern": "^https://"
      },
      "ExploreKnowledgeGraphResponse_source_ids": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_source_id"
        },
        "uniqueItems": true,
        "maxItems": 50
      },
      "ExploreKnowledgeGraphResponse_source_ids_nonempty": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_source_id"
        },
        "uniqueItems": true,
        "minItems": 1,
        "maxItems": 50
      },
      "ExploreKnowledgeGraphResponse_source": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "title",
          "url",
          "identifier"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_source_id"
          },
          "type": {
            "enum": [
              "paper",
              "book",
              "book_edition",
              "author",
              "topic",
              "method",
              "dataset",
              "methodology"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "url": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_url_or_null"
          },
          "identifier": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "description": "arXiv id, SSRN id, DOI, ISBN or node id when known."
          }
        }
      },
      "ExploreKnowledgeGraphResponse_cell": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "value",
          "status",
          "evidence_class",
          "source_ids"
        ],
        "description": "One comparison cell. Unknown values are explicit (status 'unknown', value null, reason set); they are never guessed or omitted.",
        "properties": {
          "value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "maxItems": 50,
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 200
                    },
                    {
                      "type": "number"
                    }
                  ]
                }
              },
              {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 40
                },
                "maxProperties": 4
              },
              {
                "type": "null"
              }
            ],
            "description": "Scalar, list of scalars, or {start,end} object; null only when status is unknown or not_applicable."
          },
          "status": {
            "enum": [
              "reported",
              "classified",
              "unknown",
              "not_applicable"
            ]
          },
          "evidence_class": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_evidence_class"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_ids": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_source_ids"
          },
          "reason": {
            "type": "string",
            "maxLength": 500
          },
          "unit": {
            "type": "string",
            "maxLength": 40
          },
          "note": {
            "type": "string",
            "maxLength": 500
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "unknown"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": "null"
                },
                "evidence_class": {
                  "type": "null"
                },
                "reason": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "reason"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "not_applicable"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": "null"
                },
                "evidence_class": {
                  "const": "platform_classification"
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                },
                "reason": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "reason"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "reported"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "not": {
                    "type": "null"
                  }
                },
                "evidence_class": {
                  "enum": [
                    "author_reported",
                    "independently_verified"
                  ]
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "classified"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "not": {
                    "type": "null"
                  }
                },
                "evidence_class": {
                  "enum": [
                    "platform_classification",
                    "model_interpretation"
                  ]
                },
                "source_ids": {
                  "type": "array",
                  "minItems": 1
                }
              }
            }
          }
        ]
      },
      "ExploreKnowledgeGraphResponse_claim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "claim_id",
          "text",
          "evidence_class",
          "source_ids"
        ],
        "properties": {
          "claim_id": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_claim_id"
          },
          "text": {
            "type": "string",
            "maxLength": 1500,
            "minLength": 1
          },
          "evidence_class": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_evidence_class"
          },
          "source_ids": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_source_ids_nonempty"
          },
          "paper_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_paper_id"
            },
            "uniqueItems": true,
            "maxItems": 20
          },
          "quotes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source_id",
                "text"
              ],
              "properties": {
                "source_id": {
                  "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_source_id"
                },
                "text": {
                  "type": "string",
                  "maxLength": 400,
                  "minLength": 1
                }
              }
            },
            "maxItems": 5,
            "description": "Verbatim excerpts of the cited source. Quotes that cannot be matched to the source text are dropped and counted in provenance.llm.dropped_unverifiable_quotes."
          }
        }
      },
      "ExploreKnowledgeGraphResponse_limitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "limitation_id",
          "scope",
          "paper_id",
          "text",
          "evidence_class",
          "source_ids"
        ],
        "properties": {
          "limitation_id": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_claim_id"
          },
          "scope": {
            "enum": [
              "platform",
              "paper",
              "comparison",
              "data",
              "graph",
              "retrieval",
              "model"
            ]
          },
          "paper_id": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_paper_id"
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 1500,
            "minLength": 1
          },
          "evidence_class": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_evidence_class"
          },
          "source_ids": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_source_ids_nonempty"
          }
        }
      },
      "ExploreKnowledgeGraphResponse_truncation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "truncated",
          "reason",
          "returned",
          "omitted"
        ],
        "properties": {
          "truncated": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "returned": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Counts of records returned, by kind."
          },
          "omitted": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Counts of records left out because of limits, by kind."
          }
        }
      },
      "ExploreKnowledgeGraphResponse_provenance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "product_version",
          "schema_version",
          "corpus_version",
          "data_updated",
          "graph_version",
          "pipeline",
          "llm",
          "evidence_policy"
        ],
        "properties": {
          "product": {
            "type": "string",
            "maxLength": 80
          },
          "product_version": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
          },
          "schema_version": {
            "const": "1.0"
          },
          "corpus_version": {
            "type": "string",
            "maxLength": 120,
            "description": "Identifier of the corpus snapshot used: 'corpus-YYYY-MM-DD' (the day the corpus was last synced) or 'corpus-unknown'. Identical across all three products."
          },
          "data_updated": {
            "$ref": "#/components/schemas/ExploreKnowledgeGraphResponse_date_or_null"
          },
          "graph_version": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          },
          "pipeline": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 120
            },
            "minItems": 1,
            "maxItems": 20,
            "description": "Ordered processing steps, e.g. d1_lookup, rule_based_comparison."
          },
          "llm": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "used",
              "model",
              "calls",
              "dropped_unverifiable_quotes"
            ],
            "properties": {
              "used": {
                "type": "boolean"
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 120
              },
              "calls": {
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              },
              "dropped_unverifiable_quotes": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "evidence_policy": {
            "type": "string",
            "maxLength": 600
          }
        }
      },
      "ExploreKnowledgeGraphResponse_node_id": {
        "type": "string",
        "pattern": "^(?:(?:paper|topic|method):[A-Za-z0-9][A-Za-z0-9._/-]{0,80}|(?:bw|bp|be)_[A-Za-z0-9]{1,40})$"
      },
      "ExploreKnowledgeGraphResponse_edge_id": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{3,64}$"
      },
      "RateLimitError": {
        "type": "object",
        "description": "Body of a 429 from the application limiter.",
        "properties": {
          "error": {
            "type": "string",
            "const": "rate_limit_exceeded"
          },
          "message": {
            "type": "string",
            "description": "Human-readable; do not parse."
          },
          "retry_after_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 86400,
            "description": "Same value as the Retry-After header. For the flood limiter a constant upper bound, not an exact reset time."
          },
          "request_id": {
            "type": "string",
            "description": "Same value as the X-Request-Id header."
          }
        },
        "required": [
          "error",
          "message",
          "retry_after_seconds"
        ],
        "examples": [
          {
            "error": "rate_limit_exceeded",
            "message": "This client has used its request budget for now. Retry after the number of seconds in Retry-After.",
            "retry_after_seconds": 30,
            "request_id": "5f0c2a1e-8d3b-4c7a-9e1f-0a6b2d4c8e90"
          }
        ]
      },
      "ServiceError": {
        "type": "object",
        "description": "Body of a 503. The texts are fixed strings: internal detail is only in the server log, found through request_id.",
        "properties": {
          "error": {
            "type": "string",
            "description": "rate_limit_unavailable: the budget of a strict route could not be checked (nothing was counted). endpoint_temporarily_disabled: an operator switched the route off. Other fixed strings may follow for database failures."
          },
          "message": {
            "type": "string",
            "description": "Human-readable; do not parse."
          },
          "retry_after_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 86400,
            "description": "Same value as the Retry-After header."
          },
          "code": {
            "type": "string",
            "description": "Machine-readable reason when there is one, for example schema_probe_failed (the database could not be inspected; retried on the next request)."
          },
          "request_id": {
            "type": "string",
            "description": "Same value as the X-Request-Id header."
          }
        },
        "required": [
          "error"
        ],
        "examples": [
          {
            "error": "endpoint_temporarily_disabled",
            "message": "This endpoint is temporarily disabled. Retry after the number of seconds in Retry-After.",
            "retry_after_seconds": 120,
            "request_id": "5f0c2a1e-8d3b-4c7a-9e1f-0a6b2d4c8e90"
          }
        ]
      },
      "FacetBucket": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "A facet value. Special values: unknown (the flag was never assessed, NULL; for quadrant and the four execution flags), unclassified (the paper has no label of that kind; for topic, method, asset and dataset), true or false (has_code, rigor_capped)."
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "description": "Papers with this value among the papers matching every filter except this facet's own (disjunctive count). Buckets with a zero count are left out."
          }
        },
        "required": [
          "value",
          "count"
        ]
      },
      "FacetsResponse": {
        "type": "object",
        "description": "Counts per facet value for the papers that match the filters. Disjunctive: each facet is counted with every filter EXCEPT its own, so choosing a value never hides its siblings (the counts of a facet therefore need not sum to total, and a multi-label facet such as topic can sum to more than total). total is the count with every filter applied and equals total of GET /api/papers with the same filters.",
        "properties": {
          "snapshot": {
            "type": "string",
            "description": "Id of the discovery snapshot the counts were computed on (the D1 meta row written by the daily sync). The same id appears on GET /api/papers answers and in the static index manifest: equal snapshots mean the counts and the list describe the same corpus. Left out when the database has no snapshot row. Answers can be served from the edge cache for up to an hour, so a cached facets answer can carry an older snapshot than a fresh list; compare and refresh."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Papers matching all filters."
          },
          "facets": {
            "type": "object",
            "description": "Keys: quadrant, topic, method, asset, tcost_modeled, oos_method, data_resolution, evaluation_type, dataset, has_code, rigor_capped. Each is an array ordered by count (descending) then value, with the unknown or unclassified bucket last. The four execution flags and rigor_capped are present once the execution-flag migration is live, dataset once the dataset tables are live; a key that is absent is not available yet (see warnings).",
            "properties": {
              "quadrant": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "topic": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "method": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "asset": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "tcost_modeled": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "oos_method": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "data_resolution": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "evaluation_type": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "dataset": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "has_code": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              },
              "rigor_capped": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FacetBucket"
                }
              }
            },
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/FacetBucket"
              }
            }
          },
          "params": {
            "type": "object",
            "additionalProperties": true,
            "description": "The normalised filters that were applied (same shape as params of GET /api/papers, without sort, order, limit, offset and cursor)."
          },
          "truncated": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the facets cut at 200 values. Left out when none was."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "For example: a filter that is not live yet and was ignored, or the partial-match notice when no paper has every term of q."
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "total",
          "facets",
          "params"
        ]
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Optional client-chosen key (1 to 128 printable ASCII characters). It is part of the request identity: the same key with the same body is the same request, so a retry never charges twice.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[\\x21-\\x7E]{1,128}$"
        }
      },
      "PaymentSignature": {
        "name": "PAYMENT-SIGNATURE",
        "in": "header",
        "required": false,
        "description": "x402 v2 payment payload (base64 JSON) created from the PAYMENT-REQUIRED requirement. Omit it on the first call to receive the 402 challenge.",
        "schema": {
          "type": "string",
          "contentEncoding": "base64"
        }
      },
      "QuantReceipt": {
        "name": "X-Quant-Receipt",
        "in": "header",
        "required": false,
        "description": "Receipt token returned with a paid response. Sending it with the identical request returns the stored result (or re-runs a recoverable failure) without a second payment.",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{16,512}$"
        }
      }
    },
    "headers": {
      "PaymentRequired": {
        "description": "x402 v2 PaymentRequired object, JSON encoded then base64 encoded. See the PremiumPaymentRequired schema for the decoded structure.",
        "schema": {
          "type": "string",
          "contentEncoding": "base64",
          "contentMediaType": "application/json"
        }
      },
      "PaymentResponse": {
        "description": "x402 settlement response (success flag, network, transaction hash, payer), JSON encoded then base64 encoded.",
        "schema": {
          "type": "string",
          "contentEncoding": "base64",
          "contentMediaType": "application/json"
        }
      },
      "QuantReceipt": {
        "description": "Platform receipt token for this paid request; send it as X-Quant-Receipt to re-fetch the stored result without a second charge.",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{16,512}$"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  },
  "tags": [
    {
      "name": "premium",
      "description": "Paid (x402) research endpoints. See info.x-premium-status for the current publication state."
    }
  ]
}
