Loomal

Monetize a PDF generation API for agents

Charge agents per document in USDC. Turn templates and data into polished PDFs and get paid for every render.

Agents produce documents all day: invoices, reports, contracts, certificates, statements. Rendering them well takes a real engine and a fonts-and-templates pipeline, and the agent wants to pay for each document it generates rather than license a platform.

Loomal lets your PDF service charge per render in USDC over x402. The agent sends a template and data, pays for the document, and gets back a finished file. Your render engine runs only on renders that have settled.

Charge for the document, not a license

Per-document pricing is clean for both sides: one render, one charge. An agent generating a single invoice pays for one invoice; an agent batching a thousand statements pays for a thousand renders.

You can price by complexity. A one-page receipt costs less than a multi-page report with charts, tables, and embedded assets, so heavy documents pay for the work they take.

Render after the payment clears

Wrap your render handler with requirePayment. The agent posts a template id and data, Loomal quotes the price and runs the x402 handshake, settlement clears on Base, and your engine returns the finished PDF.

route.ts
import { requirePayment } from "@loomal/sdk";

export const POST = requirePayment(
  { price: "$0.02" },
  async (req) => {
    const { template, data } = await req.json();
    return Response.json({ url: await renderPdf(template, data) });
  },
);

Get found by document agents

Your PDF service lists in the Loomal marketplace and the x402 discovery feed, with template types and output options in the listing. An agent that needs a rendered document finds your endpoint and pays per render with no setup.

Settlement is USDC on Base to a non-custodial wallet, and each render produces a signed receipt so every document you billed is provable.

FAQ

Can I charge more for longer documents?

Yes. Quote the price from page count or template complexity so a heavy report costs more than a single page.

Can agents bring their own templates?

That is up to you. Offer fixed templates, accept caller-supplied layouts, or both, and price each path as you like.

Do agents need an API key?

No. The x402 handshake pays and authenticates at once, so there are no keys to issue or rotate.

Start selling to agents.

Wrap an endpoint, set a price, get paid in USDC.

Get started