LOOMAL

Loomal

The payments layer for AI agents — sellers charge per call in USDC, settled on Base, with a signed receipt back. Five lines of middleware.

The payments layer for AI agents. You operate a paid HTTP endpoint or MCP tool; Loomal lets any paying agent (or human) call it — five lines of middleware, USDC settles on Base, signed receipt back.

New here? Start with Introduction for the vocabulary, then ship a paid endpoint below.

Building the agent side — wallet, inbox, vault, calendar, DID? That moved to Mailgent.


Accept payments

You're shipping a paid API or MCP tool. The middleware handles the x402 dance: serve a 402 challenge, verify the agent's signed USDC authorization, settle on-chain, return an Ed25519 receipt.

1. Create a project at console.loomal.ai. Flip Pay → Accept on. Copy the API key (loid-...).

2. Install and wrap a handler:

npm install @loomal/sdk express
server.ts
import express from "express";
import { Loomal } from "@loomal/sdk";
import { requirePayment } from "@loomal/sdk/paywall/express";

const app = express();
app.set("trust proxy", true);

const loomal = new Loomal({ apiKey: process.env.LOOMAL_API_KEY! });

app.get(
  "/search",
  requirePayment({ amount: "0.05" }),
  (req, res) => res.json({ results: [/* ... */] }),
);

app.listen(3030);

Run with LOOMAL_API_KEY=loid-.... That's the whole integration.

Same shape on Hono, FastAPI, and MCP — only the middleware import changes. For frameworks without shipped middleware (Fastify, NestJS, Next.js, raw Node), call loomal.payments.challenge and loomal.payments.redeem from your handler directly.


More

On this page