AI Summarization API
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
| Name | In | Description | |
|---|---|---|---|
text | body | Raw text to summarize, up to 16,000 characters (provide exactly one of text, url, file_base64) | |
url | body | Public http(s) URL to fetch and summarize — an article/page (main content auto-extracted) or a PDF/DOCX/CSV document | |
file_base64 | body | Base64-encoded PDF, DOCX, CSV, or plain-text file, up to 5 MB decoded (data URI prefix ok) | |
filename | body | Optional filename hint for file_base64 type detection, e.g. report.pdf | |
type | body | Optional parser override for url/file_base64: pdf, docx, or csv | |
style | body | paragraph (default), bullets, or tldr | |
max_words | body | summary length cap, 10-300 (default 120) | |
focus | body | Optional 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 automaticallyExample 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"
}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.