Skip to content

Retrieval and answers

POST /v1/retrieve
Field Type Required Notes
query string yes min length 1; max length 4000
end_user_id string | null no Your own id for the person asking. Scopes private documents and memory; min length 1; max length 255
top_k integer no ≥ 1; ≤ 20; default 8
filters object | null no Match documents whose metadata contains these key/values
include_memory boolean no default true
conversation_id string (uuid) | null no Continue this conversation: a follow-up like “and on Saturdays?” is understood from its earlier turns. Needs end_user_id. Answers start a new conversation when it’s left out and return its id

RetrieveResponse

401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 413 Request Entity Too Large · 422 Unprocessable Entity · 429 Too Many Requests

Every error has the same body: see Limits and errors.

POST /v1/answer

With stream: true the response is Server-Sent Events: delta events carry {text}, then one done event carries the full answer object.

Field Type Required Notes
query string yes min length 1; max length 4000
end_user_id string | null no Your own id for the person asking. Scopes private documents and memory; min length 1; max length 255
top_k integer no ≥ 1; ≤ 20; default 8
filters object | null no
stream boolean no default false
answer_length "short" | "standard" | null no short: a few sentences. Defaults to the project’s behaviour setting
conversation_id string (uuid) | null no Continue this conversation: a follow-up like “and on Saturdays?” is understood from its earlier turns. Needs end_user_id. Answers start a new conversation when it’s left out and return its id

AnswerResponse (or Server-Sent Events with stream: true)

401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 413 Request Entity Too Large · 422 Unprocessable Entity · 429 Too Many Requests

Every error has the same body: see Limits and errors.

POST /v1/feedback
Field Type Required Notes
query_log_id string (uuid) yes
rating -1 | 1 yes
correction string | null no max length 4000

no body

401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 413 Request Entity Too Large · 422 Unprocessable Entity · 429 Too Many Requests

Every error has the same body: see Limits and errors.