> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Exa Answer: Inputs, Cost & CLI Example

> Getting a direct, citation-backed answer from web results. Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=exa_answer:{"query":"{{query}}"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                   | Type      | Required | Default | Description                                                                              |
| ---------------------- | --------- | -------- | ------- | ---------------------------------------------------------------------------------------- |
| `payload.query`        | `string`  | Yes      |         | Question to answer using web results.                                                    |
| `payload.stream`       | `boolean` | No       |         | Stream tokens as they are generated.                                                     |
| `payload.text`         | `boolean` | No       |         | Include full source text in citations.                                                   |
| `payload.outputSchema` | `any`     | No       |         | JSON Schema to return a structured answer. Supports arbitrary user-defined schema shape. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Exa answer input.",
    "properties": {
      "query": {
        "type": "string",
        "description": "Question to answer using web results."
      },
      "stream": {
        "type": "boolean",
        "description": "Stream tokens as they are generated."
      },
      "text": {
        "type": "boolean",
        "description": "Include full source text in citations."
      },
      "outputSchema": {
        "type": "any",
        "description": "JSON Schema to return a structured answer. Supports arbitrary user-defined schema shape."
      }
    },
    "required": [
      "query"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name          | Type     | Required | Default | Description                                    |
| ------------- | -------- | -------- | ------- | ---------------------------------------------- |
| `result.data` | `object` | Yes      |         | Provider response payload.                     |
| `result.meta` | `record` | No       |         | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Exa answer result.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "answer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "additionalProperties": {}
              }
            ]
          },
          "citations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "publishedDate": {
                  "type": "string"
                },
                "author": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {}
                  ]
                },
                "score": {
                  "type": "number"
                },
                "highlights": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "highlightScores": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                },
                "summary": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  ]
                },
                "entities": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "company",
                          "person"
                        ]
                      },
                      "version": {
                        "type": "number"
                      },
                      "properties": {
                        "type": "object",
                        "additionalProperties": {}
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "extras": {
                  "type": "object",
                  "additionalProperties": {}
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": {}
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute exa_answer --payload '{
  "query": "latest developments in AI agents"
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Provider API Context

<details>
  <summary>Show provider reference (optional)</summary>

  ```md theme={null}
  > Get an LLM answer to a question informed by Exa search results. `/answer` performs an Exa search and uses an LLM to generate either:
  1. A direct answer for specific queries. (i.e. "What is the capital of France?" would return "Paris")
  2. A detailed summary with citations for open-ended queries (i.e. "What is the state of ai in healthcare?" would return a summary with citations to relevant sources)

  The response includes both the generated answer and the sources used to create it. The endpoint also supports streaming (as `stream=True`), which will return tokens as they are generated.

  Alternatively, you can use the OpenAI compatible [chat completions interface](https://docs.exa.ai/reference/chat-completions#answer).

  &lt;Card title="Get your Exa API key" icon="key" horizontal href="https://dashboard.exa.ai/api-keys" />

  &lt;Info>
    `/answer` supports structured output via the `outputSchema` parameter. Pass a [JSON Schema](https://json-schema.org/draft-07) object and the answer will be returned as structured JSON matching your schema instead of a plain string.
  &lt;/Info>
  ```
</details>

## Cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0.07` per pricing unit.
* Billing mode: `post_deduct`.
