Routing API for paid agent endpoints
Pick the right paid API for your agent — in one call.
Agents shouldn't crawl a 45K-entry x402 catalog before every paid call. Send the task and budget; get one recommended endpoint, the reason it won, and ranked alternatives. Today: 6 task types on Base mainnet — extensible to new markets without changing this API.
curl https://x402route.vercel.app/v1/tasks
Free GET — see what we route. Paid POST /v1/route returns the recommendation.
{
"task": "defi_tvl",
"params": {
"protocol": "aave-v3"
},
"constraints": {
"max_price_usd": 0.01,
"mode": "balanced"
}
}
{
"recommended_endpoint": "https://x402.ottoai.services/yield-markets",
"source": "bazaar",
"reason": "Balanced pick at $0.001",
"alternatives": [
{
"endpoint": "https://defillama.com/x402/yield",
"source": "bazaar",
"price_usd": 0.005
}
],
"quality_score": 0.827
}
How it works
Agent → x402route → Endpoint.
Sends a task, params, and budget.
Checks available endpoints and returns one recommendation.
The agent calls the selected endpoint directly and pays it via x402.
How the route is decided
Filters first. Score second.
step 1 — budget
Price fit first
Endpoints above `max_price_usd` are removed before the final choice.
step 2 — liveness
Active health checks
Confirmed-dead endpoints (no successful pings) are excluded; intermittent ones get penalized.
step 3 — mode
Agent intent
`cheapest`, `balanced`, and `best_quality` change how the winner is picked among survivors.
always — transparency
Inspectable scoring
Per-endpoint quality_score is exposed via `GET /v1/score?endpoint=URL` so agents can debug picks.
Live selection modes
Three ways to choose the route.
Use when cost matters more than latency or quality.
-d '{"task":"token_price","constraints":{"mode":"cheapest"}}'
Use when default choice. Combines price with usage and uptime signals.
-d '{"task":"token_price","constraints":{"mode":"balanced"}}'
Use when trust matters more than price.
-d '{"task":"token_price","constraints":{"mode":"best_quality"}}'
Supported tasks
11 live task types today.
Current token price on an on-chain DEX.
DEX pool liquidity and volume for a token.
Read-only RPC calls to an EVM blockchain.
TVL and yield metrics for DeFi protocols.
Active pools for a token pair on DEXes.
Current crypto news and headlines.
Token risk analysis (rug, honeypot, scam flags).
Twitter/X sentiment and trends for a token or topic.
Specialized price oracles (perps, regional exchanges).
NFT collection metadata (floor price, volume, supply).
Wallet transaction history (transfers, swaps, contract calls).
wallet_balance, swap_quote, token_holders — on the roadmap (waiting on x402 supply).
API surface
Four endpoints. Three are free.
POST
/v1/route
$0.001
Get one recommended endpoint for a task. Paid via x402.
GET
/v1/tasks
free
List all routed task types with chains and price ranges.
GET
/v1/endpoints
free
List all curated endpoints. Optional ?task= filter.
GET
/v1/score?endpoint=URL
free
Inspect raw signals and per-task quality_score for any endpoint.
Boundaries
A router, not a proxy.
No provider proxy
x402route returns the route decision. The agent calls the selected endpoint directly.
No data resale
The response is a provider recommendation, not the final token price, RPC result, or news payload.
No account layer
The route call is paid with x402. No dashboard, login, or subscription is required.
Compatibility
Works with
x402 payment
Pay once. Route once.
Challenge → sign → retry
POST /v1/route returns HTTP 402 with a payment-required header. Sign an EIP-3009 transferWithAuthorization for 0.001 USDC on Base, retry with the X-PAYMENT header, get the route.
Existing libraries
x402-fetch and x402-axios handle the challenge-response loop automatically. AWS Bedrock AgentCore SDK does too at preview.
Spec
The x402 protocol is documented at github.com/coinbase/x402. Network and token agnostic — Solana and other rails on the roadmap.