Home / API docs / AI Summarization API
AI Utilities

AI Summarization API

POST /api/summarize-text $0.01 per call USDC on Base · x402

AI SUMMARIZATION of anything — POST {text} (16,000 chars: transcripts, threads, logs), OR {url} (web page auto-scraped, or PDF/DOCX/CSV auto-extracted), OR {file_base64} for an uploaded PDF/DOCX/CSV/TXT up to 5 MB. Keeps every load-bearing fact, number, and decision. {style}: paragraph (default), bullets, or tldr; {max_words}: 10-300 (default 120); {focus} to steer ('action items'). Want key sentences with no AI? GET /api/summarize ($0.002).

Parameters

NameInDescription
textbodyRaw text to summarize, up to 16,000 characters (provide exactly one of text, url, file_base64)
urlbodyPublic http(s) URL to fetch and summarize — an article/page (main content auto-extracted) or a PDF/DOCX/CSV document
file_base64bodyBase64-encoded PDF, DOCX, CSV, or plain-text file, up to 5 MB decoded (data URI prefix ok)
filenamebodyOptional filename hint for file_base64 type detection, e.g. report.pdf
typebodyOptional parser override for url/file_base64: pdf, docx, or csv
stylebodyparagraph (default), bullets, or tldr
max_wordsbodysummary length cap, 10-300 (default 120)
focusbodyOptional steer: what the summary should emphasize

Example request

curl -X POST "https://api.webbersites.com/api/summarize-text" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/quarterly-report.pdf","style":"bullets","focus":"financial figures"}'
# first call returns 402 + payment requirements; an x402 client pays and retries automatically

Example response

{
    "summary": "- Q3 revenue $4.2M, up 18% YoY\n- Churn down to 2.1%\n- Board approved the Berlin office",
    "style": "bullets",
    "source": "url",
    "source_type": "pdf",
    "title": "Quarterly Report",
    "input_chars": 18400,
    "model": "gemini-2.5-flash-lite"
}
MCP tool: post_summarize_text — via npx -y webbersites-x402-mcp (local, key stays on your machine) or the remote endpoint https://api.webbersites.com/mcp.

How payment works

There is no signup and no API key. Call the endpoint; it replies 402 Payment Required with machine-readable payment requirements. Your client signs a USDC transfer authorization (EIP-3009, gasless) and retries with the X-PAYMENT header — @x402/fetch does this automatically. See the overview for a working snippet.