Skip to main content
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

string
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.
string
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.
string
MIME type of the document (e.g. "image/jpeg", "application/pdf"). Required when document is provided.
string
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."
number
default:2048
Maximum number of tokens in the generated summary.

Response

string
The generated summary text.
number
Character count of the input text.
number
Character count of the generated summary.
number
End-to-end request latency in milliseconds.
string | null
The raw text extracted from the document via OCR. null if no document was provided.

Error responses

Authentication

Include your API key in every request using the x-api-key header.

Examples

Basic summary

Response:

With instructions

Use instructions to control format, language, focus area, or length.
Response:

Summarizing a document

Pass a base64-encoded image or PDF in the document field. The OCR text is extracted automatically and summarized. The raw OCR output is returned as ocr_text.
Response:

Notes

  • The base instructions (no new information, no commentary) are always applied. The instructions field 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

x-api-key
string
header
required

Body

application/json
text
string
required

The input text to summarize.

instructions
string

Optional additional rules for the summary.

max_tokens
number
default:20048

Maximum number of tokens in the generated summary.

Response

Successful summarization

summary
string
input_chars
number
output_chars
number
latency_ms
number