Retrieval and answers
Find the most relevant passages
Section titled “Find the most relevant passages”POST /v1/retrieveRequest body (application/json)
Section titled “Request body (application/json)”| 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 |
Response 200
Section titled “Response 200”Errors
Section titled “Errors”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.
Answer a question with citations
Section titled “Answer a question with citations”POST /v1/answerWith stream: true the response is Server-Sent Events: delta events carry
{text}, then one done event carries the full answer object.
Request body (application/json)
Section titled “Request body (application/json)”| 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 |
Response 200
Section titled “Response 200”AnswerResponse (or Server-Sent Events with stream: true)
Errors
Section titled “Errors”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.
Rate an answer
Section titled “Rate an answer”POST /v1/feedbackRequest body (application/json)
Section titled “Request body (application/json)”| Field | Type | Required | Notes |
|---|---|---|---|
query_log_id |
string (uuid) | yes | |
rating |
-1 | 1 |
yes | |
correction |
string | null | no | max length 4000 |
Response 204
Section titled “Response 204”no body
Errors
Section titled “Errors”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.