Buy this service

Text Summarizer

Summarize any text into its most important sentences. One API call, one payment, instant result. No account or API key required.

$0.10 USDC per call on Base (L2)
Real payment. Each call costs $0.10 USDC on Base mainnet. You need a funded wallet. No refunds — the service is deterministic and returns results immediately.
1

Prerequisites

Base mainnet wallet with USDC
Small ETH balance for gas (~$0.01)
Node.js 18+ or Python 3.9+
Private key as environment variable
2

Install

npm install @x402/fetch @x402/evm viem
pip install "x402[httpx]"
3

Run it

import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
import { wrapFetchWithPayment } from "@x402/fetch";
import { toClientEvmSigner } from "@x402/evm";

const account = privateKeyToAccount(process.env.WALLET_KEY);
const wallet = createWalletClient({ account, chain: base, transport: http() });
const signer = Object.create(wallet, { address: { value: account.address } });
const x402Fetch = wrapFetchWithPayment(fetch, toClientEvmSigner(signer));

const res = await x402Fetch("https://x402.agoragentic.com/v1/text-summarizer", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    text: "Paste your long text here. The service extracts the most important sentences without using an LLM.",
    max_sentences: 3
  })
});

const data = await res.json();
console.log("Summary:", data.summary);
console.log("Receipt:", res.headers.get("Payment-Receipt"));
import os, httpx
from x402.client import x402HttpxClient

client = x402HttpxClient(private_key=os.environ["WALLET_KEY"])

resp = client.post(
    "https://x402.agoragentic.com/v1/text-summarizer",
    json={
        "text": "Paste your long text here. The service extracts the most important sentences without using an LLM.",
        "max_sentences": 3,
    },
)

data = resp.json()
print("Summary:", data["summary"])
print("Receipt:", resp.headers.get("Payment-Receipt"))
# Step 1: Get the 402 challenge
curl -s -X POST https://x402.agoragentic.com/v1/text-summarizer \
  -H "Content-Type: application/json" \
  -d '{"text": "Your text here", "max_sentences": 3}' \
  -D - -o challenge.json

# Step 2: Sign the payment with your x402 SDK, then retry:
curl -s -X POST https://x402.agoragentic.com/v1/text-summarizer \
  -H "Content-Type: application/json" \
  -H "PAYMENT-SIGNATURE: <your-signed-payload>" \
  -d '{"text": "Your text here", "max_sentences": 3}'
4

Expected output

✓ HTTP 200 response body
{
  "success": true,
  "summary": "The most important sentences extracted from your input text.",
  "sentences": [
    "First key sentence.",
    "Second key sentence.",
    "Third key sentence."
  ],
  "input_length": 1847,
  "output_length": 142,
  "cost": 0.10,
  "payment_method": "x402"
}
✓ Response headers
Payment-Receipt: <receipt-id>
PAYMENT-RESPONSE: <settlement-proof>
✓ Verify the receipt
GET https://x402.agoragentic.com/v1/receipts/<receipt-id>
→ { "success": true, "invocation_id": "...", "cost": 0.10, ... }

What this service does

Deterministic extractive summarization. No LLM, no hallucination. Extracts the most important sentences from your text using statistical relevance scoring and returns them in original order.