Tools / AI

Summarize text or a URL

Summarizes a block of text or the content of a URL (HTML or PDF) using a fast LLM. Pick the length and whether you want prose or bullet points, and optionally a focus such as 'pricing' or 'risks'.

Price per call
$0.005 USDC
Endpoint
POST https://x402-tools.com/v1/summarize
Also accepts
GET with query parameters
Payment
x402, exact scheme, USDC on Base
Returns
application/json

Parameters

NameTypeDescription
urlstringURL to summarize (use this or text).
textstringText to summarize, up to 60000 characters (use this or url).
lengthstring'short', 'medium' (default) or 'long'.
formatstring'prose' (default) or 'bullets'.
focusstringOptional topic to focus on.

Call it from an agent

import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const paidFetch = wrapFetchWithPayment(fetch, account);

const res = await paidFetch("https://x402-tools.com/v1/summarize", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "url": "https://en.wikipedia.org/wiki/HTTP_402",
    "length": "short",
    "format": "bullets"
  }),
});
// costs $0.005 in USDC on Base

Without a payment the endpoint answers 402 with the price, so you can inspect it first:

curl -i -X POST "https://x402-tools.com/v1/summarize" -H "content-type: application/json" -d '{"url":"https://en.wikipedia.org/wiki/HTTP_402","length":"short","format":"bullets"}'

Example response

{
  "summary": "- HTTP 402 Payment Required is a reserved status code…",
  "source": "https://en.wikipedia.org/wiki/HTTP_402",
  "input_characters": 5321
}

If the tool fails or your input is invalid, the payment is not settled.

Other tools