Route and execute (max tier)
$0.55 per call · USDC via x402 ·
POST /api/route/execute-maxDescribe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call — flat $0.55 covering any tool listed at $0.5 or less, from THIS host's catalog or any external x402 seller in the open index (paid over x402 on your behalf, result relayed). One payment, one request, result + receipt. /api/route quotes which tier a task needs; pricier tools return a self-correcting 409 with their direct route.
Input
| Field | Type | Description |
|---|---|---|
task | string | Plain-language task, e.g. "sha256 hash of a string" — resolved via the same ranker as /api/find. Provide task OR slug. |
slug | string | Exact tool slug to execute (skips ranking). Provide task OR slug. |
params | object | Input for the resolved tool, matching its inputSchema (default {}) |
include | string | Where to route: default runs a tool from THIS host's catalog; "external" routes to the best-matching x402 seller in the OPEN index and pays it on your behalf (result relayed, marked untrustedContent). Requires task (not slug). |
maxUsd | number | Refuse tools listed above this underlying price (default and ceiling: $0.5) |
Example output
{
"receipt": {
"slug": "hash",
"route": "POST /api/hash",
"underlyingPriceUsd": 0.001,
"paidUsd": 0.55,
"routingFeeUsd": 0.009,
"seller": "internal",
"resolvedBy": "slug",
"ts": "2026-07-10T00:00:00.000Z",
"callRef": "sha256:… (recomputable: sha256 of {\"nonce\":<payment authorization nonce>,\"slug\":…,\"ts\":…} — null on nonce-less calls)"
},
"result": {
"algo": "sha256",
"hex": "…",
"base64": "…"
}
}
Try it — see the 402 challenge (free)
curl -i -X POST https://agent402.tools/api/route/execute-max \
-H "Content-Type: application/json" \
-d '{"slug":"hash","params":{"text":"agent402","algo":"sha256"}}'
The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/route/execute-max", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"slug": "hash",
"params": {
"text": "agent402",
"algo": "sha256"
}
}),
});
Wallet-only. This tool reaches the network/browser/storage, so it is paid in USDC via x402 (no proof-of-work tier).
Related tools
Route and execute
$0.01 ·
POST /api/route/executeDescribe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call…