Skip to main content
POST
Answer a query with RAG over search results

Headers

x-api-key
string
required

Body

application/json

JSON request body for POST /v1/answer.

query
string
required

The natural-language question.

api_key
string | null

API key. Either this or the x-api-key header must be supplied; the header takes precedence.

include_content
boolean

When true, citations carry the document content text. Default false.

model
string | null

Selects the answer tier, which determines behavior and billing. Omitted resolves to the default tier. Independent of scope; the response shape is unchanged.

response_format
any

Optional OpenAI response_format object ({"type": "text" | "json_object" | "json_schema", ...}), accepted as raw JSON exactly like /v1/chat/completions. Under a structured type no inline citations are added, so the answer stays schema-valid; a malformed value is a 400 before billing. Omitted leaves the answer as Markdown prose. Applies at every tier.

scope
string | null

Restricts the grounding search to one scope.

Currently available:

  • web (beta)
  • news
  • wikipedia
  • people
  • companies
  • financial-reports

Omitted, empty or whitespace-only searches the default scope.

stream
boolean

When true, stream the answer as OpenAI-mimic SSE chunks. Default false.

system_prompt
string | null

Steers how the answer is presented — tone, voice, format. It is subordinate to the grounding and citation rules, which stay in force. That precedence is instructional, not a sandbox. Omitted, empty or whitespace-only leaves the presentation unchanged. Applies at every tier and composes with response_format. At most 8 KiB of UTF-8; a longer value is a 400 before billing.

Response

Answer for the query. When stream = false the body is a JSON AnswerHttpResponse; when stream = true it is a text/event-stream of OpenAI-style chunks.

Buffered JSON response body for POST /v1/answer.

answer
string
required

Markdown answer text. Inline citations follow the form text ([Source Name](url)).

citations
object[]
required

The sources the answer was grounded in. Every source the answer was given is returned, whether or not the text cites it.

request_id
string
required

Identifies this request. Quote it when reporting a problem with the response. Also returned as the x-request-id response header.