Knowledge
Query an engine
Ask an engine a question and get one answer from your sources, with citations and a confidence score.
/v1/engine/querySearches 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>requiredThe engine to ask.
querystringrequiredThe question, in plain words.
top_kintegerdefault: 8How many chunks to search for, from 1 to 50. Your plan can cap it lower.
query_modestringdefault: precisegrounded, blended, or retrieval. precise and guide mean grounded, and explore means blended. See Answer modes.
model_idstring | nullA generation model your plan includes, up to 128 characters. Leave it out to use the engine's model.
Response
answerstringrequiredThe answer, written from your sources.
citationsobject[]requiredThe chunks the answer is based on. Each has chunk_id, page_number, and section_title.
confidencenumberrequiredHow well the sources support the answer, from 0 to 1. 0 when no citation was valid. See Citations and confidence.
Status codes
| Status | Meaning |
|---|---|
200 | The engine answered. |
400 | The question couldn't be answered as sent. The detail says why. |
401 | The key is missing, malformed, or revoked. |
402 | Your plan's monthly allowance is used up. |
403 | The key's capability or scope doesn't allow reading this engine. |
404 | The engine doesn't exist in the key's workspace. |
422 | A field is missing or invalid. |
429 | A rate limit was hit. |