Summarization
Summarizes the input text, PDF, HTML, EML, MBOX, MS Office document or image.#
/lmkit/v1/summarizeAnalyzes the provided content to generate a summary using the specified or default summarization model. Optional summarization parameters, such as maximum content words, maximum title words, and overflow resolution strategy, can be provided to control the summarization process. Returns the summarized content and title as defined in the response model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/ for status and results.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
model | string | The identifier of the language model to be used for summarization. If not provided, the default model is used. |
inputrequired | string | The input for summarization. When input_format is 'PlainText', provide raw text. When 'Base64EncodedFile', provide a base64-encoded file payload (supported: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF). When 'FileIdentifier', provide the file ID previously returned by the api/v1/files/upload endpoint. |
input_format | How the input is provided. Accepted values: 'PlainText', 'Base64EncodedFile', or 'FileIdentifier'. 'Base64EncodedFile' supports: HTML, PDF, XLSX, PPTX, DOCX, EML, MBOX, PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF. 'FileIdentifier' references a file previously uploaded via api/v1/files/upload. Defaults to 'PlainText'. | |
max_content_words | object (int32) | The maximum number of words allowed in the summarized content. Value is constrained between 0 and 2000 words. Defaults to 200. |
generate_content | boolean | Determines whether the summarization content should be generated. Defaults to true. |
generate_title | boolean | Determines whether the summarization title should be generated. Defaults to true. |
max_title_words | object (int32) | The maximum number of words allowed in the summarized title. Value is constrained between 0 and 50 words. Defaults to 10. |
overflow_strategy | one of object · | |
intent | one of object · | |
guidance | string | Additional guidance text that can influence the summarization process (e.g., focusing on certain themes or tones). |
target_language | Specifies the preferred language for the summarization output. If set to 'Undefined', the engine attempts to automatically detect the input content language and produces the summary accordingly (note: automatic detection may affect performance). When explicitly set, the engine attempts to interpret content and generate summaries in the selected language. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 500 | application/json | Internal Server Error |
| 404 | Not Found |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/summarize" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "",
"input": "",
"input_format": "PlainText",
"max_content_words": 200,
"generate_content": true
}'