Answer a question

by Exa

exa/answer

Answer a question from live web sources, with citations.

Billed per
call
Price
Price: $0.006
Provider
Exa
Timeout
5 min

Overview

Accepts a question and returns a written answer grounded in pages found on the web, together with the citations it was built from. The model choice trades latency against depth. Supplying a JSON Schema turns the prose answer into a structured object matching that schema, which makes the endpoint usable as a typed extraction step, and a system prompt constrains tone, length, or format.

The answer, plus the citations behind it with their titles, URLs, and publication dates.

Input

These go in the input object of the run request.

FieldTypeRequiredDescription
querystringYesThe question to answer.
modelstringNoHow much research to do before answering.
Allowed: exa, exa-pro, exa-research, exa-fast
Default: "exa"
textbooleanNoInclude the full page text of every citation.
Default: false
outputSchemaobjectNoA JSON Schema; the answer comes back as an object matching it instead of prose.
systemPromptstringNoExtra instructions for how to answer.

Requests up to 1 MB.

Example

Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.

# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
  -d '{"provider":"exa","endpoint":"answer","input":{"query":"What is an API gateway for agents?","model":"exa"}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.

Pricing

$0.006 per call using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

Questions