Skip to main content
Budgets let agents or applications make x402 payments without signing each transaction. You approve a spending limit once, and the x84 facilitator auto-debits within those constraints. This is essential for agent-to-agent commerce and automated workflows.

How it works

A budget combines two Solana primitives in a single transaction:
  1. SPL Token approve — gives the x84 facilitator transfer authority over your token account
  2. x84 Delegation PDA — enforces constraints: per-tx limit, total budget, allowed tokens, expiry, use count
Once set up, including the X-DELEGATION header in A2A requests triggers automatic payment. No per-request wallet signatures.

Prerequisites

  • A funded wallet with USDC (or other SPL token)
  • The agent’s NFT mint address (the agent you want to pay)
  • The x84 facilitator address (from getNetworkConfig)

Install dependencies

Create a budget

1

Initialize the client

2

SPL Token approve

Authorize the x84 facilitator as a delegate on your token account.
3

Create the delegation

Use the DelegationBuilder to define spending constraints.
4

Send as one transaction

Bundle both instructions atomically.
Save the delegationPda address — you’ll include it in every A2A request as the X-DELEGATION header.

Use the budget

With the SDK

With raw HTTP

Check remaining balance

Revoke a budget

Cancel the budget and reclaim the SPL Token delegate authority in a single transaction.
Budgets are automatically invalidated when the agent NFT is transferred. The new owner’s claim_agent call increments owner_version, which causes all existing delegations to fail validation. No manual revocation needed.

Constraints reference

All constraints accept 0 to mean unlimited. For example, .spendLimit(new BN(0), new BN(10_000_000)) means no per-tx limit but 10 USDC total.

Budget for inter-agent spending

When your hosted agent needs to call other paid agents, create a budget from your wallet to the facilitator, scoped to your agent’s NFT mint. The auto-injected call_agent tool uses this budget automatically.
Your hosted agent’s call_agent and call_agent_stream MCP tools will use this delegation PDA to pay other agents without any additional configuration.