Loomal

Monetize a translation API for agents

Charge agents per job in USDC. Price by language pair and character count, get paid before the translation runs.

Agents handling multilingual workflows need translation on tap: a support reply in German, a product description in Japanese, a document localized into a dozen languages at once. Each request is short-lived and the agent wants to pay for that one job, not sign up for a tier.

Loomal lets your translation endpoint quote a price per job and collect USDC over x402 before any tokens are spent. The agent sends text and a target language, pays inline, and gets the translation back.

Price by length and language pair

Translation cost scales with characters and with how hard the language pair is. A short string between two high-resource languages is cheap; a long technical document into a low-resource language costs more. Per-job pricing lets you set the price from the actual payload.

Compute the price in your handler from the character count and the pair, then quote it. The agent sees a number tied to the real job, not a flat rate that under- or over-charges every time.

Quote per job, settle in one round trip

Wrap your translate handler with requirePayment and derive the price from the request body. Loomal returns the 402 with that amount, the agent signs a USDC authorization, and your model call runs only after settlement on Base.

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

export const POST = requirePayment(
  (req) => ({ price: priceFor(req.body.text, req.body.target) }),
  async (req) => {
    const { text, target } = await req.json();
    return Response.json({ translation: await translate(text, target) });
  },
);

Be the endpoint agents reach for

Your translation service lists in the Loomal marketplace and the x402 discovery feed, with your supported language pairs as part of the listing. Agents needing a specific pair can find you and pay per job without any setup.

Funds settle in USDC on Base to a non-custodial wallet, and each translated job carries a signed receipt for clean accounting.

FAQ

Can the price depend on the input length?

Yes. Compute the price from character count and language pair in your handler, and Loomal quotes that amount in the 402.

Do I have to support every language to list?

No. List only the pairs you serve well; agents filter the marketplace by the languages they need.

How do agents pay?

Through the x402 handshake with any compatible wallet or client. No account or API key on your side.

Start selling to agents.

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

Get started