Getting Started
SDK and MCP server
Coming soon: check an x402 endpoint with Labs before your agent pays it, with local spend caps. One wrap around fetch, or one MCP tool.
@lmxlabs/sdk checks an x402 endpoint with Labs before your agent pays it, and keeps local spend caps. One wrap, no key, no account. Until it ships, the free Lookup API gives the same answer in one HTTP call.
import { wrapFetchWithPayment } from "@x402/fetch";
import { withLabs } from "@lmxlabs/sdk";
// Wrap the fetch your payment wrapper calls, so Labs sees each 402 before it is paid.
const pay = wrapFetchWithPayment(withLabs(fetch), client);
const response = await pay("https://api.seller.com/v1/endpoint");What it does by default
- Looks the endpoint up with Labs before payment: one GET, a 1 second timeout, cached for an hour.
- Warns, without blocking, when Labs has a failed paid check on file or saw the endpoint ask to be paid at a different address than its listing.
- Warns when Labs' last health check saw the endpoint down, gone, or with a broken paywall, and when the price changed since the last call.
- Pays as normal in every other case, including when Labs doesn't answer.
Options
withLabs(fetch, {
precheck: "warn", // "off" | "warn" | "block" | "strict"
caps: {
perCallUsd: 0.10, // most one call may cost
perSellerDailyUsd: 2, // most one pay-to address may get per UTC day
dailyUsd: 10, // most all calls may cost per UTC day
allowHosts: ["*.trusted.dev"],
denyHosts: ["untrusted.dev"],
},
priceChange: "warn", // "off" | "warn" | "block"
});blockrefuses only on a confirmed failed check or a pay-to address that differs from the listing.strictfails closed: it pays only after a passed check, or a health check that saw the paywall up.- A refused call throws
LabsBlockedErrorbefore anything is signed. - Caps hold a call's price as soon as its 402 is approved, so parallel calls can't pass a cap together. A payment refused with another 402 isn't retried for 10 minutes.
Use @x402/fetch 2.23.0 or later. Its own $1 per-payment limit stays on, and the SDK's caps apply first.
MCP server
@lmxlabs/mcp gives an agent one read-only tool, check_x402_endpoint. It returns what Labs knows about an endpoint (verdict, level, last health check, who it asked to be paid) in text and JSON. It never pays or signs anything.
What leaves your machine
One lookup per endpoint per hour, with your platform name and a random install ID kept in ~/.lmx-labs/install-id. Pass installId: false to send none. The SDK never signs, never holds funds, and never sends request or response bodies, headers, wallet addresses or transaction hashes. With precheck: "off" it makes no network calls of its own.
Want it early, or building a platform that should embed it? Write to support@lmxlabs.app.
Next
Dispute evidence
How a Labs evidence record can support a dispute over a paid call, and what it can't prove alone.