x402 on BSC: a practical USDT payment guide for AI agents

Updated 2026-11-20

x402 turns payment into part of an HTTP request: a server answers with HTTP 402 and a precise payment requirement, an authorized client signs that requirement, and the client retries the same request with proof of payment. This makes checkout programmable without treating a login signature as permission to spend.

The request flow

  1. The client creates an order with an idempotency key. Reusing the same key and request body prevents an ordinary retry from creating a second order.
  2. The client calls the order payment endpoint. If payment is required, the server returns HTTP 402 and a PAYMENT-REQUIRED header containing the network, asset, amount, recipient, resource, deadline, and related payment data.
  3. The client validates every field against its policy and the wallet owner’s approval. It then signs only the exact requested payment.
  4. The signed x402 v2 payload is base64 encoded and sent in the PAYMENT-SIGNATURE header while retrying the same payment endpoint.
  5. After settlement, payment and fulfillment can still be separate states. The client checks the existing order until it is delivered instead of paying again.

BSC parameters used by this integration

ParameterValue
NetworkBNB Smart Chain (BSC), chain ID 56
USDT contract0x55d398326f99059fF775485246999027B3197955, 18 decimals
Permit2 contract0x000000000022D473030F116dDEE9F6B43aC78BA3
Payment formPermitWitnessTransferFrom with the recipient included in the witness

BSC USDT does not provide the EIP-3009 flow used by some other x402 assets, so this implementation uses Permit2. A first-time token allowance can require a BNB gas transaction. The subsequent payment signature should be limited by the order amount, nonce, deadline, and intended recipient.

Safety checks before signing

Discovery and implementation resources

Read llms.txt for the current agent workflow, OpenAPI 3.1 for request fields, and the JavaScript client example for implementation guidance. The live catalog and checkout response remain authoritative for product eligibility, current prices, and supported payment paths. AgiPay is an independent platform; these technical interfaces do not imply that any third-party AI product has integrated the site by default.

Frequently asked questions

What does HTTP 402 mean in this flow?

It means the requested operation requires payment. The response provides machine-readable terms that the client must validate before signing and retrying.

Why is Permit2 used for BSC USDT?

BSC USDT does not expose the EIP-3009 authorization flow used by some assets. Permit2 provides a typed, scoped authorization flow for this integration.

Does the login signature authorize a payment?

No. Login and payment are separate signatures. The login proves wallet control; the x402 payment signature authorizes the exact order terms after validation.

Should a client retry payment when delivery is pending?

No. Payment confirmation and fulfillment are separate. The client should poll the same order at a conservative interval and must not create or pay a duplicate order merely because delivery is still processing.