When you execute a task using the Task API, the response includes both the generated output and its corresponding basis—a structured explanation detailing the reasoning and evidence behind each result. This transparency enables you to understand how the system arrived at its conclusions and to assess the reliability of the output.

Task Run Result

Every Task Run Result object contains the following fields:

FieldTypeDescription
runobjectTask Run object with status and id, detailed above.
outputTaskRunOutput object or nullOutput from the task conforming to the output schema. Present iff run.status == completed.

A TaskRunOutput object can be one of two types:

  • TaskRunTextOutput
  • TaskRunJsonOutput

Both have the following fields:

FieldTypeDescription
contentstringJSON or plain text according to the output schema.
basisarray[FieldBasis]Basis for each top-level output field. See FieldBasis object below.
typestringAlways text

Basis Definition

The basis field contains an array of FieldBasis objects that correspond to each top-level field in your output. This allows you to trace exactly which sources on the web contributed to each specific piece of information in your result.

The FieldBasis object

Each FieldBasis object has these components:

FieldTypeDescription
fieldstringName of the corresponding output field
citationsarray[Citation]List of web sources supporting the output field
reasoningstringExplanation of how the system processed the information
confidencestring or nullReliability rating (premium processors only)

Citations

Citations provide the exact URLs where information was found. In premium processors, each citation includes excerpts from the source that contributed to the output:

FieldTypeDescription
urlstringThe source URL
excerptsarray[string] or nullRelevant text from the source (premium processors only)

Having multiple citations for an output field often indicates stronger evidence, as the information was verified across multiple sources.

Reasoning

The reasoning field explains how the system evaluated, compared, and synthesized information from different sources. This is particularly valuable when:

  • Information from different sources needed to be reconciled
  • Calculations or conversions were performed
  • The system needed to make judgments about conflicting data

Confidence Levels

Premium processors include a confidence rating for each output field:

  • High: Strong evidence from multiple authoritative sources with consistent information
  • Medium: Adequate evidence but with some inconsistencies or from less authoritative sources
  • Low: Limited or conflicting evidence, or information from less reliable sources

Examples

Output with Basis

Here’s an example of a complete Task Run output that includes basis information:

{
  "content": "{\"company\":\"Microsoft\",\"founded\":\"1975\",\"headquarters\":\"Redmond, Washington, USA\"}",
  "basis": [
    {
      "field": "company",
      "citations": [
        {
          "url": "https://www.microsoft.com/en-us/about",
          "excerpts": ["Microsoft Corporation is an American multinational technology corporation headquartered in Redmond, Washington."]
        }
      ],
      "reasoning": "The company name is clearly identified on the official corporate website.",
      "confidence": "high"
    },
    {
      "field": "founded",
      "citations": [
        {
          "url": "https://www.microsoft.com/en-us/about/company",
          "excerpts": ["Founded in 1975, Microsoft (Nasdaq "MSFT") enables digital transformation for the era of an intelligent cloud and an intelligent edge."]
        },
        {
          "url": "https://en.wikipedia.org/wiki/Microsoft",
          "excerpts": ["Microsoft Corporation was founded by Bill Gates and Paul Allen on April 4, 1975, to develop and sell BASIC interpreters for the Altair 8800."]
        }
      ],
      "reasoning": "Multiple authoritative sources consistently state 1975 as the founding year. The official company website and Wikipedia both confirm this date, with Wikipedia providing the specific day (April 4).",
      "confidence": "high"
    },
    {
      "field": "headquarters",
      "citations": [
        {
          "url": "https://www.microsoft.com/en-us/about/company",
          "excerpts": ["Headquartered in Redmond, Washington, Microsoft has offices in over 100 countries."]
        }
      ],
      "reasoning": "The official company website explicitly states the headquarters location as Redmond, Washington, USA.",
      "confidence": "high"
    }
  ],
  "type": "json"
}

High vs. Low Confidence Outputs

{
  "field": "revenue",
  "citations": [
    {
      "url": "https://www.microsoft.com/en-us/Investor/earnings/FY-2023-Q4/press-release-webcast",
      "excerpts": ["Microsoft reported fiscal year 2023 revenue of $211.9 billion, an increase of 7% compared to the previous fiscal year."]
    },
    {
      "url": "https://www.sec.gov/Archives/edgar/data/789019/000095017023014837/msft-20230630.htm",
      "excerpts": ["Revenue was $211.9 billion for fiscal year 2023, up 7% compared to $198.3 billion for fiscal year 2022."]
    }
  ],
  "reasoning": "The revenue figure is consistent across both the company's investor relations page and their official SEC filing. Both sources explicitly state the fiscal year 2023 revenue as $211.9 billion, representing a 7% increase over the previous year.",
  "confidence": "high"
}