Skip to content
AgentSearch

AgentSearch Now Speaks Native x402 on Base

Update, November 10, 2026. A fourth endpoint is live: Search + Read at POST /x402/v1/search_and_read for $0.015 — search plus the top pages' markdown in one payment, versus $0.029 a la carte, and one payment instead of four. Charged only when at least one page has text. Docs: #search-and-read. Changelog: Search and read in one paid call.

AgentSearch now answers x402 directly. Its three web tools for AI agents, Web Search, Web Extract and Web Render, have their own pay-per-call endpoints on Base mainnet at https://api.agentsearchhq.com. Any x402 client can call them with a wallet holding a little USDC. There is no account, no API key, no portal in between, and nothing to sign up for.

This post covers what launched, what it costs, and how to call it from curl, TypeScript and Python. Full reference: AgentSearch x402 API docs.

What launched

  • Four POST endpoints as of November 10 (Search, Extract, Render, and Search + Read), each a standard x402 v2 resource using the exact scheme with USDC on Base (eip155:8453).
  • Settlement through the Coinbase CDP facilitator. The facilitator pays gas, so your wallet needs no ETH.
  • Discovery built in. Every 402 carries x402 Bazaar metadata (input and output schemas plus examples), and the API publishes /.well-known/x402 and /openapi.json, so agents and x402 directories can find the tools and price them without reading this page.
  • Payment only after a good answer. Invalid input (400), upstream failures (502) and empty results are never settled, so a failed call costs nothing.
ToolEndpointBodyPrice (USDC on Base)
Web SearchPOST /x402/v1/search{"query", "max_results" 1-10}$0.008
Web ExtractPOST /x402/v1/extract{"url"}$0.007
Web RenderPOST /x402/v1/render{"url"}$0.010
Search + ReadPOST /x402/v1/search_and_read{"query", "num_results" 1-5}$0.015

A typical research step (one search, then two page reads) costs $0.022. A dollar of USDC covers 125 searches or about 140 extracts. Current prices and the free options are on the pricing page.

See the price for free with curl

An unpaid request is free. It returns 402 Payment Required with the terms in the PAYMENT-REQUIRED header (base64 JSON):

curl -s -D - -o /dev/null https://api.agentsearchhq.com/x402/v1/search \
  -H 'content-type: application/json' -d '{"query":"x402"}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 -d | python3 -m json.tool

You will see scheme: exact, network: eip155:8453, amount: 8000 (USDC has 6 decimals, so 8000 is $0.008), the USDC contract and the payee. Your x402 client signs an EIP-3009 authorization for exactly that amount and retries the request.

Pay per call from TypeScript with @x402/fetch

// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A new wallet holding a little USDC on Base. No ETH needed.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await fetchWithPayment("https://api.agentsearchhq.com/x402/v1/extract", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ url: "https://example.com" }),
});
console.log(res.status, await res.json()); // 200 + markdown; receipt in PAYMENT-RESPONSE

If you use axios, @x402/axios works the same way. There is an example in the docs.

Pay per call from Python

# pip install "x402[httpx,evm]" eth-account
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact import register_exact_evm_client
from x402.http.clients import x402HttpxClient

async def main():
    account = Account.from_key(os.environ["WALLET_PRIVATE_KEY"])  # small, dedicated wallet
    client = x402Client()
    register_exact_evm_client(client, EthAccountSigner(account))
    async with x402HttpxClient(client, timeout=60) as http:
        r = await http.post("https://api.agentsearchhq.com/x402/v1/search",
                            json={"query": "x402 payments", "max_results": 5})
        print(r.status_code, [x["url"] for x in r.json()["results"]])

asyncio.run(main())

Already using an AgentSearch package? Direct is now the default

Update Nov 9, 2026: from MCP 1.6.0, LangChain 0.5.0 and n8n 0.5.0, a wallet key pays the direct API by default (search $0.008, extract $0.007, render $0.010). To keep the Pocket route at $0.005 per call, set AGENTSEARCH_PAYMENT_ROUTE=pocket (n8n: Payment Route "Pocket Portal"). The opt-in switches below still work in the earlier versions.

  • MCP server (@agentsearchhq/agentsearch-mcp 1.6.0+: direct by default; 1.5.0: set AGENTSEARCH_X402_DIRECT=1) next to AGENTSEARCH_WALLET_PRIVATE_KEY. Extract and Render then pay the direct API. Search does too if you also set AGENTSEARCH_MODE=paid.
  • LangChain (langchain-agentsearch 0.5.0+: direct by default; 0.4.0: set AGENTSEARCH_X402_DIRECT=1): install langchain-agentsearch[paid] and set the wallet key.
  • n8n (n8n-nodes-agentsearch 0.5.0+: Payment Route defaults to AgentSearch Direct x402 on the AgentSearch Wallet API credential; in 0.4.0 pick it by hand).

Each package signs only the exact scheme, only USDC on Base, and only to AgentSearch's payee. It caps each direct call at $0.010 and enforces a session spend cap.

Direct x402 or Pocket?

The same tools are still on the Pocket Network Agentic Portal at $0.005 per call, with extra options such as Render screenshots and output formats, and the packages keep it selectable with AGENTSEARCH_PAYMENT_ROUTE=pocket. Choose direct when you want a plain x402 resource that any client, directory or Bazaar-aware agent can use, with AgentSearch as the merchant. The free search tier (up to 25 searches a day per IP) and the small Extract/Render trial don't change either.

Wallet checklist

  • Use a new wallet that exists only for this, and fund it with a few dollars of USDC on Base. The wallet setup guide takes about two minutes.
  • Keep the key in an environment variable or secret store, never in code or prompts.
  • Set a spend cap in your client. The AgentSearch packages default to $1.00 per session.
  • Each paid response returns a PAYMENT-RESPONSE header with the settlement transaction, so you can audit every call on Basescan.

FAQ

Do I need an API key or an account?

No. The x402 payment is the authorization. An unpaid request gets a 402 with the price, and a paid retry gets the result.

Which network and token?

Base mainnet (eip155:8453), native USDC (0x8335…2913), using the x402 exact scheme with EIP-3009 authorizations. No ETH is needed for gas.

Am I charged when a call fails?

No. The API settles only after it has a successful, non-empty answer. Invalid input, upstream failures and empty results leave your authorization unused.

How do agents discover it?

Through the x402 Bazaar metadata on every 402, /.well-known/x402, /openapi.json, and x402 directories such as x402scan.

Get started

Run the curl command above to see a live 402 for free, then pick a client. The x402 API docs have every example and the response shapes, and the pricing page compares direct, Pocket and free.

More from the blog

Service pages: Web Search API · Web Extract API · Web Render API