v13

latestOpenAPI 3.1.0raw.githubusercontent.com2026-01-226780228.2 KB

Query Completion

Generate completion using relevant chunks as context.

post/query

Headers

authorizationstring nullable

Request body

querystring nullable

Natural-language query used to retrieve relevant chunks or documents.

query_imagestring nullable

Base64-encoded image to use as query for Morphik multimodal retrieval. Requires use_colpali=True. Mutually exclusive with 'query'.

filtersobject nullable

Metadata filters supporting logical operators ($and/$or/$not/$nor) and field predicates ($eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$type/$regex/$contains).

kinteger

Maximum number of chunks or documents to return.

min_scorenumber

Minimum similarity score a result must meet before it is returned.

use_rerankingboolean nullable

When provided, overrides the workspace reranking configuration for this request.

use_colpaliboolean nullable

When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval).

output_format'base64' | 'url' | 'text'

Output format for image chunks in retrieval results.

paddinginteger

Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only)

folder_depthinteger nullable

Folder scope depth. 0 or None = exact folder only, -1 = include all descendants, n > 0 = include descendants up to n levels deeper.

end_user_idstring nullable

Optional end-user scope for the operation

max_tokensinteger nullable

Maximum number of tokens allowed in the generated completion.

temperaturenumber nullable

Sampling temperature passed to the completion model (None uses provider default).

chat_idstring nullable

Optional chat session ID for persisting conversation history

stream_responseboolean nullable

Whether to stream the response back in chunks

llm_configobject nullable

LiteLLM-compatible model configuration (e.g., model name, API key, base URL)

inline_citationsboolean nullable

Whether to include inline citations with filename and page number in the response

Response

Successful Response

usageobject required
finish_reasonstring nullable
metadataobject nullable