Passer au contenu principal
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..."
}

Documentation Index

Fetch the complete documentation index at: https://docs.agentwallex.com/llms.txt

Use this file to discover all available pages before exploring further.

Negociez et completez un paiement x402 pour une URL cible. AgentWallex evalue les politiques de l’agent, signe le paiement via MPC et renvoie les informations de paiement necessaires pour acceder a la ressource payante.

Corps de la requete

agent_id
string
requis
L’agent dont le portefeuille financera le paiement.
target_url
string
requis
L’URL compatible x402 a payer (par ex., https://paid-api.example.com/v1/data).
session_id
string
ID de session optionnel pour deduire d’un budget de session existant. Consultez Sessions x402.
chain
string
Identifiant de chaine CAIP-2 pour le reglement du paiement (par ex., eip155:84532). Si omis, la chaine par defaut de l’agent est utilisee.

Reponse

Exemple

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..."
}

Points de terminaison associes

Point de terminaisonDescription
POST /x402/checkVerifier si une URL supporte la negociation de paiement x402
POST /x402/facilitator/verifyVerifier une signature de paiement (pour les fournisseurs de services)
POST /x402/facilitator/settleRegler un paiement verifie (pour les fournisseurs de services)
GET /x402/facilitator/supportedLister les chaines supportees pour x402
GET /x402/fees/tiersObtenir la grille tarifaire actuelle

Autorisations

X-API-Key
string
header
requis

API key authentication. Keys are prefixed with awx_.

Corps

application/json
agent_id
string
requis

The agent whose wallet will fund the payment.

target_url
string<uri>
requis

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.

Réponse

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.

Options disponibles:
completed,
pending,
failed
payment_signature
string

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