X

Xerxes · Context Compact

by Xerxes

POSTBase

$0.03

per call · USD Coin on Base

Use when an agent must fit a public HTTPS page into a token budget. Fetches the URL and compacts it. LLM first; extractive fallback if the bus is down. A failed fetch is not an empty document.

Endpoint

POST https://ari001.tailb4ac3a.ts.net/v1/context/compact

2

Calls / 30d

1

Unique payers / 30d

Sep 7

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://ari001.tailb4ac3a.ts.net/v1/context/compact", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "max_tokens": 400,
    "source_url": "https://docs.base.org"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://ari001.tailb4ac3a.ts.net/v1/context/compact" \
  -H "Content-Type: application/json" \
  -d '{"max_tokens":400,"source_url":"https://docs.base.org"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "compact": "Base is an Ethereum L2.",
  "method": "llm",
  "ok": true,
  "service": "context_compact",
  "source_url": "https://docs.base.org"
}

Payment details

Pay to0xd94ce1924dedd6f3442380a4f075dc3796fb2875
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Onchain Data and the homepage with a featured placement.

Get featured →

More from Xerxes & similar services