apyhub
ARTIFICIAL INTELLIGENCE · SMART GENERATION

Text Summarization API

What it does

Text Summarizer turns a single block of text into a shorter summary. Send text in the body.text field and get back the generated summary along with model, input_length, summary_length, and compression_ratio.

Use it when you need to condense long articles, support tickets, research notes, or meeting transcripts into something faster to review. The request accepts optional controls for model (bart or pegasus), num_beams, max_length, and min_length, so you can tune the tradeoff between brevity and detail.

The response is structured for downstream automation. input_length and summary_length help you measure how aggressively the text was shortened, while compression_ratio gives you a simple signal for reporting or quality checks. Keep the input between 50 and 16,384 characters and use the summary in search, classification, or human review workflows.

POST
Summarize a single text block
http://localhost:8080/dosvak/summarize-text-api
QUICKSTARTGUIDE

Quickstart

Summarize a piece of text by sending it in a JSON request body.

curl -X POST "http://localhost:8080/dosvak/summarize-text-api" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Artificial intelligence is transforming how teams work by automating repetitive tasks, improving search, and helping people draft content faster. Many organizations are adopting AI tools to increase productivity while keeping humans in the loop for review and decision-making."
  }'

What you'll get back

Returns a JSON object with model as a string, summary as a string, input_length as an integer, summary_length as an integer, and compression_ratio as a number.

{
  "model": "bart",
  "summary": "AI is helping teams work faster by automating tasks, improving search, and assisting with drafting, while humans still review and decide.",
  "input_length": 286,
  "summary_length": 24,
  "compression_ratio": 11.92
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

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

ParameterTypeMandatoryDescription
textStringYesThe text to summarize. Must be between 50 and 16384 characters long.
modelENUMNoSummarization model to use. Allowed values: bart, pegasus. Default: bart.
num_beamsIntegerNoBeam search count. Minimum: 1, maximum: 8. Default: 4.
max_lengthIntegerNoMaximum length of the generated summary. Minimum: 30, maximum: 512. Default: 200.
min_lengthIntegerNoMinimum 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.

ParameterTypeMandatoryDescription
modelStringNoThe model used to generate the summary.
summaryStringNoThe generated summary text.
input_lengthIntegerNoLength of the input text.
summary_lengthIntegerNoLength of the generated summary.
compression_ratioNumberNoCompression ratio of the summary relative to the input.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.