{
  "openapi": "3.1.0",
  "info": {
    "title": "Consensus API",
    "description": "Search usage is billed in calls: one call per 100 papers returned, rounded up, with a minimum of 1 call per request. Usage counts against your plan's included monthly calls. Free plans include 30 calls per month, Pro and Teams plans include 500, and Deep plans include 2,000. Paid plans with an active metered API subscription may continue past the included limit; additional calls are billed at $0.05 per call. Enterprise API keys have unlimited access.",
    "version": "1.0"
  },
  "paths": {
    "/v1/search": {
      "get": {
        "summary": "Search",
        "description": "The supported endpoint for searching academic papers. Use this instead of the legacy `/v1/quick_search` endpoint, which is deprecated and will be removed on 2027-02-07.",
        "operationId": "v1_search",
        "externalDocs": {
          "description": "Consensus API on GitHub",
          "url": "https://github.com/Consensus-NLP/consensus-api"
        },
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Query for research papers.",
              "title": "Query"
            },
            "description": "Query for research papers."
          },
          {
            "name": "year_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers before this year.",
              "title": "Year Min"
            },
            "description": "Exclude papers before this year."
          },
          {
            "name": "year_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers after this year.",
              "title": "Year Max"
            },
            "description": "Exclude papers after this year."
          },
          {
            "name": "month_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 12,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers before this month within year_min. Requires year_min.",
              "title": "Month Min"
            },
            "description": "Exclude papers before this month within year_min. Requires year_min."
          },
          {
            "name": "month_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 12,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers after this month within year_max. Requires year_max.",
              "title": "Month Max"
            },
            "description": "Exclude papers after this month within year_max. Requires year_max."
          },
          {
            "name": "study_types",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StudyTypeKeywordEnum"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include these study types.",
              "title": "Study Types"
            },
            "description": "Only include these study types."
          },
          {
            "name": "human",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include human studies.",
              "title": "Human"
            },
            "description": "Only include human studies."
          },
          {
            "name": "controlled",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include controlled studies.",
              "title": "Controlled"
            },
            "description": "Only include controlled studies."
          },
          {
            "name": "sample_size_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude studies with smaller sample sizes.",
              "title": "Sample Size Min"
            },
            "description": "Exclude studies with smaller sample sizes."
          },
          {
            "name": "sjr_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude journals in better quartiles, where 1 is the best quartile.",
              "title": "Sjr Min"
            },
            "description": "Exclude journals in better quartiles, where 1 is the best quartile."
          },
          {
            "name": "sjr_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude journals in lesser quartiles, where 1 is the best quartile.",
              "title": "Sjr Max"
            },
            "description": "Exclude journals in lesser quartiles, where 1 is the best quartile."
          },
          {
            "name": "citation_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers with fewer citations.",
              "title": "Citation Min"
            },
            "description": "Exclude papers with fewer citations."
          },
          {
            "name": "duration_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum study duration (in days).",
              "title": "Duration Min"
            },
            "description": "Minimum study duration (in days)."
          },
          {
            "name": "duration_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum study duration (in days).",
              "title": "Duration Max"
            },
            "description": "Maximum study duration (in days)."
          },
          {
            "name": "exclude_preprints",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude preprints, only include peer-reviewed papers.",
              "title": "Exclude Preprints"
            },
            "description": "Exclude preprints, only include peer-reviewed papers."
          },
          {
            "name": "open_access",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include open-access papers.",
              "title": "Open Access"
            },
            "description": "Only include open-access papers."
          },
          {
            "name": "publisher_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated publisher display names to filter by.",
              "title": "Publisher Name"
            },
            "description": "Comma-separated publisher display names to filter by."
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated academic field short codes, not email or web domains, to filter by. Valid values: med, bio, cs, chem, psych, phys, mat, eng, env, bus, econ, math, poli, agri, edu, soc, geol, geog, hist, art, philo, law, ling.",
              "title": "Domain"
            },
            "description": "Comma-separated academic field short codes, not email or web domains, to filter by. Valid values: med, bio, cs, chem, psych, phys, mat, eng, env, bus, econ, math, poli, agri, edu, soc, geol, geog, hist, art, philo, law, ling."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated ISO 3166-1 alpha-2 country codes (e.g. us, gb) to filter to those countries of study. Unknown codes are ignored; if none resolve, the filter is not applied.",
              "title": "Country"
            },
            "description": "Comma-separated ISO 3166-1 alpha-2 country codes (e.g. us, gb) to filter to those countries of study. Unknown codes are ignored; if none resolve, the filter is not applied."
          },
          {
            "name": "journal_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Preferred journal name (e.g. \"Nature\"). Results from matching journals are surfaced higher; this does not exclude other journals.",
              "title": "Journal Name"
            },
            "description": "Preferred journal name (e.g. \"Nature\"). Results from matching journals are surfaced higher; this does not exclude other journals."
          },
          {
            "name": "clinical_guideline",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to papers classified as clinical guidelines.",
              "title": "Clinical Guideline"
            },
            "description": "Filter to papers classified as clinical guidelines."
          },
          {
            "name": "medical_mode",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to top medical journals and guidelines, about 8M documents",
              "title": "Medical Mode"
            },
            "description": "Filter to top medical journals and guidelines, about 8M documents"
          },
          {
            "name": "include_semantic_score",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return the semantic score for each result when true. The score is only returned for the top 50 results.",
              "title": "Include Semantic Score"
            },
            "description": "Return the semantic score for each result when true. The score is only returned for the top 50 results."
          },
          {
            "name": "include_full_text_chunks",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return query-relevant excerpts from the full text of open-access papers, for the first 20 eligible papers on each page. **Default:** on for paid plans (Pro, Deep, Teams, Enterprise), off on Free. Set `false` to leave excerpts out. Setting `true` on Free returns `403`.",
              "title": "Include Full Text Chunks"
            },
            "description": "Return query-relevant excerpts from the full text of open-access papers, for the first 20 eligible papers on each page. **Default:** on for paid plans (Pro, Deep, Teams, Enterprise), off on Free. Set `false` to leave excerpts out. Setting `true` on Free returns `403`."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 49,
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Page number of results to return (0-indexed). A query returns at most 1,000 results in total: (page + 1) × page_size can't exceed 1,000.",
              "title": "Page"
            },
            "description": "Page number of results to return (0-indexed). A query returns at most 1,000 results in total: (page + 1) × page_size can't exceed 1,000."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Number of papers to return per page. Defaults to 20. The maximum depends on your plan; a larger value is capped to your plan's maximum (see the page_size returned in the response).",
              "title": "Page Size"
            },
            "description": "Number of papers to return per page. Defaults to 20. The maximum depends on your plan; a larger value is capped to your plan's maximum (see the page_size returned in the response)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quick_search": {
      "get": {
        "summary": "Quick search",
        "description": "This endpoint is deprecated. Use `GET /v1/search` instead. It will be removed on 2027-02-07.",
        "operationId": "v1_quick_search",
        "deprecated": true,
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Query for research papers.",
              "title": "Query"
            },
            "description": "Query for research papers."
          },
          {
            "name": "year_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers before this year.",
              "title": "Year Min"
            },
            "description": "Exclude papers before this year."
          },
          {
            "name": "year_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers after this year.",
              "title": "Year Max"
            },
            "description": "Exclude papers after this year."
          },
          {
            "name": "month_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 12,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers before this month within year_min. Requires year_min.",
              "title": "Month Min"
            },
            "description": "Exclude papers before this month within year_min. Requires year_min."
          },
          {
            "name": "month_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 12,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers after this month within year_max. Requires year_max.",
              "title": "Month Max"
            },
            "description": "Exclude papers after this month within year_max. Requires year_max."
          },
          {
            "name": "study_types",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StudyTypeKeywordEnum"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include these study types.",
              "title": "Study Types"
            },
            "description": "Only include these study types."
          },
          {
            "name": "human",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include human studies.",
              "title": "Human"
            },
            "description": "Only include human studies."
          },
          {
            "name": "controlled",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include controlled studies.",
              "title": "Controlled"
            },
            "description": "Only include controlled studies."
          },
          {
            "name": "sample_size_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude studies with smaller sample sizes.",
              "title": "Sample Size Min"
            },
            "description": "Exclude studies with smaller sample sizes."
          },
          {
            "name": "sjr_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude journals in better quartiles, where 1 is the best quartile.",
              "title": "Sjr Min"
            },
            "description": "Exclude journals in better quartiles, where 1 is the best quartile."
          },
          {
            "name": "sjr_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude journals in lesser quartiles, where 1 is the best quartile.",
              "title": "Sjr Max"
            },
            "description": "Exclude journals in lesser quartiles, where 1 is the best quartile."
          },
          {
            "name": "citation_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude papers with fewer citations.",
              "title": "Citation Min"
            },
            "description": "Exclude papers with fewer citations."
          },
          {
            "name": "duration_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum study duration (in days).",
              "title": "Duration Min"
            },
            "description": "Minimum study duration (in days)."
          },
          {
            "name": "duration_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum study duration (in days).",
              "title": "Duration Max"
            },
            "description": "Maximum study duration (in days)."
          },
          {
            "name": "exclude_preprints",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude preprints, only include peer-reviewed papers.",
              "title": "Exclude Preprints"
            },
            "description": "Exclude preprints, only include peer-reviewed papers."
          },
          {
            "name": "open_access",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include open-access papers.",
              "title": "Open Access"
            },
            "description": "Only include open-access papers."
          },
          {
            "name": "publisher_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated publisher display names to filter by.",
              "title": "Publisher Name"
            },
            "description": "Comma-separated publisher display names to filter by."
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated academic field short codes, not email or web domains, to filter by. Valid values: med, bio, cs, chem, psych, phys, mat, eng, env, bus, econ, math, poli, agri, edu, soc, geol, geog, hist, art, philo, law, ling.",
              "title": "Domain"
            },
            "description": "Comma-separated academic field short codes, not email or web domains, to filter by. Valid values: med, bio, cs, chem, psych, phys, mat, eng, env, bus, econ, math, poli, agri, edu, soc, geol, geog, hist, art, philo, law, ling."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated ISO 3166-1 alpha-2 country codes (e.g. us, gb) to filter to those countries of study. Unknown codes are ignored; if none resolve, the filter is not applied.",
              "title": "Country"
            },
            "description": "Comma-separated ISO 3166-1 alpha-2 country codes (e.g. us, gb) to filter to those countries of study. Unknown codes are ignored; if none resolve, the filter is not applied."
          },
          {
            "name": "journal_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Preferred journal name (e.g. \"Nature\"). Results from matching journals are surfaced higher; this does not exclude other journals.",
              "title": "Journal Name"
            },
            "description": "Preferred journal name (e.g. \"Nature\"). Results from matching journals are surfaced higher; this does not exclude other journals."
          },
          {
            "name": "clinical_guideline",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to papers classified as clinical guidelines.",
              "title": "Clinical Guideline"
            },
            "description": "Filter to papers classified as clinical guidelines."
          },
          {
            "name": "medical_mode",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to top medical journals and guidelines, about 8M documents",
              "title": "Medical Mode"
            },
            "description": "Filter to top medical journals and guidelines, about 8M documents"
          },
          {
            "name": "include_semantic_score",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return the semantic score for each result when true. The score is only returned for the top 50 results.",
              "title": "Include Semantic Score"
            },
            "description": "Return the semantic score for each result when true. The score is only returned for the top 50 results."
          },
          {
            "name": "include_full_text_chunks",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return query-relevant excerpts from the full text of open-access papers, for the first 20 eligible papers on each page. **Default:** on for paid plans (Pro, Deep, Teams, Enterprise), off on Free. Set `false` to leave excerpts out. Setting `true` on Free returns `403`.",
              "title": "Include Full Text Chunks"
            },
            "description": "Return query-relevant excerpts from the full text of open-access papers, for the first 20 eligible papers on each page. **Default:** on for paid plans (Pro, Deep, Teams, Enterprise), off on Free. Set `false` to leave excerpts out. Setting `true` on Free returns `403`."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 49,
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Page number of results to return (0-indexed). A query returns at most 1,000 results in total: (page + 1) × page_size can't exceed 1,000.",
              "title": "Page"
            },
            "description": "Page number of results to return (0-indexed). A query returns at most 1,000 results in total: (page + 1) × page_size can't exceed 1,000."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Number of papers to return per page. Defaults to 20. The maximum depends on your plan; a larger value is capped to your plan's maximum (see the page_size returned in the response).",
              "title": "Page Size"
            },
            "description": "Number of papers to return per page. Defaults to 20. The maximum depends on your plan; a larger value is capped to your plan's maximum (see the page_size returned in the response)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-sunset": "2027-02-07T00:00:00Z"
      }
    },
    "/v1/threads": {
      "post": {
        "summary": "Start a Thread",
        "description": "Delegate a research task to the Consensus research agent and get a `thread_id` back immediately. Rate limit: 1 request/second. The run is asynchronous: poll `GET /v1/threads/{thread_id}` until status is `idle`. A 5xx means the request may or may not have taken effect: there is no idempotency key yet, so a blind retry can create a second Thread. Set `skill` (with `mode` `deep`) to run a named research workflow such as a literature review.",
        "operationId": "v1_create_thread",
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThreadCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadDispatchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "List historical Threads",
        "description": "The caller's prior Threads, newest first, optionally filtered by a case-insensitive title substring. Rate limit: 1 request/second. On this list, status may be absent for Threads inactive past the status window and title is substituted when the Thread has none; GET the Thread for authoritative status and title.",
        "operationId": "v1_list_threads",
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Title substring to match (case-insensitive).",
              "title": "Query"
            },
            "description": "Title substring to match (case-insensitive)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Max Threads to return.",
              "default": 20,
              "title": "Limit"
            },
            "description": "Max Threads to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Pagination offset.",
              "default": 0,
              "title": "Offset"
            },
            "description": "Pagination offset."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/threads/{thread_id}": {
      "get": {
        "summary": "Poll a Thread",
        "description": "The polling half of create-then-poll. While status is `running`, wait `poll_after_seconds` from the dispatch response between polls (5 for pro, 20 for deep); faster polling is rate-limited (hard cap 3/s per account, shared across all of its Threads). Readable for any Thread the key can access, including ones shared with the caller, not only Threads it created. Only the target interaction (`interaction_id`, or the latest) carries response/citations; earlier turns are metadata unless requested explicitly.",
        "operationId": "v1_get_thread",
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]+$",
              "description": "Opaque Thread id.",
              "title": "Thread Id"
            },
            "description": "Opaque Thread id."
          },
          {
            "name": "include_trace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Opt in to `agent_trace` per interaction: a plain-English list of the steps the agent took (the searches it ran, the papers it read). Off by default to keep polls light. It is written for display, so don't parse it; the wording can change.",
              "default": false,
              "title": "Include Trace"
            },
            "description": "Opt in to `agent_trace` per interaction: a plain-English list of the steps the agent took (the searches it ran, the papers it read). Off by default to keep polls light. It is written for display, so don't parse it; the wording can change."
          },
          {
            "name": "interaction_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Hydrate this interaction instead of the latest.",
              "title": "Interaction Id"
            },
            "description": "Hydrate this interaction instead of the latest."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/threads/{thread_id}/interactions": {
      "post": {
        "summary": "Add a follow-up",
        "description": "Continue the research conversation with full context of the earlier turns. Rate limit: 1 request/second. Refused with 409 while the Thread's latest interaction is still running, so wait until status is `idle` or `failed` first. Returns a new `interaction_id` immediately; poll `GET /v1/threads/{thread_id}` until status is `idle`. A 5xx means the request may or may not have taken effect (no idempotency key yet). Set `skill` (with `mode` `deep`) to run a named research workflow for this follow-up.",
        "operationId": "v1_add_thread_interaction",
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]+$",
              "description": "Opaque Thread id.",
              "title": "Thread Id"
            },
            "description": "Opaque Thread id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThreadFollowUpRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadDispatchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/papers/full_text": {
      "get": {
        "summary": "Get full text",
        "description": "Read the full text of up to 20 open-access papers in one request. Each paper comes back as Markdown, split into sections.\n\n**Which papers:** pass `paper_ids` (the `paper_id` on search or Thread results), `dois`, or both. 1 to 20 in total.\n\n**Each paper's `status`:**\n- `available`: the full text is in the response.\n- `blocked`: Consensus can't return this paper's text. It isn't open access, it was retracted, or the copy Consensus holds isn't the open-access version.\n- `no_full_text`: Consensus has no text for this paper.\n- `not_found`: no paper matches that id or DOI.\n\n**Cost:** 1 credit per `available` paper. Every other status is not charged. Reading a paper again within 24 hours of being charged for it is also free; `free_reread_until` tells you until when.\n\n**Access:** paid plans only. A `403` means full text isn't available to your key.\n\n**Rate limit:** 1 request per second.",
        "operationId": "v1_get_papers_full_text",
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "paper_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Paper ids from search or Thread results (each result's `paper_id`). Repeat the parameter for several: `?paper_ids=A&paper_ids=B`.",
              "title": "Paper Ids"
            },
            "description": "Paper ids from search or Thread results (each result's `paper_id`). Repeat the parameter for several: `?paper_ids=A&paper_ids=B`."
          },
          {
            "name": "dois",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "DOIs, with or without a `https://doi.org/` or `doi:` prefix. Repeat the parameter for several.",
              "title": "Dois"
            },
            "description": "DOIs, with or without a `https://doi.org/` or `doi:` prefix. Repeat the parameter for several."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperFullTextResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1beta/papers/citations": {
      "get": {
        "tags": [
          "Citations (beta)"
        ],
        "summary": "Get citations",
        "description": "Find the papers that cite a set of seed papers, up to 20 seeds in one request. Each paper comes back in the same shape as a search result.\n\n**Which seeds:** pass `paper_ids` (the `paper_id` on search, Thread, citations or references results), `dois`, or both. 1 to 20 in total. DOIs that match no Consensus paper come back in `unmatched_dois`.\n\n**Several seeds:** each paper carries `seeds_touched`, how many of the seeds it cites. With the default `sort`, papers that cite more of the seeds rank first.\n\n**Filters and order:** `year_min`, `year_max` and `cite_min` narrow the results. `sort` is `recency_weighted` (the default), `most_cited` or `most_recent`.\n\n**Paging:** `page` starts at 0 and `page_size` defaults to 20, up to your plan's maximum. Request `next_page` until `is_end` is true. Paging reaches the first 10,000 papers.\n\n**Cost:** 1 credit per 100 papers returned, rounded up, with a minimum of 1 per request. `credits_charged` shows what the request used.\n\n**Access:** paid plans only. A `403` means citations aren't available to your key.\n\n**Rate limit:** 1 request per second.",
        "operationId": "v1beta_get_papers_citations",
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "paper_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Seed paper ids from search, Threads, citations or references results (each result's paper_id). Repeat the parameter for several: ?paper_ids=A&paper_ids=B.",
              "title": "Paper Ids"
            },
            "description": "Seed paper ids from search, Threads, citations or references results (each result's paper_id). Repeat the parameter for several: ?paper_ids=A&paper_ids=B."
          },
          {
            "name": "dois",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Seed DOIs, with or without a https://doi.org/ or doi: prefix. Repeat the parameter for several. A DOI that names no Consensus paper comes back in unmatched_dois.",
              "title": "Dois"
            },
            "description": "Seed DOIs, with or without a https://doi.org/ or doi: prefix. Repeat the parameter for several. A DOI that names no Consensus paper comes back in unmatched_dois."
          },
          {
            "name": "year_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only papers published in or after this year.",
              "title": "Year Min"
            },
            "description": "Only papers published in or after this year."
          },
          {
            "name": "year_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only papers published in or before this year.",
              "title": "Year Max"
            },
            "description": "Only papers published in or before this year."
          },
          {
            "name": "cite_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only papers cited at least this many times.",
              "title": "Cite Min"
            },
            "description": "Only papers cited at least this many times."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/CitationSort",
              "description": "recency_weighted: papers linked to more of the seeds first, then by how fast they are cited, so new papers are not buried. most_cited: highest citation count first. most_recent: newest first, most cited first within a year.",
              "default": "recency_weighted"
            },
            "description": "recency_weighted: papers linked to more of the seeds first, then by how fast they are cited, so new papers are not buried. most_cited: highest citation count first. most_recent: newest first, most cited first within a year."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Zero-indexed page to read.",
              "default": 0,
              "title": "Page"
            },
            "description": "Zero-indexed page to read."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Papers per page; 20 when omitted, and at most your plan's page size cap.",
              "title": "Page Size"
            },
            "description": "Papers per page; 20 when omitted, and at most your plan's page size cap."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CitationsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-stability": "beta",
        "x-mint": {
          "metadata": {
            "tag": "Beta"
          },
          "content": "<Warning>\n  This endpoint is in beta, so its request and response schemas may change in the coming days.\n</Warning>"
        }
      }
    },
    "/v1beta/papers/references": {
      "get": {
        "tags": [
          "Citations (beta)"
        ],
        "summary": "Get references",
        "description": "Find the papers that a set of seed papers cites, up to 20 seeds in one request. Each paper comes back in the same shape as a search result.\n\n**Which seeds:** pass `paper_ids` (the `paper_id` on search, Thread, citations or references results), `dois`, or both. 1 to 20 in total. DOIs that match no Consensus paper come back in `unmatched_dois`.\n\n**Several seeds:** each paper carries `seeds_touched`, how many of the seeds cite it. With the default `sort`, papers cited by more of the seeds rank first.\n\n**Filters and order:** `year_min`, `year_max` and `cite_min` narrow the results. `sort` is `recency_weighted` (the default), `most_cited` or `most_recent`.\n\n**Paging:** `page` starts at 0 and `page_size` defaults to 20, up to your plan's maximum. Request `next_page` until `is_end` is true. Paging reaches the first 10,000 papers.\n\n**Cost:** 1 credit per 100 papers returned, rounded up, with a minimum of 1 per request. `credits_charged` shows what the request used.\n\n**Access:** paid plans only. A `403` means citations aren't available to your key.\n\n**Rate limit:** 1 request per second.",
        "operationId": "v1beta_get_papers_references",
        "security": [
          {
            "XApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "paper_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Seed paper ids from search, Threads, citations or references results (each result's paper_id). Repeat the parameter for several: ?paper_ids=A&paper_ids=B.",
              "title": "Paper Ids"
            },
            "description": "Seed paper ids from search, Threads, citations or references results (each result's paper_id). Repeat the parameter for several: ?paper_ids=A&paper_ids=B."
          },
          {
            "name": "dois",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Seed DOIs, with or without a https://doi.org/ or doi: prefix. Repeat the parameter for several. A DOI that names no Consensus paper comes back in unmatched_dois.",
              "title": "Dois"
            },
            "description": "Seed DOIs, with or without a https://doi.org/ or doi: prefix. Repeat the parameter for several. A DOI that names no Consensus paper comes back in unmatched_dois."
          },
          {
            "name": "year_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only papers published in or after this year.",
              "title": "Year Min"
            },
            "description": "Only papers published in or after this year."
          },
          {
            "name": "year_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only papers published in or before this year.",
              "title": "Year Max"
            },
            "description": "Only papers published in or before this year."
          },
          {
            "name": "cite_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only papers cited at least this many times.",
              "title": "Cite Min"
            },
            "description": "Only papers cited at least this many times."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/CitationSort",
              "description": "recency_weighted: papers linked to more of the seeds first, then by how fast they are cited, so new papers are not buried. most_cited: highest citation count first. most_recent: newest first, most cited first within a year.",
              "default": "recency_weighted"
            },
            "description": "recency_weighted: papers linked to more of the seeds first, then by how fast they are cited, so new papers are not buried. most_cited: highest citation count first. most_recent: newest first, most cited first within a year."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Zero-indexed page to read.",
              "default": 0,
              "title": "Page"
            },
            "description": "Zero-indexed page to read."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Papers per page; 20 when omitted, and at most your plan's page size cap.",
              "title": "Page Size"
            },
            "description": "Papers per page; 20 when omitted, and at most your plan's page size cap."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CitationsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-stability": "beta",
        "x-mint": {
          "metadata": {
            "tag": "Beta"
          },
          "content": "<Warning>\n  This endpoint is in beta, so its request and response schemas may change in the coming days.\n</Warning>"
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CitationResult": {
        "properties": {
          "paper_id": {
            "type": "string",
            "title": "Paper Id",
            "description": "Consensus id of the paper. Pass it to GET /v1/papers/full_text to read the paper's complete text when full_text_available is true."
          },
          "full_text_available": {
            "type": "boolean",
            "title": "Full Text Available",
            "description": "True when the paper is open access, so GET /v1/papers/full_text can return its complete text."
          },
          "abstract": {
            "type": "string",
            "title": "Abstract",
            "description": "Abstract of the paper."
          },
          "authors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Authors",
            "description": "List of the paper's authors."
          },
          "doi": {
            "type": "string",
            "title": "Doi",
            "description": "Digital Object Identifier for the document."
          },
          "journal_name": {
            "type": "string",
            "title": "Journal Name",
            "description": "Publication journal of the paper."
          },
          "pages": {
            "type": "string",
            "title": "Pages",
            "description": "Page range of the paper."
          },
          "publish_year": {
            "type": "integer",
            "title": "Publish Year",
            "description": "Publication year of the paper."
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Title of the paper."
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Consensus URL for more paper details."
          },
          "volume": {
            "type": "string",
            "title": "Volume",
            "description": "Journal volume of the paper."
          },
          "semantic_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Semantic Score",
            "description": "Semantic relevance score for the paper. Only returned when include_semantic_score is true. The score is only returned for the top 50 results; it is omitted for all later results."
          },
          "citation_count": {
            "type": "integer",
            "title": "Citation Count",
            "description": "Number of citations for the paper."
          },
          "study_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Study Type",
            "description": "Study type of the paper."
          },
          "takeaway": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Takeaway",
            "description": "Key takeaway or summary from the paper abstract."
          },
          "publisher_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publisher Name",
            "description": "Publisher display name."
          },
          "full_text_chunks": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Text Chunks",
            "description": "Query-relevant excerpts from the paper's full text, for open-access papers; only the first 20 eligible papers on each page carry them. Returned by default on paid plans; omitted when include_full_text_chunks is false."
          },
          "sjr_best_quartile": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sjr Best Quartile",
            "description": "SCImago Journal Rank best quartile for the journal (1 = top, 4 = bottom)."
          },
          "sample_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample Size",
            "description": "Number of participants or subjects in the study, when known."
          },
          "study_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Study Count",
            "description": "Number of studies synthesized (e.g. for a meta-analysis), when known."
          },
          "population_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Population Type",
            "description": "Study population type: 'human', 'animal', or 'other'."
          },
          "is_preprint": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Preprint",
            "description": "True when the paper is a preprint (not yet peer-reviewed)."
          },
          "countries_of_study": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Countries Of Study",
            "description": "Countries where the study was conducted, when known."
          },
          "study_duration_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Study Duration Days",
            "description": "Study duration in days, when known."
          },
          "influential_citation_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Influential Citation Count",
            "description": "Number of influential citations (from Semantic Scholar)."
          },
          "institutions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Institutions",
            "description": "Author institutional affiliations, when known."
          },
          "publish_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publish Date",
            "description": "Full publication date (YYYY-MM-DD), when known."
          },
          "institutional_access_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Institutional Access Url",
            "description": "Link to the paper's full text through the caller's institution, via LibKey. Returned on paid plans when the caller has selected an institution in Consensus settings and LibKey has a link for the paper; an organization API key uses the institution of the person who created it. Only the first 50 results of a page carry it. Rolling out gradually, so not every eligible account receives it yet."
          },
          "seeds_touched": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seeds Touched",
            "description": "How many of the seeds this paper cites, or is cited by. Returned only when more than one seed was read."
          }
        },
        "type": "object",
        "required": [
          "paper_id",
          "full_text_available",
          "abstract",
          "authors",
          "doi",
          "journal_name",
          "pages",
          "publish_year",
          "title",
          "url",
          "volume",
          "citation_count"
        ],
        "title": "CitationResult"
      },
      "CitationSort": {
        "type": "string",
        "enum": [
          "recency_weighted",
          "most_cited",
          "most_recent"
        ],
        "title": "CitationSort",
        "description": "How a citation-edge read ranks a paper's citations or references.\n\nLike `CitationFilter`, this is both a tool and node input and the index-layer arg."
      },
      "CitationsResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/CitationResult"
            },
            "type": "array",
            "title": "Results",
            "description": "The page's papers, ranked by sort. Each paper_id can seed a next call."
          },
          "page": {
            "type": "integer",
            "title": "Page",
            "description": "The zero-indexed page returned."
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "description": "Papers per page actually applied to this response."
          },
          "is_end": {
            "type": "boolean",
            "title": "Is End",
            "description": "True when no later page holds more papers for these seeds and filters. A page can hold fewer than page_size papers and still not be the end."
          },
          "next_page": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Page",
            "description": "Next zero-indexed page to request, if one is available."
          },
          "unmatched_dois": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unmatched Dois",
            "description": "Requested DOIs, normalized, that name no Consensus paper."
          },
          "credits_charged": {
            "type": "integer",
            "title": "Credits Charged",
            "description": "Credits this request used: one per 100 papers returned, at least one."
          }
        },
        "type": "object",
        "required": [
          "results",
          "page",
          "page_size",
          "is_end",
          "credits_charged"
        ],
        "title": "CitationsResponse"
      },
      "FullTextSection": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "The section heading."
          },
          "offset": {
            "type": "integer",
            "title": "Offset",
            "description": "Character offset of the section's heading in `markdown`."
          }
        },
        "type": "object",
        "required": [
          "title",
          "offset"
        ],
        "title": "FullTextSection"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "PaperFullTextResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/PaperFullTextResult"
            },
            "type": "array",
            "title": "Results",
            "description": "One result per requested item: every `paper_ids` value in order, then every `dois` value in order. A repeated item gets a result each time."
          },
          "credits_charged": {
            "type": "integer",
            "title": "Credits Charged",
            "description": "The credits this request is priced at: one per available paper, counting a paper once however many items name it. A paper already charged to you in the last 24 hours costs nothing. The charge settles after the response, so the usage it counts can be lower: a request that crosses your included allowance is counted only up to it, and a charge that fails counts nothing."
          }
        },
        "type": "object",
        "required": [
          "results",
          "credits_charged"
        ],
        "title": "PaperFullTextResponse"
      },
      "PaperFullTextResult": {
        "properties": {
          "paper_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paper Id",
            "description": "The paper id as requested, or for a DOI the id of the paper that holds it. Omitted only for a DOI that names no Consensus paper."
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi",
            "description": "The DOI as requested, lowercased and without its URL or `doi:` prefix. DOI items only."
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "blocked",
              "not_found",
              "no_full_text"
            ],
            "title": "Status",
            "description": "`available`: the paper is open access and its complete text is returned. `blocked`: the paper's text is not returned because the paper is not open access, the copy Consensus holds is not its open-access copy, or it is retracted, so `open_access_status` can still be `gold` or `green`. `not_found`: no Consensus paper has this id or DOI. `no_full_text`: the paper is open access, but Consensus holds no text for it. Only `available` papers are charged."
          },
          "free_reread_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Free Reread Until",
            "description": "Until when requesting this paper again, by any of its ids or its DOI, is expected to cost nothing (ISO 8601, UTC). Once a paper has been charged to you, it is normally not charged again for 24 hours, so this is normally 24 hours after the request that was charged for it. Best effort: a reread before this time can still be charged, for example when that charge did not complete. Requests for the same paper sent before that charge completes are each charged. Available papers only; omitted when no free reread is expected."
          },
          "open_access_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open Access Status",
            "description": "The paper's open-access status: `diamond`, `gold`, `green`, `hybrid`, `bronze` or `closed`."
          },
          "markdown": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Markdown",
            "description": "The paper's complete text as Markdown. Available papers only."
          },
          "sections": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FullTextSection"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sections",
            "description": "The sections of `markdown`, in order."
          },
          "total_chars": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Chars",
            "description": "Length of `markdown` in characters."
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "PaperFullTextResult"
      },
      "QueryResult": {
        "properties": {
          "paper_id": {
            "type": "string",
            "title": "Paper Id",
            "description": "Consensus id of the paper. Pass it to `GET /v1/papers/full_text` to read the paper's complete text when `full_text_available` is true."
          },
          "full_text_available": {
            "type": "boolean",
            "title": "Full Text Available",
            "description": "True when the paper is open access, so `GET /v1/papers/full_text` can return its complete text."
          },
          "abstract": {
            "type": "string",
            "title": "Abstract",
            "description": "Abstract of the paper."
          },
          "authors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Authors",
            "description": "List of the paper's authors."
          },
          "doi": {
            "type": "string",
            "title": "Doi",
            "description": "Digital Object Identifier for the document."
          },
          "journal_name": {
            "type": "string",
            "title": "Journal Name",
            "description": "Publication journal of the paper."
          },
          "pages": {
            "type": "string",
            "title": "Pages",
            "description": "Page range of the paper."
          },
          "publish_year": {
            "type": "integer",
            "title": "Publish Year",
            "description": "Publication year of the paper."
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Title of the paper."
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Consensus URL for more paper details."
          },
          "volume": {
            "type": "string",
            "title": "Volume",
            "description": "Journal volume of the paper."
          },
          "semantic_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Semantic Score",
            "description": "Semantic relevance score for the paper. Only returned when include_semantic_score is true. The score is only returned for the top 50 results; it is omitted for all later results."
          },
          "citation_count": {
            "type": "integer",
            "title": "Citation Count",
            "description": "Number of citations for the paper."
          },
          "study_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Study Type",
            "description": "Study type of the paper."
          },
          "takeaway": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Takeaway",
            "description": "Key takeaway or summary from the paper abstract."
          },
          "publisher_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publisher Name",
            "description": "Publisher display name."
          },
          "full_text_chunks": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Text Chunks",
            "description": "Query-relevant excerpts from the paper's full text, for open-access papers on paid plans; only the first 20 eligible papers on each page carry them. Omitted when include_full_text_chunks is false."
          },
          "sjr_best_quartile": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sjr Best Quartile",
            "description": "SCImago Journal Rank best quartile for the journal (1 = top, 4 = bottom)."
          },
          "sample_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample Size",
            "description": "Number of participants or subjects in the study, when known."
          },
          "study_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Study Count",
            "description": "Number of studies synthesized (e.g. for a meta-analysis), when known."
          },
          "population_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Population Type",
            "description": "Study population type: 'human', 'animal', or 'other'."
          },
          "is_preprint": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Preprint",
            "description": "True when the paper is a preprint (not yet peer-reviewed)."
          },
          "countries_of_study": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Countries Of Study",
            "description": "Countries where the study was conducted, when known."
          },
          "study_duration_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Study Duration Days",
            "description": "Study duration in days, when known."
          },
          "influential_citation_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Influential Citation Count",
            "description": "Number of influential citations (from Semantic Scholar)."
          },
          "institutions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Institutions",
            "description": "Author institutional affiliations, when known."
          },
          "publish_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publish Date",
            "description": "Full publication date (YYYY-MM-DD), when known."
          },
          "institutional_access_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Institutional Access Url",
            "description": "Link to the paper's full text through the caller's institution, via LibKey. Returned on paid plans when the caller has selected an institution in Consensus settings and LibKey has a link for the paper; an organization API key uses the institution of the person who created it. Only the first 50 results of a page carry it."
          }
        },
        "type": "object",
        "required": [
          "paper_id",
          "full_text_available",
          "abstract",
          "authors",
          "doi",
          "journal_name",
          "pages",
          "publish_year",
          "title",
          "url",
          "volume",
          "citation_count"
        ],
        "title": "QueryResult"
      },
      "QuickSearchResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/QueryResult"
            },
            "type": "array",
            "title": "Results",
            "description": "List of query results."
          },
          "page": {
            "type": "integer",
            "title": "Page",
            "description": "Current zero-indexed result page."
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "description": "Number of results per page actually applied to this response.",
            "default": 20
          },
          "is_end": {
            "type": "boolean",
            "title": "Is End",
            "description": "True when no further page is indicated by the search backend."
          },
          "next_page": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Page",
            "description": "Next zero-indexed page to request, if one is available."
          }
        },
        "type": "object",
        "required": [
          "results",
          "page",
          "is_end"
        ],
        "title": "QuickSearchResponse"
      },
      "StudyTypeKeywordEnum": {
        "type": "string",
        "enum": [
          "bench experiment",
          "case report",
          "case study",
          "case-control study",
          "cohort study",
          "commentary or perspective",
          "cross-sectional study",
          "field study",
          "historical or archival analysis",
          "interview study",
          "literature review",
          "longitudinal / panel data study",
          "meta-analysis",
          "mixed methods study",
          "non-randomized experimental study",
          "non-rct in vitro",
          "other",
          "rct",
          "systematic review",
          "theoretical, modeling, or simulation study",
          "non-rct experimental",
          "non-rct observational study",
          "animal"
        ],
        "title": "StudyTypeKeywordEnum",
        "description": "All possible study types strings saved to search index documents."
      },
      "ThreadAttachments": {
        "properties": {
          "paper_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "maxItems": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Paper Ids",
            "description": "Paper ids to focus the research on."
          },
          "collection_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array",
                "maxItems": 10
              },
              {
                "type": "null"
              }
            ],
            "title": "Collection Ids",
            "description": "Library collection ids to focus on."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ThreadAttachments",
        "description": "Scope the research to specific papers/collections."
      },
      "ThreadCitation": {
        "properties": {
          "n": {
            "type": "integer",
            "title": "N",
            "description": "Paper number. `response` cites the paper's quotes as `[n.1]`, `[n.2]`, ... (see `snippets[].marker`), and cites it as a bare `[n]` where there is no quote."
          },
          "paper_id": {
            "type": "string",
            "title": "Paper Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "authors": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authors"
          },
          "year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year"
          },
          "journal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Journal"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "Link to the paper on consensus.app."
          },
          "institutional_access_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Institutional Access Url",
            "description": "Link to the paper's full text through the caller's institution, via LibKey. Returned on paid plans when the caller has selected an institution in Consensus settings and LibKey has a link for the paper; an organization API key uses the institution of the person who created it. Only the first 50 distinct DOIs among the citations are looked up."
          },
          "snippets": {
            "items": {
              "$ref": "#/components/schemas/ThreadCitationSnippet"
            },
            "type": "array",
            "title": "Snippets"
          }
        },
        "type": "object",
        "required": [
          "n",
          "paper_id"
        ],
        "title": "ThreadCitation"
      },
      "ThreadCitationSnippet": {
        "properties": {
          "marker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Marker",
            "description": "The marker in `response` that cites this quote, without brackets: `3.2` is the second distinct quote from paper 3."
          },
          "quote": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote",
            "description": "Verbatim quote the agent relied on."
          },
          "section": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Section",
            "description": "Paper section the quote came from."
          }
        },
        "type": "object",
        "title": "ThreadCitationSnippet"
      },
      "ThreadCreateRequest": {
        "properties": {
          "input_message": {
            "type": "string",
            "maxLength": 10000,
            "minLength": 1,
            "title": "Input Message",
            "description": "The complete research brief. The agent is autonomous and asks no follow-up questions, so include the whole task in one message."
          },
          "mode": {
            "type": "string",
            "enum": [
              "pro",
              "deep"
            ],
            "title": "Mode",
            "description": "Agent depth. `pro` (~20 papers) for almost all requests; `deep` (~50 papers, structured report) requires a paid plan.",
            "default": "pro"
          },
          "filters": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ThreadFilters"
              },
              {
                "type": "null"
              }
            ]
          },
          "attachments": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ThreadAttachments"
              },
              {
                "type": "null"
              }
            ]
          },
          "skill": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "literature-review",
                  "citation-snowballing",
                  "find-citations",
                  "verify-citations"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill",
            "description": "Run a named research workflow (a [Skill](/core-features/skills)) instead of the agent's open-ended plan. Requires `mode` `deep`. Leave unset for normal research. Options: `literature-review`: a multi-paper synthesis of the literature on a topic; searches from several angles, follows citations, and investigates contradictory evidence. `citation-snowballing`: expands from known seed papers by following backward and forward citations; attach or name the seed papers. `find-citations`: finds research to support, qualify, or challenge the uncited claims in a draft; put the draft in `input_message`. `verify-citations`: audits whether the citations already in a draft support their claims and suggests the smallest fix for weak ones; put the cited draft in `input_message` or attach it. Refused with 422 outside `deep` mode, with an organization API key, or when the skill needs input the request didn't include, and with 403 `feature_not_allowed` when skills aren't enabled for your account yet."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "input_message"
        ],
        "title": "ThreadCreateRequest",
        "description": "POST /v1/threads body."
      },
      "ThreadDispatchResponse": {
        "properties": {
          "thread_id": {
            "type": "string",
            "title": "Thread Id"
          },
          "interaction_id": {
            "type": "string",
            "title": "Interaction Id"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Auto-generated Thread title."
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "idle",
              "failed"
            ],
            "title": "Status",
            "description": "Always `running` on dispatch."
          },
          "mode": {
            "type": "string",
            "enum": [
              "pro",
              "deep"
            ],
            "title": "Mode"
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Deep-link to the Thread on consensus.app."
          },
          "poll_after_seconds": {
            "type": "integer",
            "title": "Poll After Seconds",
            "description": "Recommended wait between `GET /v1/threads/{thread_id}` polls."
          },
          "max_wait_seconds": {
            "type": "integer",
            "title": "Max Wait Seconds",
            "description": "Suggested polling ceiling before giving up (~180 pro, ~600 deep)."
          }
        },
        "type": "object",
        "required": [
          "thread_id",
          "interaction_id",
          "status",
          "mode",
          "url",
          "poll_after_seconds",
          "max_wait_seconds"
        ],
        "title": "ThreadDispatchResponse",
        "description": "POST /v1/threads and POST /v1/threads/{thread_id}/interactions."
      },
      "ThreadFilters": {
        "properties": {
          "year_min": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year Min",
            "description": "Exclude papers before this year."
          },
          "year_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year Max",
            "description": "Exclude papers after this year."
          },
          "month_min": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 12.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Month Min",
            "description": "Earliest publication month, paired with `year_min`."
          },
          "month_max": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 12.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Month Max",
            "description": "Latest publication month, paired with `year_max`."
          },
          "study_types": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/StudyTypeKeywordEnum"
                },
                "type": "array"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Study Types",
            "description": "Only include these study types — a list, or a comma-separated string (e.g. `rct,meta-analysis`)."
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain",
            "description": "Restrict to a field of study."
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country",
            "description": "Comma-separated ISO 3166-1 alpha-2 country codes (e.g. us, gb). Unknown codes are ignored."
          },
          "human": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Human",
            "description": "Only include human studies."
          },
          "controlled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Controlled",
            "description": "Only include controlled studies."
          },
          "sample_size_min": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample Size Min",
            "description": "Exclude studies with smaller sample sizes."
          },
          "sjr_min": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 4.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Sjr Min",
            "description": "Exclude journals in better quartiles (1 is best)."
          },
          "sjr_max": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 4.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Sjr Max",
            "description": "Exclude journals in lesser quartiles (1 is best)."
          },
          "citation_min": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Citation Min",
            "description": "Exclude papers with fewer citations."
          },
          "duration_min": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Min",
            "description": "Minimum study duration (days)."
          },
          "duration_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Max",
            "description": "Maximum study duration (days)."
          },
          "exclude_preprints": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude Preprints",
            "description": "Exclude preprints; only peer-reviewed papers."
          },
          "open_access": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open Access",
            "description": "Only include open-access papers."
          },
          "clinical_guideline": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clinical Guideline",
            "description": "Restrict to clinical guidelines."
          },
          "publisher_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publisher Name",
            "description": "Restrict to a publisher."
          },
          "journal_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Journal Name",
            "description": "Restrict to a journal."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ThreadFilters",
        "description": "Global filters applied to every search the agent runs (shared /v1/search\nvocabulary).\n\nField set must match the filter fields of\n``features/quick_search/schema.py:QuickSearchSearchParams`` (the RFC says the\ntwo surfaces share one filter schema); parity is pinned by\n``schema_test.py``. Values are validated here, not just typed: downstream\nparsers silently drop unknown domain/study-type values, and an expensive\nagent run must not execute without a restriction the caller asked for."
      },
      "ThreadFollowUpRequest": {
        "properties": {
          "input_message": {
            "type": "string",
            "maxLength": 10000,
            "minLength": 1,
            "title": "Input Message",
            "description": "The follow-up task. Earlier interactions are used as context automatically — don't restate them."
          },
          "mode": {
            "type": "string",
            "enum": [
              "pro",
              "deep"
            ],
            "title": "Mode",
            "description": "Depth for this follow-up.",
            "default": "pro"
          },
          "filters": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ThreadFilters"
              },
              {
                "type": "null"
              }
            ]
          },
          "attachments": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ThreadAttachments"
              },
              {
                "type": "null"
              }
            ]
          },
          "skill": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "literature-review",
                  "citation-snowballing",
                  "find-citations",
                  "verify-citations"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill",
            "description": "Run a named research workflow (a [Skill](/core-features/skills)) instead of the agent's open-ended plan. Requires `mode` `deep`. Leave unset for normal research. Options: `literature-review`: a multi-paper synthesis of the literature on a topic; searches from several angles, follows citations, and investigates contradictory evidence. `citation-snowballing`: expands from known seed papers by following backward and forward citations; attach or name the seed papers. `find-citations`: finds research to support, qualify, or challenge the uncited claims in a draft; put the draft in `input_message`. `verify-citations`: audits whether the citations already in a draft support their claims and suggests the smallest fix for weak ones; put the cited draft in `input_message` or attach it. Refused with 422 outside `deep` mode, with an organization API key, or when the skill needs input the request didn't include, and with 403 `feature_not_allowed` when skills aren't enabled for your account yet."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "input_message"
        ],
        "title": "ThreadFollowUpRequest",
        "description": "POST /v1/threads/{thread_id}/interactions body (thread_id is the path)."
      },
      "ThreadInteractionResponse": {
        "properties": {
          "interaction_id": {
            "type": "string",
            "title": "Interaction Id"
          },
          "input_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Message"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "idle",
              "failed"
            ],
            "title": "Status"
          },
          "mode": {
            "type": "string",
            "enum": [
              "pro",
              "deep",
              "quick"
            ],
            "title": "Mode"
          },
          "skill": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill",
            "description": "The Skill (named research workflow) requested for this interaction, otherwise the one the agent chose itself, such as `literature-review` or `verify-citations`. Omitted when none applies."
          },
          "response": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response",
            "description": "Synthesized markdown answer. Each citation marker links to its paper: `[N.M]` cites quote M from paper N, and a bare `[N]` cites paper N without a quote. Omitted while running, and omitted for older interactions unless requested via `interaction_id` (only the target interaction is hydrated). Responses use `exclude_none`, so absent fields are dropped, not sent as null."
          },
          "agent_trace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Trace",
            "description": "Human-readable log of the agent's steps (`include_trace=true` only)."
          },
          "citations": {
            "items": {
              "$ref": "#/components/schemas/ThreadCitation"
            },
            "type": "array",
            "title": "Citations"
          },
          "stats": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ThreadStats"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "interaction_id",
          "status",
          "mode"
        ],
        "title": "ThreadInteractionResponse"
      },
      "ThreadListItem": {
        "properties": {
          "thread_id": {
            "type": "string",
            "title": "Thread Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "running",
                  "idle",
                  "failed"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "Latest interaction's status when known; omitted for Threads inactive past the status window. `GET /v1/threads/{thread_id}` is authoritative."
          },
          "preview": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preview",
            "description": "First ~500 chars of the latest answer."
          },
          "interaction_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interaction Count"
          },
          "last_activity_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity At"
          },
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "thread_id",
          "title",
          "url"
        ],
        "title": "ThreadListItem"
      },
      "ThreadListResponse": {
        "properties": {
          "threads": {
            "items": {
              "$ref": "#/components/schemas/ThreadListItem"
            },
            "type": "array",
            "title": "Threads"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          }
        },
        "type": "object",
        "required": [
          "threads",
          "has_more"
        ],
        "title": "ThreadListResponse",
        "description": "GET /v1/threads — the caller's Threads, newest first."
      },
      "ThreadResponse": {
        "properties": {
          "thread_id": {
            "type": "string",
            "title": "Thread Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "idle",
              "failed"
            ],
            "title": "Status",
            "description": "Overall status, mirroring the latest interaction."
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Deep-link to the Thread on consensus.app."
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "last_activity_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity At"
          },
          "interactions": {
            "items": {
              "$ref": "#/components/schemas/ThreadInteractionResponse"
            },
            "type": "array",
            "title": "Interactions"
          }
        },
        "type": "object",
        "required": [
          "thread_id",
          "status",
          "url",
          "interactions"
        ],
        "title": "ThreadResponse",
        "description": "GET /v1/threads/{thread_id} — the polling half of create-then-poll."
      },
      "ThreadStats": {
        "properties": {
          "retrieved": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retrieved"
          },
          "screened": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Screened"
          },
          "included": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Included"
          }
        },
        "type": "object",
        "title": "ThreadStats",
        "description": "Funnel counts for an interaction's run."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "XApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.consensus.app"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
