About this endpoint
What it does
Summarizes a single text block by sending the input text to the selected summarization model and returning the generated summary along with summary metadata.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | Yes | The text to summarize. Must be between 50 and 16384 characters long. |
| model | ENUM | No | Summarization model to use. Allowed values: bart, pegasus. Default: bart. |
| num_beams | Integer | No | Beam search count. Minimum: 1, maximum: 8. Default: 4. |
| max_length | Integer | No | Maximum length of the generated summary. Minimum: 30, maximum: 512. Default: 200. |
| min_length | Integer | No | Minimum length of the generated summary. Minimum: 10, maximum: 200. Default: 40. |
Response
Returns a JSON object with model and summary string fields, plus input_length and summary_length integer fields and a compression_ratio number field.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| model | String | No | The model used to generate the summary. |
| summary | String | No | The generated summary text. |
| input_length | Integer | No | Length of the input text. |
| summary_length | Integer | No | Length of the generated summary. |
| compression_ratio | Number | No | Compression ratio of the summary relative to the input. |