Ask a question (non-streaming, fast chat only)
Get a single-shot AI-generated answer with sources. To retrieve knowledge from the Cortex, prefer a streaming Deep Research query on POST /api/ask/stream with use_agentic: true — use this endpoint only for quick chat answers from callers that cannot consume SSE. Constraints: use_agentic: true is rejected here with 400 {"error": "agentic_requires_streaming"} (agentic runs routinely take 60–90s), and the request is bounded by a server-side deadline (ASK_DEADLINE_SECONDS, default 28s) returning 504 {"error": "deadline_exceeded"} on expiry.
Ask a question (non-streaming, fast chat only) › Request Body
questionuse_graphmax_hopsuse_rerankinguse_agenticDeep Research mode (agentic multi-step retrieval). Only honored on the streaming endpoints — the non-streaming POST /api/ask rejects use_agentic: true with 400 agentic_requires_streaming.
use_fast_searchcollection_idAsk a question (non-streaming, fast chat only) › Responses
Answer generated
answerretrieval_statscollection_idThe collection scope actually applied (request or key restriction)
structuredParsed JSON answer when response_format was set and parsing succeeded
finish_reasonProvider finish reason of the answer (stop, length, ...)
truncatedThe answer hit the output-token cap (finish_reason == "length") and is cut short
refusedThe answer is the prompt-injection safe refusal, not knowledge — rephrase as a plain question
Streaming answer (primary retrieval endpoint)
Get a streaming answer using Server-Sent Events. This is the recommended way to ask the Cortex anything: send use_agentic: true for Deep Research (agentic multi-step retrieval with visible reasoning), or omit it for streamed chat. SSE heartbeats keep long runs alive — this endpoint has no server-side deadline.
Streaming answer (primary retrieval endpoint) › Request Body
questionuse_graphmax_hopsuse_rerankinguse_agenticDeep Research mode (agentic multi-step retrieval). Only honored on the streaming endpoints — the non-streaming POST /api/ask rejects use_agentic: true with 400 agentic_requires_streaming.
use_fast_searchcollection_idStreaming answer (primary retrieval endpoint) › Responses
Streaming response
Streaming with extended thinking
Stream answer with visible reasoning steps
Streaming with extended thinking › Request Body
questionuse_graphmax_hopsuse_rerankinguse_agenticDeep Research mode (agentic multi-step retrieval). Only honored on the streaming endpoints — the non-streaming POST /api/ask rejects use_agentic: true with 400 agentic_requires_streaming.
use_fast_searchcollection_idStreaming with extended thinking › Responses
Streaming response with thinking