x402 · Base · USDC / USDT · from $0.005 / request

Agent Margin Router Data infrastructure for autonomous AI agents

Web search & extraction, PDF text, SEO, e-mail & DNS checks, market data, gas fees, DeFi yields, wallet balances and more — 50 endpoints routed across multiple providers and paid with x402 micropayments in USDC or USDT on Base. No API keys, no invoices, no accounts — just HTTP and a wallet.

$0.005+per request
3 freerequests / wallet
50endpoints
terminal — first call, free tier
$ curl -X POST
https://agent-margin-router-production.railway.app/market-spread
-H "Content-Type: application/json"
-H "X-WALLET: 0xYourAgentWallet"
-d '{"asset": "ETH", "buy_venue": "binance", "sell_venue": "coinbase"}'
# 3 free calls / wallet — no payment required

How it works

Three HTTP round-trips. Zero onboarding.

x402 turns the HTTP 402 status code into a machine-native payment rail. Your agent never leaves the request loop.

01

Request

Your agent calls an endpoint over plain HTTPS with a JSON body. No signup, no API key.

POST /extract-clean
02

x402 Payment

The API answers 402 with exact payment terms. The agent signs a $0.005–$0.05 USDC or USDT transfer on Base and retries with the X-PAYMENT header.

402 → X-PAYMENT: <payload>
03

Data Response

The facilitator verifies the payment, the router picks the healthiest provider and returns strict JSON — with provenance and billing metadata.

200 OK · application/json

Free tier: 3 requests per wallet — no payment required

Identify your agent with an X-WALLET: 0x... header and the first 3 calls skip the 402 step entirely. Once exhausted, the API switches to pay-per-use from $0.005 per request. Perfect for integration tests and CI.

Read the auth flow

Endpoints

50 endpoints. From $0.005.

Per-endpoint pricing from $0.005 to $0.05. HTTP schemas and prices synchronized with router 0.6.0; examples are documentation samples, not live market readings.

/extract-clean
$0.02

Web Extraction

Clean page extraction from any public URL: title, meta description, main text, JSON-LD, language. Optional `schema` keeps only the listed top-level keys. Apify (JS-rendered) with direct-fetch fallback.

POSTMCP: extract_clean
/web-search
$0.02

Web Search

Live web search results (title, URL, domain, snippet) for any query, key-less, region-aware.

POSTMCP: web_search
/pdf-text
$0.02

PDF Text Extraction

Extract clean text (per page + full) and metadata from any public PDF URL up to 25 MB / 200 pages.

POSTMCP: pdf_text
/seo-check
$0.01

SEO Check

On-page SEO audit of any URL: title, meta description, canonical, headings, images without alt, links, Open Graph, structured data, robots.txt/sitemap, prioritized issues and a 0-100 score with grade.

POSTMCP: seo_check
/rss-feed
$0.01

RSS / Atom Feed → JSON

Fetch and parse any RSS 2.0 or Atom feed into clean JSON: title, link, published date, author, summary, optional full text content and categories per item.

POSTMCP: rss_feed
/html-to-markdown
$0.01

HTML → Markdown

Convert any public web page into clean, LLM-ready Markdown: main content only (boilerplate, nav and ads removed), headings, lists, tables and optional links/images preserved. Trafilatura extraction with markdownify fallback, SSRF-guarded fetch, up to 3 MB HTML.

POSTMCP: html_to_markdown
/url-status
$0.005

URL Status & SSL

Health check for any public URL: HTTP status, full redirect chain, response time, content type, SSL certificate validity/expiry/issuer and a security-header audit (HSTS, CSP, X-Frame-Options, …) with score. SSRF-guarded (private/internal targets are rejected).

POSTMCP: url_status
/web-crawl
$0.05

Web Crawl

Mini crawler: fetches a start page and follows same-domain links breadth-first (max 10 pages), returning clean LLM-ready Markdown, title, word count and discovered links per page; honours robots.txt by default. SSRF-guarded.

POSTMCP: web_crawl
/metadata
$0.005

Page Metadata

Structured metadata for any public page: title, meta description/keywords, canonical URL, HTML lang, charset, favicon, and the full OpenGraph + Twitter-Card tag sets. Ideal for link previews and agent research. SSRF-guarded.

POSTMCP: metadata
/sitemap-urls
$0.01

Sitemap URLs

Parse a sitemap into the real URL list: accepts a direct sitemap.xml, a sitemapindex (recursed, bounded) or a site root. Returns each URL with lastmod, changefreq and priority. SSRF-guarded.

POSTMCP: sitemap_urls
/robots-check
$0.005

Robots.txt Check

Answer 'may this user-agent crawl this URL?' by fetching and parsing the site's robots.txt: allowed flag, crawl-delay, request-rate and declared sitemaps.

POSTMCP: robots_check
/feed-discover
$0.005

Feed Discover

Find the RSS/Atom feed URLs for a website from its HTML link tags, with a common-path fallback (/feed, /rss.xml, ...).

POSTMCP: feed_discover
/market-spread
$0.05

Cross-exchange Spread

Cross-exchange crypto spread from live tickers: gross spread, fees, modelled slippage, transfer cost and net edge in bps for a given trade size. Ticker/volume based (no full order book).

POSTMCP: market_spread
/token-price
$0.01

Token Price (multi-venue)

Multi-venue median spot price for any major crypto asset (Binance, Coinbase, Kraken, CoinGecko) with min/max, deviation and confidence score – one call instead of four. No API key.

POSTMCP: token_price
/currency-convert
$0.005

Currency Conversion (ECB)

Fiat currency conversion with ECB reference rates (30+ currencies): amount, source currency, one or many targets. Returns rates, converted amounts and rate date.

POSTMCP: currency_convert
/crypto-ohlcv
$0.005

Crypto OHLCV Candles

Historical OHLCV candles for any major crypto pair (Binance, Coinbase fallback): intervals 1m-1w, up to 500 candles, with period summary (high, low, volume, change %).

POSTMCP: crypto_ohlcv
/dex-price
$0.01

DEX Token Price

Live DEX price, 24h change, volume and liquidity for any on-chain token (long-tail tokens not listed on CEXs) by contract address or symbol on Base, Ethereum, Arbitrum, Optimism, Polygon, BSC, Avalanche or Solana, with the top liquidity pairs per DEX (DexScreener).

POSTMCP: dex_price
/fear-greed
$0.005

Crypto Fear & Greed Index

Crypto market sentiment: the daily Fear & Greed index (0-100) with classification, 1d/7d change and up to 90 days of history from alternative.me.

POSTMCP: fear_greed
/best-price
$0.005

Best-Price Gas Routing

Best-price router: queries several independent gas-price sources in parallel, returns the cheapest quote and charges a configurable share of the savings (average - best) as commission. Response includes the full breakdown (best_price, average_price, savings_gross, provision, user_pays) for Base, Ethereum, Arbitrum, Optimism and Polygon. No API key.

POSTMCP: best_price
/weather
$0.01

Weather

Current conditions plus a daily forecast (up to 16 days) for any place name or lat/lon via Open-Meteo (key-less); temperature in C or F, cached 30 min.

POSTMCP: weather
/holidays
$0.005

Public Holidays

Official public holidays for a country and year via Nager.Date: date, local + English name, whether it is nationwide, and sub-region counties.

POSTMCP: holidays
/timezone
$0.005

Timezone & Local Time

Current local time, UTC offset, DST status and abbreviation for any IANA timezone, or resolve a place name to its timezone and local time.

POSTMCP: timezone
/gas-fees
$0.005

Gas Fees (EIP-1559)

Live EIP-1559 gas fees (slow/standard/fast tiers) plus USD cost per transaction type (transfer, ERC-20 transfer, swap, NFT mint) for Base, Ethereum, Arbitrum, Optimism and Polygon. Aggregated from public RPC nodes – no API key.

POSTMCP: gas_fees
/wallet-balance
$0.01

Wallet Balance

Native + stablecoin balances (ETH, USDC, USDT, DAI, WETH) of any EVM wallet with USD valuation, read directly from public RPC nodes on Base, Ethereum, Arbitrum, Optimism or Polygon. No API key.

POSTMCP: wallet_balance
/ens-resolve
$0.01

ENS Resolver

Resolve an ENS name to its Ethereum address plus text records (url, com.twitter, avatar, ...) via on-chain calls.

POSTMCP: ens_resolve
/tx-status
$0.01

Transaction Status

Status of any EVM transaction on Base, Ethereum, BSC, Polygon, Arbitrum or Optimism: success/failed/pending, block number, confirmations, gas used, effective gas price, fee, from/to/value and all ERC-20 Transfer events decoded from the receipt logs (contract, symbol, decimals, amount). Public JSON-RPC nodes with fallback.

POSTMCP: tx_status
/erc20-balance
$0.01

ERC-20 Balances

Balances of up to 20 arbitrary ERC-20 tokens for one wallet in a single Multicall3 round-trip: raw and decimal-formatted balance, decimals and symbol per token, on Base, Ethereum, BSC, Polygon, Arbitrum or Optimism.

POSTMCP: erc20_balance
/agent-wallet-snapshot
$0.02

Agent Wallet Snapshot

One-call wallet overview for autonomous agents: native balance, ERC-20 balances (default stablecoins + WETH, or any contracts you pass), current gas price, tx count, contract check and USD values incl. total – bundles what would otherwise be 5+ RPC calls. Base, Ethereum, BSC, Polygon, Arbitrum, Optimism.

POSTMCP: agent_wallet_snapshot
/contract-info
$0.02

Smart Contract Info

Smart-contract metadata from Blockscout for Base, Ethereum, Optimism or Arbitrum: verification status, name, compiler, proxy/implementation, creator, creation tx, token details and function/event names.

POSTMCP: contract_info
/defi-yields
$0.02

DeFi Yields

Live DeFi pool yields (APY, TVL, stablecoin flag) across 100+ chains and protocols from DefiLlama. Filter by chain, asset, project, minimum TVL; sorted by APY.

POSTMCP: defi_yields
/defi-tvl
$0.005

DeFi TVL

Total value locked of a DeFi protocol (by DefiLlama slug: TVL, 1d/7d change, market cap, mcap/TVL ratio, TVL per chain, category) or of a whole chain (TVL, native token, protocol count, top-10 protocols).

POSTMCP: defi_tvl
/email-validate
$0.01

Email Validation

Validate an email address: RFC syntax, MX/A records via DNS-over-HTTPS, disposable and free-provider detection, role-account flag, deliverability score and verdict.

POSTMCP: email_validate
/dns-whois
$0.005

DNS + WHOIS (RDAP)

DNS records (A, AAAA, MX, NS, TXT, CNAME, SOA, CAA) via DNS-over-HTTPS plus RDAP/WHOIS registration data (registrar, created/expires, status, nameservers, DNSSEC).

POSTMCP: dns_whois
/geo-ip
$0.005

Geo-IP Lookup

IP geolocation for IPv4/IPv6: country, region, city, coordinates, timezone, ASN, ISP/org, EU flag, private-range detection.

POSTMCP: geo_ip
/domain-rdap
$0.01

Domain RDAP / WHOIS

Domain registration data via RDAP (the WHOIS successor): registered flag, registrar, status, registration/expiry events, nameservers and DNSSEC – for availability checks and due diligence.

POSTMCP: domain_rdap
/dns-lookup
$0.005

DNS Lookup

Resolve any DNS record type (A, AAAA, CNAME, MX, NS, TXT, SOA, SRV, CAA, PTR) over DNS-over-HTTPS with TTLs and DNSSEC validation flag.

POSTMCP: dns_lookup
/geocode
$0.01

Geocoding

Turn a place name or address into coordinates, bounding box, address parts and OSM type using OpenStreetMap Nominatim (ODbL); cached 24h.

POSTMCP: geocode
/github-repo-summary
$0.01

GitHub Repo Summary

One-call overview of any public GitHub repository: description, stars, forks, open issues, primary language and language split (%), topics, license, default branch, README excerpt and the 5 most recent commits.

POSTMCP: github_repo_summary
/npm-package
$0.005

npm Package Info

npm package intelligence: latest version, license, repository, maintainers, dependency count, publish dates and weekly downloads – ideal for dependency vetting by coding agents.

POSTMCP: npm_package
/pypi-package
$0.005

PyPI Package Info

PyPI project intelligence: latest version, summary, license, author, project URLs, Python requirement, declared dependencies, release count and last release date.

POSTMCP: pypi_package
/text-stats
$0.005

Text Stats

Readability and text statistics for raw text or a fetched page: word/sentence/syllable counts, Flesch Reading Ease, Flesch-Kincaid grade, and reading/speaking time.

POSTMCP: text_stats
/qr-generate
$0.005

QR Code Generator

Generate a QR code from any text or URL and return it as a scalable SVG image plus a data-URI. Key-less, no third-party service.

POSTMCP: qr_generate
/uuid
$0.002

UUID Generator

Generate one or more RFC 4122 UUIDs (random v4, or deterministic v5 from a namespace and name). Key-less, local generation.

POSTMCP: uuid
/hash
$0.002

Hash Generator

Compute cryptographic hash digests (MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512) of any text. Key-less, local computation.

POSTMCP: hash
/news-search
$0.02

News Search

Global news article search across 65+ languages via the GDELT DOC 2.0 API: title, URL, source domain, publication time, language and country per article, with look-back window (e.g. 24h, 7d) and language filter.

POSTMCP: news_search
/hn-search
$0.01

Hacker News Search

Search Hacker News stories and comments via the Algolia HN API: title, URL, author, points, comment count, timestamp and HN discussion link; sort by relevance or date, optional tag filter (story, comment, ask_hn, show_hn).

POSTMCP: hn_search
/reddit-search
$0.01

Reddit Search

Search Reddit posts site-wide or within one subreddit: title, URL, subreddit, author, score, upvote ratio, comment count, timestamp and the first 500 characters of the post text; sort by relevance, hot, new, top or comments with a time filter.

POSTMCP: reddit_search
/wikipedia-summary
$0.005

Wikipedia Summary

Clean article summary from Wikipedia in any language: title, short description, extract (capped), canonical URL, thumbnail and coordinates; falls back to search when the title is fuzzy. Content CC BY-SA 4.0.

POSTMCP: wikipedia_summary
/arxiv-search
$0.01

arXiv Paper Search

Search arXiv preprints: returns id, title, authors, abstract, categories, published/updated dates and PDF links, sortable by relevance or date, optionally filtered by category (e.g. cs.AI).

POSTMCP: arxiv_search
/youtube-transcript
$0.02

YouTube Transcript

Fetch the transcript of a YouTube video (manual or auto-generated captions) as timestamped segments plus full text, with language preference and English fallback. Accepts a video id or any YouTube URL. No API key, no download.

POSTMCP: youtube_transcript

Python SDK

Call every endpoint in three lines of Python

The official agent-margin-router package ships one typed method per endpoint, full type hints and a single dependency. Install it and make your first free call in under a minute.

install
$ pip install agent-margin-router

Also available

  • LangChain toolpip install langchain-agent-margin-router
  • n8n community nodenpm i n8n-nodes-agent-margin-router

New in v0.2 — opt-in auto_pay settles HTTP 402 responses automatically via EIP-3009, so your agent keeps calling past the free tier without extra plumbing.

50
typed methods
1
dependency (httpx)
3.9+
Python
quickstart.py
from agent_margin_router import Client

# 3 free calls per wallet — no signup, no key.
client = Client(wallet="0xYourAgentWallet")

price = client.token_price(asset="ETH")
print(price["price"])       # median across venues
print(price["cost_usdc"])   # 0 while on the free tier

# 50 typed methods — one per endpoint.
spread = client.market_spread(
    asset="ETH", buy_venue="binance", sell_venue="coinbase",
)

Provider Routing

Multi-provider by design

Every request is routed to the healthiest provider based on live health checks, latency and cost. Fallbacks are automatic and transparent.

Multi-provider routing

Every request is routed to the healthiest provider based on live health checks, latency and cost.

Automatic fallbacks

If a provider fails, the router retries on the next-best alternative — transparent to the caller.

Health monitoring

Continuous health checks run in the background. Unhealthy providers are automatically de-prioritized.

Response caching

Frequently requested data is cached to reduce latency and cost. Cache TTLs are endpoint-specific.

Pricing

Start free. Scale with a plan.

Three free x402 calls per wallet, flexible pay-per-use, or a monthly subscription in USD via Stripe.

Free

$0/mo

3 requests

x402 free tier — try it instantly

  • 3 free requests per wallet
  • All 50 endpoints
  • No signup required
Start Building

Micro

$9/mo

50,000 requests

For prototypes and MVPs

  • All 50 endpoints
  • 50,000 API requests/mo
  • Usage dashboard
  • Email support
Subscribe
Most Popular

Startup

$49/mo

500,000 requests

For production workloads

  • All 50 endpoints
  • 500,000 API requests/mo
  • Priority routing
  • Email support
  • Usage analytics
Subscribe

Pro

$199/mo

Unlimited + SLA

For enterprise agents

  • All 50 endpoints
  • Unlimited requests
  • Dedicated routing
  • SLA guarantee
  • Priority support
Subscribe
Still available: x402 pay-per-use

No subscription needed. Every endpoint accepts x402 micropayments (from $0.005 per call in USDC or USDT on Base). The free tier and subscriptions are layered on top.