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())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.
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.
pip install x402 requests
npm install x402-fetch viem
POST /search for $0.003 USDC or POST /extract for $0.02 USDC.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())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());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"])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);The repo API reference lists request and response schemas, pricing tiers, error codes, and rate-limit notes for the launch surface.