{"uid":"cap_LIcLt4l-6rk5rPUPADXNz","slug":"x402-agentic-spend-guard-per-agent-budget-enforcement-72d9122b","name":"x402 Agentic Spend Guard — Per-Agent Budget Enforcement","description":"Per-agent budget enforcement — track an agent's cumulative spend against a cap and block overspend. Part of x402 Agentic, the payment-trust suite for AI agents on Base USDC.","url":"https://api.x402agentic.ai/spend-guard?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["agentId"],"properties":{"agentId":{"type":"string","description":"Stable identifier for the spending agent"},"amountUsd":{"type":"number","description":"Amount about to be spent (USD)"},"budgetUsd":{"type":"number","description":"Optional: set/raise this agent's budget (USD)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"agentId":"agent-123","allowed":true,"verdict":"allow","recorded":true,"spentUsd":0.25,"amountUsd":0.25,"budgetUsd":10,"remainingUsd":9.75}},"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":{"p10Cents":"1.0000","medianCents":"1.0000","p90Cents":"1.0000","minCents":"1.0000","maxCents":"1.0000","p95Cents":"1.0000","sampleCount":1,"varies":false,"failureChargeRate":1},"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_EFoBM4PT3GzH2Hn_kDtsB","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":"Tracks a named agent's cumulative USD spend against a cap and blocks transactions that would exceed the budget","exampleAgentPrompt":"Before making this $12 purchase, check whether agent 'agent-007-shopper' is still within its $50 monthly budget cap — and if the cap isn't set yet, initialize it at $50.","exampleUseCases":[{"title":"Guard against runaway autonomous spending","prompt":"We're running five different AI agents that handle vendor payments autonomously. Before each transaction goes through, I need you to verify that the requesting agent won't exceed its $200 weekly limit — and block any payment that would push it over."},{"title":"Multi-agent budget tracking and enforcement","prompt":"Set up a $1000 cumulative spend cap for our customer-service bot, then continuously monitor its spending as it makes refunds and compensation payments throughout the day. Let me know if it ever approaches the limit."},{"title":"Verify budget headroom before agent purchase","prompt":"Our procurement agent is about to place a $75 order. Before approving it, check how much budget it has left from its $500 quarterly allowance and tell me whether this purchase would fit."}],"resultDescription":"Returns whether the agent is allowed to proceed with the pending spend, the agent's cumulative total spent so far, remaining budget headroom, and a flag indicating whether the transaction would cause an overspend. If a budgetUsd was provided, confirms the cap has been set or updated.","failureModes":["Missing agentId returns a 400 validation error","amountUsd larger than remaining budget returns an overspend-blocked response","Invalid or malformed agentId returns an error","Service unavailable mid-transaction may leave spend state inconsistent","Calling without amountUsd only checks budget state without evaluating a pending spend"],"whenToPreferThis":"Use this endpoint when an AI agent needs real-time pre-authorization of a payment against a pre-set USD budget — particularly for autonomous agents on Base USDC where runaway spending is a risk. Prefer this over client-side budget checks because it persists cumulative state server-side across multiple agent sessions and payment events. Best suited for agentic workflows where the agent makes repeated micropayments and needs a centralized guardrail.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T00:31:17.198Z","isFirstParty":false,"canonicalSlug":"x402-agentic-spend-guard-per-agent-budget-enforcement-72d9122b"}