Decide: tool plan for a task

quoted per request from $0.005 · USDC via x402 · POST /api/decide

Describe a job and get a call-ready plan: which tools, across this catalog and outside x402 sellers with a recently verified 402, solve it end to end, in what order, with fallbacks, input params that validate against each tool's schema, and cost/latency estimates. Send POST /api/decide with the required field task and pay quoted per request from $0.005 over x402 or MPP (there is no free tier). It returns a JSON object with decisionId, task, depth, plan, estimatedCostUsd and 9 more.

Priced by depth: quick (one best tool), plan (steps + fallbacks), full (plan + params + compiled prompt). The fee comes back as a credit toward running the plan with POST /api/decide/execute. The ranking formula has no first-party term; every tool carries firstParty. Uncovered needs are listed in gaps.

Category: agents · Tags: agents routing planning discovery x402

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
taskstringyesWhat the agent needs done (max 2000 chars)
depthstring (one of: quick, plan, full)noquick | plan (default) | full
constraintsobjectnomaxBudgetUsd, maxLatencyMs, rails [x402|mpp], chains [CAIP-2 or namespace], excludeSellers [host], requireDeterministic

Example request

curl -i -X POST https://agent402.tools/api/decide \
  -H "Content-Type: application/json" \
  -d '{"task":"Research the latest EU AI Act obligations for general-purpose models, with citations","depth":"plan"}'

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

Example response

{
  "decisionId": "dec_2b1c9e0f4a7d4c3e9b8a1f00",
  "task": "Research the latest EU AI Act obligations for general-purpose models, with citations",
  "depth": "plan",
  "plan": [
    {
      "step": 1,
      "purpose": "search recent sources on the EU AI Act GPAI obligations",
      "tool": {
        "id": "a1b2",
        "slug": "search",
        "name": "Web search",
        "seller": "agent402",
        "firstParty": true,
        "endpoint": "https://agent402.tools/api/search",
        "method": "GET",
        "rail": "x402",
        "rails": [
          "x402",
          "mpp"
        ],
        "networks": [
          "eip155:8453"
        ],
        "priceUsd": 0.02,
        "executeViaAgent402Usd": 0.02,
        "inputSchema": {
          "type": "object",
          "properties": {
            "q": {
              "type": "string"
            }
          },
          "required": [
            "q"
          ]
        },
        "exampleParams": {
          "q": "EU AI Act general-purpose AI model obligations 2026"
        },
        "exampleParamsSource": "task"
      },
      "why": "fit 0.92, score 0.801",
      "score": 0.801,
      "fallbacks": [],
      "dependsOn": []
    }
  ],
  "estimatedCostUsd": 0.02,
  "estimatedCostViaAgent402Usd": 0.02,
  "estimatedLatencyMs": 1500,
  "confidence": 0.92,
  "partial": false,
  "gaps": [],
  "cached": false,
  "priceUsd": 0.02,
  "ranking": {
    "weights": {
      "fit": 0.45,
      "reliability": 0.2,
      "price": 0.15,
      "schema": 0.1,
      "freshness": 0.1
    },
    "firstPartyWeight": 0
  },
  "neutrality": "Every candidate is scored by one formula with the same weights: fit to the step, observed reliability, price, schema quality and a freshness pass mark. It has no term for who sells the tool, and every tool carries firstParty. Fit is judged from the same bounded description for every tool; reliability counts one observation per payer per day. Outside tools are eligible when a live 402 was seen within the configured window and their input schema is known."
}
FieldTypeAlways presentIn the example
decisionIdstringyesdec_2b1c9e0f4a7d4c3e9b8a1f00
taskstringyesResearch the latest EU AI Act obligations for general-purpose models, with ci...
depthstringyesplan
planarray of objectsyes1 item in the example
estimatedCostUsdnumberyes0.02
estimatedCostViaAgent402Usdnumberyes0.02
estimatedLatencyMsnumberyes1500
confidencenumberyes0.92
partialbooleanyesfalse
gapsarrayyes0 items in the example
cachedbooleanyesfalse
priceUsdnumberyes0.02
rankingobjectyes2 fields: weights, firstPartyWeight
neutralitystringyesEvery candidate is scored by one formula with the same weights: fit to the st...

From an MCP client

catalog.call {
  "slug": "decide",
  "params": {
    "task": "Research the latest EU AI Act obligations for general-purpose models, with citations",
    "depth": "plan"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for decide; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. 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?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/decide", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "task": "Research the latest EU AI Act obligations for general-purpose models, with citations",
    "depth": "plan"
  }),
});

Related tools

Decide: execute a plan

$0.001 · POST /api/decide/execute

Run a decision's plan through Agent402: first-party steps run directly, third-party steps are paid on your behalf (paid …

A2A Agent Card fetch

$0.005 · POST /api/a2a-card-fetch

Discover and fetch a site's A2A (Agent2Agent protocol) Agent Card - tries /.well-known/agent-card.json then /.well-known…

Agent402 bestsellers

$0.005 · GET /api/bestsellers

What agents actually pay for on a 500+ tool x402 catalog - the paid intelligence layer over Agent402's own sales ledger,…

agent demand radar

$0.005 · GET /api/demand-radar

What agents want that no one is serving yet - the paid intelligence layer over Agent402's agent-demand board, for x402 s…

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 with the pr…

Check an x402 seller's trust evidence

FREE w/ compute · or $0.005 · GET /api/x402/seller-trust

Trust evidence for any x402 seller origin: is it indexed, does its manifest parse, how many tools does it publish, which…