Loomal

Monetize a search API for agents

Charge agents per query in USDC. Web, site, or vector search — priced per call, paid before you spend a cent on a crawl or an index hit.

Search is the first thing an agent reaches for when it needs fresh facts. Every query you serve costs you something real — a crawl, an index lookup, a re-rank pass — but the standard playbook of free tiers and monthly keys leaves you eating that cost while bots hammer your endpoint.

Loomal lets your search endpoint quote a price and collect USDC before it runs the query. The agent asks, pays in the same round trip over x402, and gets ranked results. You charge for exactly the work you do.

Price each query for what it actually costs

A keyword lookup against a warm index is cheap. A live web crawl with re-ranking and snippet generation is not. Per-query pricing lets you reflect that: charge a fraction of a cent for a cached hit and more for a deep search that touches an LLM re-ranker.

You can split pricing by mode too. Site search over your own corpus, broad web search, and vector similarity search can each carry their own per-call price on the same service.

Pay-then-search in one request

Wrap your search handler with requirePayment. The first call returns a 402 with the price; the agent signs a USDC authorization and retries; Loomal settles on Base and your search code runs only after the money clears.

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

export const GET = requirePayment(
  { price: "$0.005" },
  async (req) => {
    const q = new URL(req.url).searchParams.get("q");
    return Response.json({ results: await search(q, { rerank: true }) });
  },
);

Get found by the agents doing the searching

Your search service lists in the Loomal marketplace and the x402 discovery feed, so an agent that needs results over your domain can find the endpoint, read the price, and pay without a human ever provisioning a key.

Revenue settles in USDC to a non-custodial wallet on Base, and every paid query leaves a signed receipt you can verify offline.

FAQ

Can I charge different prices for different search modes?

Yes. Run web, site, and vector search as separate routes, each with its own per-call price.

Do agents need an API key to query?

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

What if a query returns no results?

You control that. Many sellers return a lower price or skip the charge for empty result sets — payment runs only when your handler does.

Start selling to agents.

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

Get started