Skip to main content
POST
/
api
/
v1
/
x402
/
pay
x402 Pay
curl --request POST \
  --url https://api.agentwallex.com/api/v1/x402/pay \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "agent_id": "agent_abc123",
  "target_url": "https://paid-api.example.com/v1/data",
  "session_id": "sess_xyz789",
  "chain": "eip155:84532"
}
'
{
  "ledger_id": "ldg_abc123",
  "amount": "0.10",
  "fee_amount": "0.002",
  "fee_rate": "2.0",
  "token": "USDC",
  "chain": "eip155:84532",
  "status": "completed",
  "payment_signature": "base64_encoded_signature..."
}
Negotiate and complete one x402 payment for a target URL. AgentWallex evaluates the agent’s policies, signs the payment via MPC, and returns the payment info needed to access the paid resource.

Request Body

agent_id
string
required
The agent whose wallet will fund the payment.
target_url
string
required
The x402-enabled URL to pay for (e.g., https://paid-api.example.com/v1/data).
session_id
string
Optional session ID to deduct from an existing session budget. See x402 Sessions.
chain
string
CAIP-2 chain identifier for payment settlement (e.g., eip155:84532). If omitted, the agent’s default chain is used.

Response

Example

curl -X POST https://api.agentwallex.com/api/v1/x402/pay \
  -H "X-API-Key: awx_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agent_abc123",
    "target_url": "https://paid-api.example.com/v1/data",
    "session_id": "sess_xyz789",
    "chain": "eip155:84532"
  }'
Response
{
  "ledger_id": "ldg_abc123",
  "amount": "0.10",
  "fee_amount": "0.002",
  "fee_rate": "2.0",
  "token": "USDC",
  "chain": "eip155:84532",
  "status": "completed",
  "payment_signature": "base64_encoded_signature..."
}
EndpointDescription
POST /x402/checkCheck if a URL supports x402 payment negotiation
POST /x402/facilitator/verifyVerify a payment signature (for service providers)
POST /x402/facilitator/settleSettle a verified payment (for service providers)
GET /x402/facilitator/supportedList supported chains for x402
GET /x402/fees/tiersGet current fee tier schedule

Authorizations

X-API-Key
string
header
required

API key authentication. Keys are prefixed with awx_.

Body

application/json
agent_id
string
required

The agent whose wallet will fund the payment.

target_url
string<uri>
required

The x402-enabled URL to pay for (e.g., https://paid-api.example.com/v1/data).

session_id
string

Optional session ID to deduct from an existing session budget.

chain
string

CAIP-2 chain identifier for payment settlement (e.g., eip155:84532). If omitted, the agent's default chain is used.

Response

Payment completed successfully.

Result of an x402 payment negotiation.

ledger_id
string

Internal ledger entry ID for this payment.

amount
string

Payment amount.

fee_amount
string

Platform fee deducted.

fee_rate
string

Fee percentage applied (based on tiered pricing).

token
string

Token used for payment (e.g., USDC).

chain
string

Chain used for settlement.

status
enum<string>

Payment status.

Available options:
completed,
pending,
failed
payment_signature
string

The PAYMENT-SIGNATURE value to include in the retry request to the target URL.