Knowledge Search
View DocsAPI Reference
Authorization
ApiKeyAuth Your unique access-key generated from the platform UI
In: header
Request Body
application/json
Array of document IDs to search within (obtained from Upload or List Documents APIs). Only documents with status 'processed' can be searched.
Natural language question to ask about your documents. More specific questions yield better answers.
Response detail level: 'concise' for brief direct answers, 'medium' for balanced responses, 'extended' for comprehensive analysis
"medium""concise" | "medium" | "extended"Optional array of domain context IDs. Domain Context dictates WHAT the agent knows (rules, terminology, process).
Optional agent context ID (only one allowed). Agent Context dictates HOW the agent behaves (format, tone, style).
i-Check improves reliability in AI workflows by enforcing idempotence—ensuring consistent outputs across repeated runs. It embeds verification checkpoints to detect inconsistencies and reduce redundant processing. 0 to disable, 1 to turn on.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.k-v.ai/api/agent/k_search" \ -H "Content-Type: application/json" \ -d '{ "doc_process_ids": [ "your_doc_id" ], "question": "What are the parties involved?", "context": "medium", "model_data": { "model_name": "gpt-5-chat-latest", "api_key": "" }, "domain_context_ids": [ "domain_context_1" ], "agent_context_id": 0, "icheck": 0 }'{
"data": {
"answer": "The parties involved are:\n\n- **ABC Software Corporation** (referred to as the **Plaintiff**)\n- **Widget Corporation** (referred to as the **Defendant**)",
"sources": [
{
"content": "SETTLEMENT AGREEMENT AND RELEASE...",
"score": 0.38453761232252937,
"filename": "Settlement Agreement (1).pdf",
"doc_hash": "264dfa262b748d15ccbeaada89430c68",
"page_number": 1
}
]
},
"message": "Question processed successfully"
}{
"data": {},
"message": "query not provided"
}{
"value": {
"data": {},
"message": "Invalid or missing access key"
}
}{
"detail": [
{
"type": "literal_error",
"loc": [
"body",
"context"
],
"msg": "Input should be 'concise', 'medium' or 'extended'",
"input": "",
"ctx": {
"expected": "'concise', 'medium' or 'extended'"
}
}
]
}{
"data": {},
"message": "litellm.AuthenticationError: AuthenticationError: OpenAIException - Incorrect API key provided: tyrdfuih**uhf7. You can find your API key at https://platform.openai.com/account/api-keys."
}