Dashboard
Billing

x402 payments

Recover resource access with signed USDC payment.

x402 lets an agent or trusted runtime recover model access when prepaid balance is unavailable. The client signs the payment requirement, HALO verifies and credits the settlement, then the request is retried.

#Payment flow

  1. 1
    Receive 402

    The gateway returns a payment requirement before model dispatch.

  2. 2
    Sign authorization

    A trusted wallet signs the required EIP-712 USDC authorization on the configured network.

  3. 3
    Retry with proof

    The client resends the request withPayment-Signature.

  4. 4
    Settle and execute

    HALO atomically applies eligible credit before dispatching the paid request.

#Headers

HeaderPurpose
Payment-SignatureSigned x402 payment proof
x-halo-rescue: trueRequest the bounded rescue judge path when eligible
x-payment-txLegacy manual recovery header; rejected by current flow

#SDK automation

The Node.js and Python SDKs include a model wrapper for automatic payment and lower-level tools for TEE or custom decision logic.

import { haloSystem } from "agihalo-node-sdk";

const paidModel = haloSystem(model, {
  privateKey: secureWalletPrivateKey,
  apiKey: HALO_API_KEY,
});

const result = await paidModel.generateContent("Continue the task");

#Settlement recovery

Current settlement recovery is automatic. Do not copy a transaction ID to a different client key or retry through the legacyx-payment-tx path. If a settlement is still being reconciled, wait and retry the original workload.