{"uid":"cap_JzXjX4X45yxEaZd0BQLp3","slug":"agent-rest-stop-retry-pay-abort-decision-engine-e384d597","name":"Agent Rest Stop – Retry/Pay/Abort Decision Engine","description":"Chooses retry, pay, or abort from a status.","url":"https://agent-gas-station.agent-gas-station.workers.dev/v1/RetryPlan?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"error":{"type":"string"},"status":{"type":"string"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8O9XSHO3Vfo4EB6Ztzsd1","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Given an error status from an API call, decides whether the agent should retry the request, pay to proceed, or abort the operation entirely.","exampleAgentPrompt":"I just got back a '402 Payment Required' status with the error 'insufficient credits' — should I retry, pay, or abort?","exampleUseCases":[{"title":"Handling 402 payment-gated API response","prompt":"My agent hit a '402 Payment Required' with error 'balance too low' — tell me whether it should go ahead and pay, retry later, or just give up."},{"title":"Recovering from a rate-limit error","prompt":"I got status '429' and error 'rate limit exceeded' from an API call — what should my agent do next, retry, pay, or abort?"},{"title":"Deciding on a fatal server error","prompt":"My pipeline just received status '500' with error 'internal server error' — should the agent retry this request or abort the whole task?"}],"resultDescription":"A structured decision indicating which of three actions the agent should take — retry the request, initiate payment to proceed, or abort the operation — based on the provided error and status inputs.","failureModes":["Missing or empty 'status' field may result in indeterminate or default response","Ambiguous error strings may lead to a conservative 'abort' recommendation","Unrecognized status codes may not map cleanly to a retry/pay/abort decision","Network timeout to the worker endpoint itself requires caller-side fallback logic"],"whenToPreferThis":"Use this endpoint when an AI agent needs to make an automated, deterministic recovery decision after a failed API call — especially in x402-payment-aware workflows where 'pay to proceed' is a valid option alongside retry and abort. Prefer this over hardcoded if/else logic when the set of statuses and errors is diverse or when you want a centralized, auditable decision point for all agent error-handling.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:40:25.318Z","isFirstParty":false,"canonicalSlug":"agent-rest-stop-retry-pay-abort-decision-engine-e384d597"}