Onchain data + execution for AI agents
2097 pay-per-call endpoints across 80 EVM chains, plus a 110,000-item contract catalog. Self-computed from raw chain — no API keys, no signup. Agents pay $0.01 in USDC per call over x402 on Base.
How it works
Every paid endpoint is a normal HTTPS GET. Call it with no payment and you get an HTTP 402 carrying the exact x402 terms (price, asset = USDC, network = Base, payTo). Your agent signs a USDC payment on Base and retries with the payment header to receive the JSON. No accounts, no keys.
Explore everything free first: /openapi.json · /llms.txt · /.well-known/x402 · /catalog · /sample
Quickstart
curl — see the 402, then the terms
curl -i "https://getbasalt.xyz/scan?token=0x4200000000000000000000000000000000000006"
# -> HTTP 402 Payment Required, with the x402 terms in the PAYMENT-REQUIRED header.
JavaScript / TypeScript (auto-pays)
npm i x402-fetch viem
import { wrapFetchWithPayment } from "x402-fetch";
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const wallet = createWalletClient({ account, chain: base, transport: http() });
const fetchPaid = wrapFetchWithPayment(fetch, wallet); // signs + retries the 402
const r = await fetchPaid("https://getbasalt.xyz/scan?token=0xYOURTOKEN");
console.log(await r.json());
// same on any of 80 chains: /{chain}/{endpoint}
await fetchPaid("https://getbasalt.xyz/arbitrum/token?token=0xYOURTOKEN");
Python (auto-pays)
pip install x402 httpx eth-account
import os, httpx
from eth_account import Account
from x402.clients.httpx import x402_payment_hooks
account = Account.from_key(os.environ["AGENT_PRIVATE_KEY"]) # holds USDC on Base
client = httpx.Client()
client.event_hooks = x402_payment_hooks(account) # signs + retries the 402
r = client.get("https://getbasalt.xyz/scan", params={"token": "0xYOURTOKEN"})
print(r.json())
Wallet needs a little USDC on Base. Using Claude / an MCP agent with the Coinbase Agentic Wallet? It can already auto-pay x402 — just have it GET Basalt endpoints starting from /llms.txt.
What you can call
| Token safety | honeypot / sellable, buy-sell tax, owner, liquidity — /scan?token= · /{chain}/token?token= |
| Prices | manipulation-resistant TWAP + spot deviation — /price?token= |
| Gas & cost | EIP-1559 oracle + USD tx cost — /gas · /txcost |
| DeFi positions | Aave health factor, Uniswap v3 LP, ERC-4626 — /lending · /position · /vault |
| Contract x-ray | bytecode, proxy (EIP-1967), opcodes — /code?address= · /{chain}/code?address= |
| Decode / batch / simulate | /decode?data= · /multicall · /simulate |
| Intel | token / NFT / contract / Safe / address — /token · /nft · /safe · /address |
| Catalog | browse 110,000+ pre-indexed contracts — /catalog?offset=&limit= |
Full machine-readable list with params + schemas: /openapi.json.
Multichain
The chain-agnostic endpoints work on every supported chain at /{chain}/{endpoint}. 80 chains:
baseethereumarbitrumoptimismpolygonbnbavalanchescrolllineaceloblastmodemantleunichainsonicberachainseignosisfantom+ 61 more
Payment
x402 v2 · USDC on Base mainnet (chain 8453) · $0.01 per call · no API keys. Pay the payTo address from the 402 challenge. Any x402 client works; payments settle through the Coinbase CDP or xpay facilitator.