Skip to Content

Knowledge

Query an engine

Ask an engine a question and get one answer from your sources, with citations and a confidence score.

POST/v1/engine/query

Searches the engine's linked sources, writes an answer from them, and checks every citation before it returns. lynk.query calls it for you.

Body

engine_idstring<uuid>required

The engine to ask.

querystringrequired

The question, in plain words.

top_kintegerdefault: 8

How many chunks to search for, from 1 to 50. Your plan can cap it lower.

query_modestringdefault: precise

grounded, blended, or retrieval. precise and guide mean grounded, and explore means blended. See Answer modes.

model_idstring | null

A generation model your plan includes, up to 128 characters. Leave it out to use the engine's model.

Response

answerstringrequired

The answer, written from your sources.

citationsobject[]required

The chunks the answer is based on. Each has chunk_id, page_number, and section_title.

confidencenumberrequired

How well the sources support the answer, from 0 to 1. 0 when no citation was valid. See Citations and confidence.

Status codes

StatusMeaning
200The engine answered.
400The question couldn't be answered as sent. The detail says why.
401The key is missing, malformed, or revoked.
402Your plan's monthly allowance is used up.
403The key's capability or scope doesn't allow reading this engine.
404The engine doesn't exist in the key's workspace.
422A field is missing or invalid.
429A rate limit was hit.