Skip to main content

💸 x402 Payment Protocol

Access Required

x402 is available to BCW plan users. Contact help@arkhia.io to request access.

x402 Payment Integration via Arkhia

April 2026

Arkhia now supports the x402 Payment Protocol — an open standard for machine-to-machine HTTP payments using USDC on EVM-compatible chains. Route your x402 payment facilitation requests through Arkhia's authenticated proxy for usage tracking, rate limiting, and credit-based billing.


What is x402?

x402 is an HTTP-native payment protocol where the server responds with a 402 Payment Required status and payment instructions. The client creates an ERC-3009 TransferWithAuthorization signature and submits it to a facilitator, which executes the on-chain USDC transfer.

Arkhia acts as an authenticated proxy between your application and the x402 facilitator service — your API key is part of the URL, enabling per-project usage tracking.


🌐 URL Format

https://starter.arkhia.io/x402/{network}/{api-key}/{endpoint}
SegmentValuesDescription
networkmainnet, testnetTarget network environment
api-keyYour project API keyFrom the Arkhia dashboard
endpointsupported, health, settle, facilitateFacilitator endpoint

Example:

https://starter.arkhia.io/x402/testnet/YOUR_API_KEY/supported

🛠️ Prerequisites

  1. An Arkhia account with x402 access enabled
  2. A project created in the Arkhia Dashboard — the network will show x402 Payment
  3. Your project API key from the Project Details → Endpoints section
  4. A wallet with Sepolia USDC (testnet) or mainnet USDC for live payments

📡 Endpoints

GET /supported

Returns the payment schemes and networks the facilitator supports.

curl "https://starter.arkhia.io/x402/testnet/YOUR_API_KEY/supported"

Response:

{
"kinds": [
{ "x402Version": 1, "scheme": "exact", "network": "sepolia" },
{ "x402Version": 2, "scheme": "exact", "network": "eip155:11155111" }
]
}

GET /health

Check that the facilitator service is running.

curl "https://starter.arkhia.io/x402/testnet/YOUR_API_KEY/health"

Response:

{ "status": "ok" }

POST /settle

Submit a signed ERC-3009 authorization for on-chain settlement. This is the core endpoint of the x402 flow.


🔄 Settlement Flow

Your App → GET /supported → Get facilitator address & payment requirements
Your App → Sign ERC-3009 authorization (TransferWithAuthorization)
Your App → POST /settle → Arkhia proxy → x402 facilitator → Sepolia/mainnet USDC transfer

💻 Code Examples

# 1. Check supported schemes
curl "https://starter.arkhia.io/x402/testnet/YOUR_API_KEY/supported"

# 2. Submit a settlement (v1 format)
curl -X POST "https://starter.arkhia.io/x402/testnet/YOUR_API_KEY/settle" \
-H "Content-Type: application/json" \
-d '{
"x402Version": 1,
"paymentPayload": {
"x402Version": 1,
"scheme": "exact",
"network": "sepolia",
"payload": {
"authorization": {
"from": "0xPAYER_ADDRESS",
"to": "0xFACILITATOR_ADDRESS",
"value": "1000000",
"validAfter": 1700000000,
"validBefore": 1700003600,
"nonce": "0xRANDOM_NONCE_32_BYTES"
},
"signature": "0xSIGNED_ERC3009_SIGNATURE"
}
},
"paymentRequirements": {
"scheme": "exact",
"network": "sepolia",
"maxAmountRequired": "1000000",
"asset": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
"payTo": "0xFACILITATOR_ADDRESS"
}
}'

💳 Credit Tracking

All x402 requests are tracked in the Arkhia credit system:

  • Each request to the x402 proxy consumes credits from your plan
  • Usage is visible in the Analytics section of your Arkhia dashboard per project
  • x402 requests appear as API type X402 in the usage breakdown

🔍 Supported Networks

NetworkProtocol IdentifierEnvironment
Sepolia (EVM testnet)eip155:11155111 / sepoliaTestnet
Ethereum Mainneteip155:1Mainnet

❓ Troubleshooting

ErrorCauseFix
Unauthorized access to x402 Payment serviceProject not enabled for x402Contact support to enable x402 on your plan
ERC20: transfer amount exceeds balancePayer wallet has insufficient USDCFund the wallet with Sepolia USDC from the Circle faucet
x402 request body is requiredPOST body is empty or missingEnsure you send a valid JSON payload
x402 Payment request failedUpstream facilitator errorCheck your network selection and payment payload structure

📚 Resources