Skip to content
Fieldwork
Esc
↑↓navigate↵open⌘Jpreview

answer_question

Answer a question in one call from the provider’s own search, and return the answer with the sources it cites. Faster and cheaper than research_question. Use for a factual question with a short answer. Do not use for a question that needs many sources compared or a long report (use research_question), or to find pages (use search_web). Defaults to exa. Set provider to choose another supported provider; Fieldwork never switches providers after an error.

POST/api/v1/tools/answer_question
Authorization
AuthorizationBearer token · headerrequired

A Fieldwork gateway key, issued per agent by the operator. Send it as Authorization: Bearer <key>.

Request body
requiredapplication/json
providerstring
Allowed:exatavilyparallelbrave
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
One of:
object
questionstringrequired

The question, with any context the answer depends on.

schemaobject

A JSON Schema object for the answer, which then comes back as output.

countrystring

Localize the answer to this country, as a two-letter ISO code such as GB.

matches ^[A-Za-z]{2}$
maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
object
questionstringrequired

The question, with any context the answer depends on.

schemaobject

A JSON Schema object for the answer, which then comes back as output.

countrystring

Localize the answer to this country, as a two-letter ISO code such as GB.

matches ^[A-Za-z]{2}$
maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
providerstringrequired
object
questionstringrequired

The question, with any context the answer depends on.

limitinteger

How many search results to base the answer on.

min 1 · max 20
includeDomainsstring[]

Only use sources from these domains, such as example.com. Firecrawl, Parallel and Perplexity refuse includeDomains and excludeDomains together.

excludeDomainsstring[]

Leave out sources from these domains, such as example.com. Firecrawl, Parallel and Perplexity refuse includeDomains and excludeDomains together.

publishedAfterstring<date>

Only pages published on or after this date, YYYY-MM-DD.

publishedBeforestring<date>

Only pages published before this date, YYYY-MM-DD.

recencystring

Only pages from the last day, week, month or year.

Allowed:dayweekmonthyear
countrystring

Localize the answer to this country, as a two-letter ISO code such as GB.

matches ^[A-Za-z]{2}$
languagestring

Prefer pages in this language, as an ISO 639-1 code such as en.

maxAgeinteger

Use a cached copy of the page if it is no older than this many seconds. 0 always fetches a fresh copy.

min 0
maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
providerstringrequired
object
questionstringrequired

The question, with any context the answer depends on.

schemaobject

A JSON Schema object for the answer, which then comes back as output.

continueFromstring

The continuationId of an earlier result, to ask a follow-up in the same thread instead of starting over.

includeDomainsstring[]

Only use sources from these domains, such as example.com. Firecrawl, Parallel and Perplexity refuse includeDomains and excludeDomains together.

excludeDomainsstring[]

Leave out sources from these domains, such as example.com. Firecrawl, Parallel and Perplexity refuse includeDomains and excludeDomains together.

maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
providerstringrequired
object
questionstringrequired

The question, with any context the answer depends on.

countrystring

Localize the answer to this country, as a two-letter ISO code such as GB.

matches ^[A-Za-z]{2}$
languagestring

Prefer pages in this language, as an ISO 639-1 code such as en.

maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
providerstringrequired
Responses
200

The provider that ran the call and its normalized result.

providerstringrequired
Allowed:exatavilyparallelbrave
requestIdstringrequired
resultobjectrequired
Show properties
answerstringrequired
citationsobject[]required
Show properties
Array of object
excerptsstring[]
titlestring
urlstringrequired
continuationIdstring
fieldsobject[]

The sources the provider gave for each field.

Show properties
Array of object
citationsobject[]required
Show properties
Array of object
excerptsstring[]
titlestring
urlstringrequired
confidenceany

The provider's own confidence label or score.

fieldstringrequired
reasoningstring
metaobject

Request details from the provider: its request id, what it charged and any warnings.

Show properties
requestIdstring
usageobject
Show properties
costUsdnumber
creditsnumber
unitsobject
warningsstring[]
outputany

The answer in the shape of the schema, when one was given.

truncatedobject[]

One entry for each cut text field; absent when nothing was cut.

Show properties
Array of object
lengthintegerrequired

Original character length.

min 0
pathstringrequired
shownintegerrequired

Characters shown before the inline cut note.

min 0
default

A refusal or a failed call. Branch on error.code; never parse the message.

errorobjectrequired
Show properties
codestringrequired
Allowed:AbortedInvalidRequestJobFailedNotAFileNotFoundProviderErrorRateLimitedTimeoutTooLargeUnauthorizedUnsupported
jobIdstring

A job that was already started. Pass it as resume instead of repeating the call.

messagestringrequired
providerstring
retryAfternumber

Seconds to wait.

retryablebooleanrequired

Whether repeating the same call can succeed.

requestIdstring
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST '/api/v1/tools/answer_question' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider": "exa",
  "timeout": 1,
  "question": "string",
  "schema": {},
  "country": "string",
  "maxCharacters": 1
}'
Response
{
  "provider": "exa",
  "requestId": "string",
  "result": {
    "answer": "string",
    "citations": [
      {
        "excerpts": [
          "string"
        ],
        "title": "string",
        "url": "string"
      }
    ],
    "continuationId": "string",
    "fields": [
      {
        "citations": [
          {
            "excerpts": [
              "string"
            ],
            "title": "string",
            "url": "string"
          }
        ],
        "confidence": null,
        "field": "string",
        "reasoning": "string"
      }
    ],
    "meta": {
      "requestId": "string",
      "usage": {
        "costUsd": 0,
        "credits": 0,
        "units": {
          "property1": 0,
          "property2": 0
        }
      },
      "warnings": [
        "string"
      ]
    },
    "output": null,
    "truncated": [
      {
        "length": 0,
        "path": "string",
        "shown": 0
      }
    ]
  }
}

Was this page helpful?