Route and execute (max tier)

$0.55 per callUSDC via x402POST /api/route/execute-max

Describe 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 seller in the open index - x402 sellers, or MPP sellers on Tempo (Agent402 buys the result over x402 or MPP and sells it to you). Send POST /api/route/execute-max with no required fields (5 optional) and pay $0.55 per call over x402 or MPP (there is no free tier). It returns a JSON object with receipt and result.

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.

Category: Routing & delegationTags: router sor execute dispatch meta agent x402 buy

Try in playground →

Parameters

NameTypeRequiredDescription
taskstringnoPlain-language task, e.g. "look up the DNS records of a domain" - resolved via the same ranker as /api/find. Provide task OR slug.
slugstringnoExact tool slug to execute (skips ranking). Provide task OR slug.
paramsobjectnoInput for the resolved tool, matching its inputSchema (default {})
includestringnoWhere to route: default runs a tool from THIS host's catalog; "external" routes to the best-matching x402 seller in the OPEN index, buys the result from it and sells it to you (marked untrustedContent). Requires task (not slug).
maxUsdnumbernoRefuse tools listed above this underlying price (default and ceiling: $0.5)

Example request

curl -i -X POST https://agent402.tools/api/route/execute-max \
  -H "Content-Type: application/json" \
  -d '{"task":"look up the DNS records of a domain","params":{"name":"example.com","type":"A"}}'

Without payment this returns HTTP 402 Payment Required with the exact price for route-execute-max; any x402 v2 or MPP client pays it and retries.

Example response

{
  "receipt": {
    "slug": "dns",
    "route": "GET /api/dns",
    "underlyingPriceUsd": 0.001,
    "paidUsd": 0.55,
    "routingFeeUsd": 0.009,
    "seller": "internal",
    "resolvedBy": "task",
    "ts": "2026-07-10T00:00:00.000Z",
    "callRef": "sha256:…  (recomputable: sha256 of {\"nonce\":<payment authorization nonce>,\"slug\":…,\"ts\":…} - null on nonce-less calls)"
  },
  "result": {
    "name": "example.com",
    "type": "A",
    "records": [
      "…"
    ]
  }
}
FieldTypeAlways presentIn the example
receiptobjectyes9 fields: slug, route, underlyingPriceUsd, paidUsd, routingFeeUsd, seller
resultobjectyes3 fields: name, type, records

From an MCP client

catalog.call {
  "slug": "route-execute-max",
  "params": {
    "task": "look up the DNS records of a domain",
    "params": {
      "name": "example.com",
      "type": "A"
    }
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for route-execute-max; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp.

Errors and behavior

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();
client.setSpendControls?.({ maxAmountPerPayment: "$0.55" }); // refuse any quote above this tool's price
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({
    "task": "look up the DNS records of a domain",
    "params": {
      "name": "example.com",
      "type": "A"
    }
  }),
});

Related tools

Route and execute

$0.01 · POST /api/route/execute

Describe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call.

Route and execute (plus tier)

$0.05 · POST /api/route/execute-plus

Describe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call.

Route and execute (pro tier)

$3.30 · POST /api/route/execute-pro

Describe a task (or name a slug) and the Smart Order Router resolves the best-matching tool and RUNS it in the same call.

Decide: execute a plan

from $0.001 · POST /api/decide/execute

Run a decision's plan through Agent402: first-party steps run directly, third-party steps are bought from the seller.

x402 seller dossier

$0.05 · POST /api/seller-dossier

Everything Agent402 knows about one x402 seller origin, in one read: identity and crawl history, the catalog.

AI agent action preflight

$0.01 · POST /api/action-gate

Deterministic preflight check for a proposed AI agent action - a tool call, payment, fetch, or write - before it.