Summarize
Summarize
Summarize
Produce an abstractive summary of a block of text.
POST
Summarize
Overview
The/summarization/abstractive endpoint condenses text in the model’s own words without adding new information or commentary. Unlike extractive summarization, the output is a fluent rewrite — not a selection of lifted sentences.
Request
The input text to summarize. Can be an article, document, transcript, or any plain text string. Either
text or document must be provided. If both are given, the OCR text is appended after text.A base64-encoded file to summarize. Supported formats: JPEG, PNG, TIFF, single-page PDF, multi-page PDF. The file is processed via AWS Textract OCR and the extracted text is used as input. Either
text or document must be provided.MIME type of the document (e.g.
"image/jpeg", "application/pdf"). Required when document is provided.Optional additional rules for the summary. These are appended to the base instructions — they extend, not replace, the default behaviour (no new information, no commentary).Examples:
"Use bullet points.""Focus on financial figures only.""Write in Spanish.""Limit to 3 sentences."
Maximum number of tokens in the generated summary.
Response
The generated summary text.
Character count of the input text.
Character count of the generated summary.
End-to-end request latency in milliseconds.
The raw text extracted from the document via OCR.
null if no document was provided.Error responses
| Status | Meaning |
|---|---|
422 Unprocessable Entity | Malformed request body, neither text nor document provided, or OCR failed. |
500 Internal Server Error | Inference service unavailable. |
504 Gateway Timeout | Summarization request timed out. |
Authentication
Include your API key in every request using thex-api-key header.
Examples
Basic summary
With instructions
Useinstructions to control format, language, focus area, or length.
Summarizing a document
Pass a base64-encoded image or PDF in thedocument field. The OCR text is extracted automatically and summarized. The raw OCR output is returned as ocr_text.
Notes
- The base instructions (no new information, no commentary) are always applied. The
instructionsfield adds on top of them — it does not replace them. - Temperature, top-p, and other sampling parameters are fixed and not configurable via the API.
Authorizations
Body
application/json