Public
x402-paywalled API wrapper around Radicle
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A pay-per-request HTTP wrapper around a Radicle seed node. Every /api/* route is gated by an x402 micropayment in USDC — clients (humans or AI agents) pay per call with no accounts or API keys.
Rendering mermaid diagram...
| Route | Description | Price |
|---|---|---|
GET / | Landing page | free |
GET /health | Health + configured seed | free |
GET /api/projects | List repos on the seed | $0.001 |
GET /api/projects/:rid | Repo metadata | $0.005 |
GET /api/projects/:rid/issues | Repo issues | $0.005 |
GET /api/projects/:rid/patches | Repo patches | $0.005 |
GET /api/projects/:rid/commits | Repo commits | $0.005 |
Set these environment variables in the Val Town UI:
PAY_TO_ADDRESS(required) — your0x…wallet that receives USDC. Until this is set, the paywall is disabled and/api/*returns503.X402_NETWORK— defaults tobase-sepolia(testnet). Usebasefor mainnet.FACILITATOR_URL— defaults tohttps://x402.org/facilitator. Use the Coinbase CDP facilitator for Base mainnet.RADICLE_SEED— the seed node API base. Defaults tohttps://seed.radicle.garden/api/v1.
Any x402-aware client works. With the TypeScript SDK:
import { wrapFetchWithPayment } from "x402-fetch";
import { createWalletClient, http } from "viem";
// ...build a wallet client, then:
const fetchWithPay = wrapFetchWithPayment(fetch, wallet);
const res = await fetchWithPay("https://<your-val>.web.val.run/api/projects");
A plain fetch (no payment) just returns 402 with the payment requirements in the PAYMENT-REQUIRED header.
main.ts— Hono app, x402 paywall middleware, route definitionsradicle.ts— thin client for the Radicle seed node HTTP APIlanding.html— landing page