Authentication
Facilitator Service requires a Circle API key to settle payments. If you don’t have one yet, create one in Circle Console. You can also start without an API key using the keyless trial, which authenticates with a seller proof instead. The trial covers fixed-amount payments only, with an allowance that applies until you settle with an API key. Usage-based payments always require an API key.Roles
Every Facilitator Service payment involves three actors:- Buyer: an HTTP client, typically an AI agent, that signs a payment authorization to pay for a resource.
- Seller: an HTTP resource server that asks for payment before returning a result, then calls Facilitator Service to settle the buyer’s authorization.
- Facilitator: screens both parties, submits the USDC transfer through a Circle relayer, and pays settlement gas.
Supported buyer accounts
Facilitator Service accepts signatures from externally owned accounts (EOAs) and from deployed smart contract accounts through ERC-1271. Smart contract accounts that aren’t deployed yet (ERC-6492) are not supported. EOA signatures must use av value
of 27 or 28.
Payment schemes
Facilitator Service supports two x402 payment schemes:exactpayments charge a fixed amount per request. The buyer signs for that amount, and the seller settles it.uptopayments charge a variable amount per request. The buyer signs for a maximum, and the seller settles the actual amount after serving the request, from zero up to the maximum.
Comparison table
Useexact when every request has a fixed price. Use upto when you can’t know
the price until the work is done, such as per-token LLM completions, metered
compute, or bandwidth.
For blockchain availability, see
Supported networks.
Fixed-amount payments
Fixed-amount payments use the x402exact scheme. The buyer signs an EIP-3009
authorization for a specific amount, and Facilitator Service submits a USDC
transfer for that same amount.
Payment flow
- A buyer requests a paid resource from the seller’s API.
- The seller returns
402 Payment Requiredwith the payment requirements. - The buyer signs an EIP-3009 authorization offchain and retries the request.
- The seller sends the signed authorization to Facilitator Service using
/settle. - Facilitator Service screens both parties. If either fails, it refuses to settle. Otherwise, it submits the USDC transfer through a Circle relayer.
- Once confirmed, Facilitator Service returns the transaction hash to the seller, who fulfills the request.
EIP-3009 authorization
Facilitator Service uses EIP-3009 as the payment primitive. The buyer signs aTransferWithAuthorization message
offchain, and Facilitator Service submits it to the USDC contract on the
payment’s blockchain to move USDC from buyer to seller.
Before Facilitator Service submits the transaction, it validates the following:
- That the buyer’s signature is valid
- That the buyer has sufficient USDC balance
- That the
toaddress in the authorization matches the seller’spayTo
transferWithAuthorization on the USDC contract.
Usage-based payments
Usage-based payments use the x402upto scheme. The buyer signs a
Permit2 authorization for a maximum
amount, and the seller settles the actual amount after serving the request.
Facilitator Service verifies the authorization against the maximum, then submits
a USDC transfer for the actual charge.
Payment flow
- The seller returns
402 Payment Requiredwithuptopayment requirements. Theamountis the most the seller may charge. - The buyer signs a Permit2 authorization for that maximum and retries the request.
- The seller calls
/verifywithpaymentRequirements.amountset to the maximum. - The seller serves the request and works out the actual charge.
- The seller calls
/settlewith the same signed payload andpaymentRequirements.amountset to the actual charge. - Facilitator Service screens both parties and submits the transfer for the actual amount through the x402 Permit2 proxy contract.
/settle as long as it doesn’t exceed the signed maximum.
Buyer prerequisites
The Permit2 contract moves USDC on the buyer’s behalf, so the buyer must first grant Permit2 spending power over their USDC. The buyer can grant it with an onchain approval, or with a signed EIP-2612 permit that the seller attaches to each payment. For how to set this up, see Set up a Permit2 allowance.Permit2 authorization
The buyer signs an EIP-712PermitWitnessTransferFrom message under the Permit2
domain. The witness binds the authorization to the seller’s payTo and to a
specific Circle facilitator wallet. Only that wallet can submit the settlement.
To retrieve facilitator addresses, use the
Get supported x402 payment kinds
endpoint.
Repeat settlements
Eachupto authorization settles at most once per Circle account. A repeat
/settle call with the same authorization returns the original payment rather
than a second charge, even if the amount differs. The only way to charge the
buyer again is a new authorization.
A /settle call conflicts with an existing payment when:
- A different Circle account already settled the authorization.
- The same account sends the authorization or
payment-identifieragain with different request details, such asresource.urlormaxTimeoutSeconds. - A different buyer’s payment already uses the same
payment-identifier. - A different signed authorization reuses the same Permit2 nonce for the same buyer.
HTTP 409 reason strings, see
Facilitator Service errors.