Document summarization for AI agents. $0.05 per call. No subscriptions. No API keys. No signups.
Cheap. $0.05 per document. Cheaper than running your own LLM stack on most providers, and orders of magnitude cheaper than enterprise summarization APIs.
Long. Up to 200,000 characters per call. Most APIs cap at 30K.
Multilingual. Auto-detects language. Outputs in the same language as input.
Pay only when you use it. No monthly minimums. No per-seat fees. Each call is one signed micropayment over x402.
npm install x402-fetch viem
You need a Base mainnet wallet with a small USDC balance.
# .env
PRIVATE_KEY=0x<your 64-char hex private key>
Note: if you copy a private key from MetaMask, it doesn't include the
0x prefix. Add it manually.
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`)
const fetchWithPay = wrapFetchWithPayment(fetch, account)
const res = await fetchWithPay('https://api.hundun.app/api/summarize', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
pdfUrl: 'https://arxiv.org/pdf/2304.05128.pdf'
})
})
const data = await res.json()
console.log(data.summary)
That's it. The first request returns 402 Payment Required.
wrapFetchWithPayment automatically signs the payment and retries —
you only see the final response.
POST /api/summarizeSummarize a document.
| Field | Value |
|---|---|
| Price | $0.05 USDC |
| Network | Base mainnet |
| Max input | 200,000 characters |
JSON, one of:
{ "pdfUrl": "https://example.com/paper.pdf" }
or
{ "text": "Long text content to summarize..." }
{
"summary": "TL;DR: ...\n\nKey Points:\n1. ...",
"input_length": 193188
}
400 — missing pdfUrl or text402 — payment required (handled automatically by x402 clients)5xx — transient issue, retryNo. The payment is the authentication. Sign with your wallet, you're authenticated.
Yes. Hosted on a global edge network with high availability.
On-chain payments are non-reversible. If you encounter a server error after payment, contact us.
None currently. Be reasonable.
Typically completes in seconds for documents under 50K characters. Longer documents take proportionally longer. The endpoint is hosted on a global edge network and the LLM is a fast inference provider.
Yes. The same input deterministically produces a similar summary (temperature is low). Caching on your side is recommended for repeated queries.