Agent-Initiated Payment
Give an agent a bounded wallet so it can settle a payment mid-request to unlock a resource — answering a payment-required challenge with a verifiable proof — instead of routing every purchase through a human.
Problem
Pre-provisioning every possible paid resource with an account, an API key, and a billing relationship does not scale to an agent that discovers what it needs as it runs, and it leaves spend untracked across dozens of providers. Putting a human in the loop for each purchase defeats the point of an autonomous run and stalls on sub-second resource calls. But handing an agent an open-ended payment instrument invites runaway spend, fraud, and purchases no one can later reconstruct or attribute.
Solution
Provision the agent with a constrained wallet: a balance or credit line, a per-transaction ceiling, a total budget per run, and an allow-list of payable counterparties or resource classes. When a resource returns a payment-required challenge, the agent constructs a payment (for example a signed stablecoin transfer referenced in a payment header) and retries; the resource verifies the proof and releases the data. Each settlement is recorded to a ledger with the amount, counterparty, run id, and the action that triggered it, so spend is observable and attributable. Spend caps and the counterparty allow-list are enforced outside the model, so a compromised or confused agent cannot exceed them.
When to use
- The agent needs paid resources it discovers at runtime rather than a fixed pre-provisioned set.
- Resources expose machine-payable endpoints that settle faster than human approval allows.
- Spend can be bounded by enforced per-transaction and per-run caps.
- Payments must be attributable to a run and an action for audit.
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.