llmcrawl

x402 payments

Let autonomous agents pay per request with USDC over HTTP.

llmcrawl supports the x402 payment protocol on the public /v1 REST endpoints. An agent can pay from a crypto wallet instead of creating an LLMCrawl account or API key.

Existing API keys and browser sessions keep working. Requests that contain Authorization, X-API-Key, or a session cookie use the normal authentication path; requests without those credentials receive HTTP 402 Payment Required with machine-readable payment instructions.

Whether x402 is available depends on the deployment — the hosted API and some self-hosted instances enable it. See Self-hosting if you run your own.

How the flow works

  1. You call a protected endpoint without API credentials.
  2. llmcrawl returns 402 and a base64-encoded PAYMENT-REQUIRED header describing the price and network.
  3. You sign the advertised exact EVM payment and retry with a PAYMENT-SIGNATURE header.
  4. The payment is verified before the request is served.
  5. llmcrawl settles payment only after a successful response and returns a PAYMENT-RESPONSE header with the receipt.

Your verified payer address acts as your identity: it owns any asynchronous crawls it starts and receives the same per-endpoint rate limits as an account, without the wallet ever being used as an API credential.

Pricing

Each operation is priced independently — scrapes, crawls, crawl status checks, crawl cancellations and map requests can have their own price. The amount and asset are always advertised in the 402 response, so buyers discover the price at request time rather than hardcoding it. Prices are denominated in USDC on Base (eip155:8453) or Base Sepolia (eip155:84532).

Buyer example

This example uses the official x402 fetch wrapper. A wallet with USDC and test funds on the chosen network is required.

npm install @x402/core @x402/evm @x402/fetch viem
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client().register("eip155:84532", new ExactEvmScheme(signer));
const fetchWithPayment = wrapFetchWithPayment(fetch, client);

const response = await fetchWithPayment("https://api.example.com/v1/scrape", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ url: "https://example.com", formats: ["markdown"] }),
});

console.log(response.status, await response.json());

Do not send an LLMCrawl Authorization or X-API-Key header on an x402 request; either credential intentionally selects the existing account authentication path instead of x402.

On this page