# Agent402 Decide: Execute a Plan

> Agent402 Decide: Execute a Plan is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-17).

Executes a decision plan by running first-party steps directly and paying for third-party steps on your behalf via Base, credits, or card, with budget controls and credit-back for unspent amounts.

## Facts

- Endpoint: POST https://agent402.tools/api/decide/execute?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-decide-execute-a-plan-9e89f213
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MFsZepQHGbFWrHeAWX-1r

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-decide-execute-a-plan-9e89f213 -d '<json body>'
```

Example prompt: Run the decision plan dec_abc123 for me using my execution credit token tok_xyz — keep the spend ceiling at $0.50 and override step 2 params with my custom search query.

## When to prefer this

Use this endpoint when you have already created a decision plan via /api/decide and need to actually run it, especially when the plan includes third-party paid steps that require automated micropayment routing via Base or credits. Prefer this over custom orchestration when you want budget caps, automatic fallbacks, credit application, and transparent cost accounting built in.

## Known failure modes

- Invalid or expired decisionId returns an error with no charge
- Budget exceeded mid-run stops execution and returns partial results with refund of unspent amount
- All fallback steps fail — run is not charged
- Invalid creditToken causes the credit not to be applied but execution may still proceed
- Third-party step payment failure on Base network causes that step to be skipped or fallback tried
- maxBudgetUsd set too low to cover any step — run may abort immediately

## How this service works

Run a decision's plan through Agent402: first-party steps run directly, third-party steps are paid on your behalf (paid on Base, or by credits or card) and relayed at the seller's price plus a disclosed routing fee. Priced at the plan's budget (or your maxBudgetUsd, whichever you set) less a valid execution credit; spend stops at that budget, fallbacks are tried in order, and any unspent amount comes back as a credit. A run where no step succeeds is not charged.

## Output

Returns a JSON object with a runId, an array of step results (each with step number, tool slug, seller, first-party flag, result payload, status, and costUsd), overall status (complete/partial/failed), total paidUsd, spentUsd, budgetUsd, decisionId, routingFeePct, leftoverCredit, and creditAppliedUsd. Runs where no step succeeds are not charged.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "steps": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Instead of decisionId: the tool slugs of a free plan sketch (from /api/find or /api/route), 2 to 5, in order. Pass params for step 1; a later step takes its one required input from the step before."
  },
  "params": {
   "type": "object",
   "description": "Per-step params overriding the plan's exampleParams, keyed by step number"
  },
  "decisionId": {
   "type": "string",
   "description": "From POST /api/decide (or pass steps instead)"
  },
  "creditToken": {
   "type": "string",
   "description": "executionCredit.token from that decision (optional)"
  },
  "maxBudgetUsd": {
   "type": "number",
   "description": "Spend ceiling for the run (default: the plan's estimate via Agent402)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "runId": "run_…",
  "steps": [
   {
    "step": 1,
    "tool": {
     "slug": "search",
     "seller": "agent402",
     "firstParty": true
    },
    "result": {},
    "status": "ok",
    "costUsd": 0.02
   }
  ],
  "status": "complete",
  "paidUsd": 0.001,
  "spentUsd": 0.02,
  "budgetUsd": 0.02,
  "decisionId": "dec_…",
  "routingFeePct": 5,
  "leftoverCredit": null,
  "creditAppliedUsd": 0.02
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-decide-execute-a-plan-9e89f213/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
