{"uid":"cap_MFsZepQHGbFWrHeAWX-1r","slug":"agent402-decide-execute-a-plan-9e89f213","name":"Agent402 Decide: Execute a Plan","description":"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.","url":"https://agent402.tools/api/decide/execute?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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)"}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_nUvpSTeW4PtLc1KCvGEQ_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Multi-tool research plan with budget cap","prompt":"Execute decision plan dec_research99 for me using execution credit tok_cr001, and cap the total spend at $0.30 — I want all third-party steps paid automatically and any leftover amount credited back."},{"title":"Automated agent workflow with fallbacks","prompt":"Run the plan from decision dec_workflow55 — don't exceed $1.00 total, try every fallback step if earlier ones fail, and use credit token tok_save22 to offset the cost."},{"title":"Step-param override for targeted execution","prompt":"Execute decision dec_lookup77 but override the params for step 1 with my custom location data, apply credit token tok_abc, and keep the budget under $0.25."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T06:44:52.811Z","isFirstParty":false,"canonicalSlug":"agent402-decide-execute-a-plan-9e89f213"}