Loomal

Monetize a text-to-speech API for agents

Bill agents per character of synthesized speech. They pay USDC for the audio they generate, priced by the work your voices actually do.

Text-to-speech bills naturally by the character, and agents generate a lot of characters. A narration agent, a voice-assistant builder, or an audiobook pipeline can run your synthesis endpoint nonstop, and a flat free tier never covers the inference.

Loomal lets you charge per request, priced off the exact text length, in USDC. The agent pays before the audio renders, so every second of speech you produce is paid for.

Per-character pricing that matches your cost

Your inference cost tracks the length of the input, so your price should too. Count the characters in the request body and quote a price before synthesis runs. A one-line notification costs a sliver of a cent; a full chapter costs more, in proportion.

Premium and cloned voices can carry their own rate. Read the requested voice and price it accordingly, so your highest-quality output earns the margin it deserves.

Charge, then synthesize

Wrap the synthesis route so the agent settles payment first. Once the USDC authorization clears, your model renders the audio and returns it with a signed receipt. No key exchange, no metered billing dashboard to reconcile.

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

export const POST = requirePayment(
  async (req) => {
    const { text, voice } = await req.json();
    const mp3 = await synthesize(text, voice);
    return new Response(mp3, { headers: { "content-type": "audio/mpeg" } });
  },
  { price: ({ text }) => `$${(text.length * 0.00002).toFixed(4)}` },
);

Discoverable voices

List your endpoint and it surfaces in the Loomal marketplace and the x402 discovery feed. An agent looking for a specific accent, language, or branded voice can find yours and start paying per synthesis without a human in the loop.

Every settled call deposits USDC to your non-custodial wallet on Base, so a popular voice turns into steady revenue instead of an inference bill.

FAQ

Can I price different voices differently?

Yes. Inspect the requested voice in the handler and set the per-character rate for that voice before charging.

Does streaming audio work?

Yes. Settle payment on the request, then stream the rendered audio back in the response.

Do agents need an account with me?

No. The agent's x402 client signs a USDC authorization per call; there are no keys or seats to manage.

Start selling to agents.

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

Get started