Search & Inference
Text Summarizer
View DocsAPI Reference
Authorization
ApiKeyAuth access-key<token>
Your unique access-key generated from the platform UI
In: header
Request Body
application/json
doc_process_ids*array<string>
Array of document IDs to summarize (obtained from Upload or List Documents APIs). Only documents with status 'processed' can be used.
focus_areas?array<string>
List of specific topics or areas to focus the summary on. Leave empty for general summary
compression_ratio*integer
Compression percentage (20-80). Only applicable for abstractive type (ignored for extractive)
Range
20 <= value <= 80type*string
Summarization type: 'abstractive' (AI-generated with paraphrasing) or 'extractive' (sentence-based extraction). For extractive type, compression_ratio is ignored.
Value in
"abstractive" | "extractive"model_data*
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.k-v.ai/api/agent/text_summarizer" \ -H "Content-Type: application/json" \ -d '{ "doc_process_ids": [ "your_doc_id" ], "focus_areas": [], "compression_ratio": 30, "type": "abstractive", "model_data": { "model_name": "gpt-5.1", "api_key": "" } }'{
"data": {
"summary": [
"Settlement Agreement and Release between ABC Software Corporation (Plaintiff) and Widget Corporation (Defendant) resolving a dispute over a faxed advertisement sent on January 12, 2009. After Plaintiff's February 1, 2009 demand letter, the parties agree to settle all claims related to the fax. \n\nPlaintiff fully releases and forever discharges Defendant from all past, present, and future claims arising from or related to the faxed advertisement. In exchange, Defendant will pay Plaintiff $1,000 and will cease sending fax advertisements to Plaintiff. Defendant agrees to liquidated damages of $10,000 for each fax advertisement sent to Propel Software Corporation after execution of the Agreement. \n\nEach party bears its own attorneys' fees and costs incurred before execution. In any later action relating to the Agreement, the prevailing party is entitled to reasonable attorneys' fees and costs. Plaintiff warrants it has not assigned or transferred any claims. The Agreement is the entire agreement on these matters and binds and benefits the parties' executors, administrators, representatives, heirs, successors, and assigns. \n\nPlaintiff confirms it has relied on its own chosen attorneys, that the Agreement has been read and explained, and that its terms are understood and accepted. The Agreement is governed by California law. The parties agree to execute any further documents needed to carry out its terms. The Agreement becomes effective upon execution, signed by Plaintiff's CEO and Defendant, with Plaintiff's counsel confirming it was explained and executed per their advice."
],
"tokens": {
"input": 984,
"output": 310,
"total": 1294
}
},
"message": "Summary extracted successfully"
}{
"data": {},
"message": "Invalid docs selected"
}{
"value": {
"data": {},
"message": "Invalid or missing access key"
}
}{
"detail": [
{
"type": "literal_error",
"loc": [
"body",
"model_data",
"model_name"
],
"msg": "Input should be 'gpt-5-chat-latest', 'gpt-5.1', 'gpt-5-mini', 'claude-sonnet-4-5-20250929', 'gemini/gemini-2.5-flash-lite', 'mistral/mistral-small-latest', 'mistral/mistral-medium-latest', 'gemini/gemini-2.5-pro', 'gemini/gemini-3-pro-preview' or 'llama3.1-70b'",
"input": "",
"ctx": {
"expected": "'gpt-5-chat-latest', 'gpt-5.1', 'gpt-5-mini', 'claude-sonnet-4-5-20250929', 'gemini/gemini-2.5-flash-lite', 'mistral/mistral-small-latest', 'mistral/mistral-medium-latest', 'gemini/gemini-2.5-pro', 'gemini/gemini-3-pro-preview' or 'llama3.1-70b'"
}
}
]
}{
"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."
}