About this endpoint
What it does
Uploads a document and returns a summary of its contents. The request body must include the file to summarize, and can optionally include the target summary length and output language.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| file | String | Yes | The document to summarize. Accepted formats: .pdf, .docx, .doc, .odt. |
| summary_length | ENUM | No | Target length of the summary. Allowed values: short, medium, long. Default: short.<br>short ≈ 20 words<br>medium ≈ 60 words<br>long ≈ 100 words |
| output_language | String | No | BCP-47 language code for the output. Defaults to English. |
Response
Returns a JSON object with a data object field. The data object contains a summary string field with the generated document summary.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | Yes | Wrapper object containing the response payload. |
| data.summary | String | No | The generated summary text. |