API docs.

Document summarization for AI agents. $0.05 per call. No subscriptions. No API keys. No signups.

Why hundun?

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.

Quickstart (Node.js)

1. Install

npm install x402-fetch viem

2. Set your wallet

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.

3. Call the API

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.

Endpoints

POST /api/summarize

Summarize a document.

FieldValue
Price$0.05 USDC
NetworkBase mainnet
Max input200,000 characters

Request body

JSON, one of:

{ "pdfUrl": "https://example.com/paper.pdf" }

or

{ "text": "Long text content to summarize..." }

Response (200 OK)

{
  "summary": "TL;DR: ...\n\nKey Points:\n1. ...",
  "input_length": 193188
}

Notes

Errors

FAQ

Do I need an API key?

No. The payment is the authentication. Sign with your wallet, you're authenticated.

Can I use this in production?

Yes. Hosted on a global edge network with high availability.

Refunds?

On-chain payments are non-reversible. If you encounter a server error after payment, contact us.

Rate limits?

None currently. Be reasonable.

What's the response latency?

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.

Can I cache responses?

Yes. The same input deterministically produces a similar summary (temperature is low). Caching on your side is recommended for repeated queries.