Skip to content
Developer documentation

Make the first paid ToolRelay call.

ToolRelay exposes agent-useful web search and page extraction behind x402 payment gates. Install an x402 SDK, call a paid endpoint, and receive structured JSON or clean markdown with no API key account to manage.

01 / Quick start

Install an x402 client SDK.

ToolRelay does not issue API keys. Payment is authentication: send the request, let the x402 client satisfy the HTTP 402 challenge, and retry automatically with payment proof in the X-PAYMENT header.

Python

pip install x402 requests

JavaScript

npm install x402-fetch viem
  1. Configure a Base-compatible wallet with USDC for x402.
  2. Wrap your HTTP client with the x402 SDK for your language.
  3. Call POST /search for $0.003 USDC or POST /extract for $0.02 USDC.
02 / Code examples

Code examples

Search with Python

from x402.clients.requests import x402_requests

session = x402_requests()
response = session.post(
    "https://api.toolrelay.io/search",
    json={"query": "x402 protocol", "limit": 5},
)
print(response.json())

Search with JavaScript

import { wrapFetchWithPayment } from "x402-fetch";

const fetchWithPayment = wrapFetchWithPayment(fetch, walletClient);
const response = await fetchWithPayment("https://api.toolrelay.io/search", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ query: "x402 protocol", limit: 5 }),
});

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

Extract with Python

from x402.clients.requests import x402_requests

session = x402_requests()
response = session.post(
    "https://api.toolrelay.io/extract",
    json={
        "url": "https://example.com/article",
        "format": "markdown",
    },
)
print(response.json()["markdown"])

Extract with JavaScript

import { wrapFetchWithPayment } from "x402-fetch";

const fetchWithPayment = wrapFetchWithPayment(fetch, walletClient);
const response = await fetchWithPayment("https://api.toolrelay.io/extract", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    url: "https://example.com/article",
    format: "markdown",
  }),
});

console.log((await response.json()).markdown);

Need the full contract?

The repo API reference lists request and response schemas, pricing tiers, error codes, and rate-limit notes for the launch surface.