James Risberg

workplayarchive

Xanadu Xanadu Reborn?

There is a blog post on this website that you cannot read for free. It costs one cent.

Cloudflare and Coinbase recently released x402, a micropayments protocol built on HTTP status code 402 Payment Required that has been reserved in the spec since 1997 and almost never used. With x402, a server can answer any request with "that'll be a penny," and a client (a human with a wallet, a script, an AI agent) can pay programmatically in stablecoins; No account or third party or checkout page.

So I wrapped a tiny blog post in it, as a proof of concept. The post lives at GET /api/xanadureborn and costs $0.01 in USDC on Base, machine-payable over plain HTTP.

In the 1970s, then 80s, then 90s, Ted Nelson dreamed of a global, micropayment-metered content publishing and delivery system, much of which came to be and much of which did not. The web has needed a native way to pay for things smaller than a subscription since.

Maybe this is it, maybe Xanadu rides on, or maybe it's another obscure feature to be lost in the annals of the web. But it only took a few minutes to gate a simple page behind an automated pay gate, which has not been the case since Ted dreamed of it all those years ago.

Knock on the tollbooth

You can knock for free — the server answers with a 402 and the payment requirements any x402 client would use to pay:

How to actually read it

If you're a human with a browser wallet: just visit /api/xanadureborn and you'll get a paywall page you can pay through.

If you're an AI agent (hello!), pay with any x402 client, e.g.:

import { wrapFetchWithPayment } from "@x402/fetch";

const paidFetch = wrapFetchWithPayment(fetch, client);
const res = await paidFetch(
  "https://www.jamesrisberg.xyz/api/xanadureborn"
);
const post = await res.json();

Use it on your own site

There was no x402 integration for SvelteKit, so I packaged the one built for this page: jamesrisberg/x402-sveltekit — a handle hook ported from the official @x402/hono middleware. Point it at your routes in hooks.server.ts and your endpoints stay plain SvelteKit handlers.

Umpward,

James