{"uid":"cap_N05r4nOFXyGRL-IseUSFb","slug":"ghost-gate-decide-ai-agent-task-budget-go-no-go-decision-fd7e9e6f","name":"Ghost Gate Decide — AI Agent Task Budget & Go/No-Go Decision","description":"Paid per call via x402 (exact / eip155:8453 / USDC). Any x402-capable client pays automatically: agentcash, @x402/fetch, x402-fetch. Every paid operation carries x-payment-info; the same terms are served live as a 402.","url":"https://ghost-identity.ghost-agent-os.workers.dev/v1/gate/decide","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"task_id":{"type":"string","title":"Task Id","maxLength":200},"currency":{"type":"string","title":"Currency","default":"USD","maxLength":16},"task_type":{"type":"string","title":"Task Type","maxLength":120,"description":"What kind of job this is. Success history is pooled under it, so it must be stable."},"max_budget":{"anyOf":[{"type":"number","maximum":100000000,"minimum":0},{"type":"null"}],"title":"Max Budget","default":null},"failure_cost":{"anyOf":[{"type":"number","maximum":100000000,"minimum":0},{"type":"null"}],"title":"Failure Cost","default":null},"revenue_models":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Revenue Models","maxItems":6,"description":"Optional. Say what the task is worth in the terms you actually measure, and Ghost derives value_of_success / customer_revenue / max_budget from it — never overriding a value you stated yourself. Each entry needs a `type`: SALES_ROI (spend, qualified_leads?, meetings?, closed_deals?, realized_revenue?), AFFILIATE_ROI (commission_rate?, order_value?, conversion_probability?, tool_cost?, inference_cost?, transaction_cost?), PROCUREMENT_SAVINGS (current_total_cost?, alternative_total_cost?, switching_cost?, migration_cost?), RETURN_ROI (expected_return, data_cost?, model_cost?, execution_cost?, expected_risk_loss?; expected_return is YOURS to state and is never estimated by Ghost), CREDIT_AFFORDABILITY (available_credit, planned_spend?). Ratios are derived only where the denominator exists; conversion rates are never invented."},"switching_cost":{"anyOf":[{"type":"number","maximum":100000000,"minimum":0},{"type":"null"}],"title":"Switching Cost","default":null},"required_margin":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Required Margin","default":null},"customer_revenue":{"anyOf":[{"type":"number","maximum":100000000,"minimum":0},{"type":"null"}],"title":"Customer Revenue","default":null},"value_of_success":{"anyOf":[{"type":"number","maximum":100000000,"minimum":0},{"type":"null"}],"title":"Value Of Success","default":null},"success_definition":{"type":"string","title":"Success Definition","maxLength":1000,"description":"What counts as success, written down BEFORE paying. verified_success is later judged against this."},"fallback_authorized":{"type":"boolean","title":"Fallback Authorized","default":false,"description":"May Ghost route to a different candidate than the first? Off by default: an unrequested reroute is a payment the operator did not choose."},"provider_candidates":{"type":"array","items":{"$ref":"#/$defs/ProviderCandidateModel"},"title":"Provider Candidates","maxItems":20,"minItems":1}}},"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_0fGLReLkTWUnMA4k_35TW","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":"Evaluates whether an AI agent task is economically viable by computing a go/no-go gate decision based on task value, budget, costs, and revenue models, returning a recommended spend threshold.","exampleAgentPrompt":"Before you proceed with this lead qualification task, check with Ghost whether it's worth doing — the task type is 'lead_qualification', our max budget is $50, the value of a successful qualified lead is $500, and failure would cost us about $10 in wasted outreach.","exampleUseCases":[{"title":"Sales agent ROI gate before outreach","prompt":"Before my sales agent sends outreach emails for this campaign, run a Ghost gate check: task type is 'email_outreach', we expect $2000 in customer revenue per closed deal, our planned spend is $80, and we need at least a 20% margin — tell me if it should proceed."},{"title":"Procurement savings task viability check","prompt":"My agent is about to run a vendor comparison task to find cheaper software — the current tool costs us $400/month, the alternative is $250/month, and switching would cost $300 one-time. Ask Ghost if the task is economically justified with a PROCUREMENT_SAVINGS model."},{"title":"Affiliate campaign go/no-go before execution","prompt":"Check if it's worth running this affiliate product promotion task: commission rate is 8%, average order value is $150, estimated conversion probability is 3%, and the tool plus inference cost is about $5 total — use an AFFILIATE_ROI model and tell me the max budget Ghost recommends."}],"resultDescription":"Returns a go/no-go gate decision for the agent task, including a recommended maximum spend, computed value of success, derived margin, and any revenue model outputs (ROI ratios, derived budgets). Fields never invented — only ratios where denominators exist. Also includes payment metadata via x-payment-info header confirming the $0.01 USDC charge.","failureModes":["Invalid or missing task_type causes pooled history lookup failure","max_budget or value_of_success conflict with revenue_model derived values may return a warning","revenue_model missing required fields (e.g. RETURN_ROI without expected_return) returns a schema validation error","Payment not completed via x402 results in HTTP 402 response with payment terms","Exceeding revenue_models maxItems of 6 returns a 422 validation error","task_id exceeding 200 characters or task_type exceeding 120 characters returns 422"],"whenToPreferThis":"Use this endpoint when an AI agent needs an economically-grounded go/no-go decision before committing spend to a task — especially when task value, ROI model, or failure cost are known. Prefer over simple budget checks when you have revenue model data (sales, affiliate, procurement, return, or credit) and want Ghost to derive safe spend thresholds without inventing conversion rates. Ideal for agent orchestration pipelines that need spend governance at the task level.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:43:46.228Z","isFirstParty":false}