Lotvs PayEarly access

For APIs, data and tools

Get paid by AI agents.

Put a price on any API route. Agents pay per request, in dollars, straight to your account.

One line of code. No accounts to create for your buyers. No invoices.

server.js
import { lotvsPay } from "@lotvs/pay";

app.get(
  "/report",
  lotvsPay({ price: "0.10" }),
  (req, res) => res.json(report)
);

How it works

One request, a price, a payment, an answer.

Agents cannot fill in a checkout form or wait for an API key by email. So the price travels with the response, and the payment travels with the next request.

  1. The agent

    Asks for something

    An ordinary request, nothing attached.

    GET /report
  2. Your API

    Answers with the price

    What it costs, and the address to pay.

    402 Payment Required PAYMENT-REQUIRED: $0.10 to you
  3. The agent

    Pays and asks again

    A signed payment for exactly that amount, good for this one request.

    GET /report PAYMENT-SIGNATURE: signed $0.10
  4. Your API

    Delivers, and gets paid

    Your code runs. The money lands at your address. The agent gets its answer and a receipt.

    200 OK PAYMENT-RESPONSE: paid, receipt attached

What you get

Built the way you would want a payment to work.

Your money never passes through us

Each payment goes from the agent's wallet straight to your address. There is no balance of yours sitting with us, and nothing to wait for or withdraw.

Your errors cost the buyer nothing

By default the payment is checked before your code runs and collected only after it succeeds. One case is not clean: if the facilitator never answers when asked to collect, the money may have moved while the answer is held back. The buyer is told not to pay again, and you are told to check.

One open standard: x402

Any agent or client that speaks x402, the open standard for paying over HTTP, can pay you. It is the only way to pay that is supported today. Your line names a price, not a protocol.

Priced in dollars, paid in dollars

You write the price in dollars and receive USDC, a digital dollar, one for one. Keep it, spend it, or send it to your bank from a Lotvs account.

Status

Early access. What is proven, and what is not yet.

Proven

@lotvs/pay 0.3.0 is on npm

Free under the MIT licence. Over a hundred tests run against a facilitator and an agent that live in memory, and every step up to settlement has been checked against the public facilitators, with a key that held no money.

Not yet

No payment has settled

Not on Solana and not on Base. The last step, the money arriving at a seller's address, is still to be seen. The first real cent is next.

The demo

Test money only

The live demo below is on Solana devnet, a test network. It asks for test dollars, which are worth nothing.

Who settles

Third parties, and no fee from us

Payments are checked and settled by public facilitators run by others: PayAI first, Dexter second, and the x402.org facilitator on Base Sepolia. Dexter refuses payments under its minimum, a fraction of a cent. Lotvs Pay charges sellers nothing: each payment goes whole to your address.

Live demo

Now watch it happen. This site charges a cent of test money for a fortune.

The same four steps, against a real route built with that one line. The first two run from your browser. The last two need a wallet, so they are shown, and then you can hand the whole thing to your agent.

pay.lotvs.ai/api/demo/fortune$0.01 a requestTest money
RequestReady
GET /api/demo/fortune HTTP/1.1
Host: pay.lotvs.ai

No payment, no key, no account. This is what any agent sends the first time it meets a paid route. Send it from your browser and see what comes back.

Now with a real agent

Steps three and four happen the moment something with a wallet asks. For now this demo is on Solana devnet, a test network, so it takes test dollars, not real ones.

Tell your agentFetch https://pay.lotvs.ai/api/demo/fortune. It asks for one cent of test USDC on Solana devnet, a test network. Pay it and show me what comes back.
Or look yourselfcurl -i https://pay.lotvs.ai/api/demo/fortune

Quickstart

From install to a priced route in minutes.

Set the address that gets paid in LOTVS_PAY_TO, wrap a route, deploy. It answers with its price straight away. To see a payment arrive you need a buyer that speaks x402 and holds USDC: there is no test buyer of our own yet.

Express
import express from "express";
import { lotvsPay } from "@lotvs/pay";

const app = express();

app.get("/report", lotvsPay({ price: "0.10" }), (req, res) => {
  res.json({ report: "Markets were open today." });
});

app.listen(3000);
Next.js
// app/api/report/route.ts
import { withLotvsPay } from "@lotvs/pay";

export const GET = withLotvsPay({ price: "0.10" }, async () => {
  return Response.json({ report: "Markets were open today." });
});

Documentation

The full documentation, on docs.lotvs.ai.

Any agent or client that speaks x402 and holds USDC can pay a route like these. In Lotvs, an agent does not pay on its own: it asks its owner, who approves. The x402 standard