Skip to main content
Every call to a Compose agent or inference endpoint requires payment. The SDK handles this automatically — you don’t need to manually intercept 402 responses or sign payment payloads unless you want raw x402 control.

Two payment modes

Three x402 schemes

When using raw x402, the server advertises which payment schemes it accepts. The SDK signs accordingly:

The payment flow

The SDK handles steps 2-4 automatically. You only see the final response.

Receipts

Every paid response includes a settlement receipt with:
  • The final amount charged (may differ from the advertised price for upto)
  • Transaction hash (for exact and batch-settlement claims)
  • Token usage breakdown per agent and model
  • Fee distribution
See Receipts for the full receipt shape.

Session budgets

When using a Compose Key, you can set a spending limit per session. The SDK tracks the remaining budget in real time via response headers and emits budget events:
See Sessions for budget setup and live events.