Skip to content

Settle via xerpaai-go

Goal: move from dry-run to real settlement through the xerpaai-go /user/onchainos/* API. xpense never signs or holds keys — it calls that API with a scoped JWT.

Steps

  1. Authenticateawait xpense.login() (see Authentication).
  2. Set modeXAGENT_PI_MODE=live (or new Xpense({ mode: "live" })). Only live settles real money.
  3. Get the gatewayconst gw = await xpense.gateway(). JWT is injected and auto-refreshed.
  4. Check the walletawait gw.walletStatus().
  5. Settlegw.x402Sign(...) for HTTP-402 resources, or gw.mppCharge(...) for machine-payment deduction.
ts
const gw = await xpense.gateway();

await gw.walletStatus();
const signed = await gw.x402Sign({ accepts, resource: "/api/inference" });
const charged = await gw.mppCharge({ challenge });

Covered endpoints

wallet/{status,login,verify,addresses,balance,logout} · x402/sign · mpp/charge · default-asset/{get,set,unset}.

Endpoints xerpaai-go has not built are not stubbed here.

Reference: OnchainosGateway · submitPaymentIntent.

Proprietary software. All rights reserved.