apyhub
ARTIFICIAL INTELLIGENCE · SMART GENERATION

AI Summarize Documents API

Hosted on ApyHub

What it does

Document Summarizer turns a PDF, DOCX, DOC, or ODT into a concise plain-text summary. Send an uploaded file to POST /file or a direct document URL to POST /url, and get back a single summary string.

Choose the length that fits your workflow: short for roughly 20 words, medium for roughly 60 words, or long for roughly 100 words. You can also set output_language with a BCP-47 language code if you need the summary in a language other than English.

Use Document Summarizer when you need to surface the main points of a report, contract, memo, or research paper without building your own document-processing pipeline. It is useful for preview cards, document triage, review queues, and internal search workflows where a brief human-readable summary is enough.

The response format stays simple: the summary is returned in data.summary, so you can store it, display it, or pass it into another step with minimal parsing.

▣ ENDPOINT 01 / 02
POST
Summarize an uploaded document
http://localhost:8080/apyhub/summarize-documents/file
QUICKSTARTGUIDE

Quickstart

Upload a document to generate a summary.

curl -X POST "http://localhost:8080/apyhub/summarize-documents/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf" \
  -F "summary_length=short"

What you'll get back

Returns a JSON object with a data object. The data object includes a summary string containing the generated document summary.

{
  "data": {
    "summary": "..."
  }
}
TRY ITLIVE · 2600 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.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
The document to summarize (.pdf, .docx, .doc, or .odt).
Target length — short (~20 words), medium (~60 words), long (~100 words).
BCP-47 language code for the output. Defaults to English.

About this endpoint

What it does

Uploads a document and returns a generated text summary for that file. The request body includes the file to summarize and optional settings for summary length and output language.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe document to summarize. Accepted formats: .pdf, .docx, .doc, or .odt.
summary_lengthENUMNoTarget summary length. Allowed values: short (default, ~20 words), medium (~60 words), long (~100 words).
output_languageStringNoBCP-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 with the generated document summary.

ParameterTypeMandatoryDescription
dataObjectYesWrapper object for the response payload.
data.summaryStringNoThe generated summary text.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 02
POST
Summarize a document from a URL
http://localhost:8080/apyhub/summarize-documents/url
QUICKSTARTGUIDE

Quickstart

Summarize a document from a direct file URL.

curl -X POST "http://localhost:8080/apyhub/summarize-documents/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/report.pdf",
    "summary_length": "short"
  }'

What you'll get back

Returns a JSON object with a data object. The data object contains a summary string with the generated document summary.

{
  "data": {
    "summary": "..."
  }
}
TRY ITLIVE · 2600 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*
Direct URL to a PDF, DOCX, DOC, or ODT file.
Target length — short (~20 words), medium (~60 words), long (~100 words).
BCP-47 language code for the output. Defaults to English.

About this endpoint

What it does

Summarizes a document fetched from a direct URL and returns the generated summary in the response. The request body includes the document URL and can optionally control summary length and output language.

Request Body

ParameterTypeMandatoryDescription
urlStringYesDirect URL to a PDF, DOCX, DOC, or ODT file.
summary_lengthENUMNoTarget summary length. Allowed values: short, medium, long. Default: short.<br>short ≈ 20 words<br>medium ≈ 60 words<br>long ≈ 100 words
output_languageStringNoBCP-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.

ParameterTypeMandatoryDescription
dataObjectYesResponse wrapper object.
data.summaryStringNoThe generated summary text.

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.