Skip to content

Agent SDK

@0xgasless/agent is a TypeScript client for building autonomous AI agents that hold stablecoins, pay merchants per call, and carry a verifiable on-chain identity — without ever storing a private key in your application.

Terminal window
npm install @0xgasless/agent
  • Server-managed wallets. Every agent has an EOA whose private key lives in 0xGasless KMS. Your code never sees a key.
  • x402 micropayments. Agents sign EIP-3009 TransferWithAuthorization for USDC on Avalanche, Fuji, and Base. Caps and policy are enforced server-side before any signature is produced.
  • No agent gas. The 0xGasless facilitator pays the on-chain gas for every settlement. Agents only need USDC to spend.
  • ERC-8004 identity. Mint a public on-chain identity NFT for each agent. Other contracts and dApps can look it up. 0xGasless sponsors the gas.
  • Audit log. Every verify and settle is recorded and queryable. Build compliance views without writing your own logging.
  • Multi-chain by default. Same SDK call, just change chain: 'base'.
Use caseFit
Autonomous AI agent that pays for APIs★★★★★
Telegram / Discord bot that buys things for users★★★★★
Background workers that settle micropayments★★★★★
End-user wallet for a consumer appUse Embedded Wallets instead
Smart-contract sponsored UserOpsUse Smart Accounts instead
@0xgasless/agent
┌──────────┼──────────┐
▼ ▼ ▼
Wallet Payment Identity
(KMS) (x402) (ERC-8004)

Each pillar maps cleanly to one resource on the client object:

PillarClient surface
Wallet & lifecycleclient.agents.*
Paymentsclient.x402.*, client.facilitator.*
Identityclient.identity.*
Policyclient.policy.*
  • Quickstart — install, create your first agent, send your first x402 payment, all under 5 minutes.
  • Agents — create, list, get, balance, revoke.
  • Payments — sign and settle x402 payments.
  • Policy — caps, tiers, project default vs agent override.
  • Identity — register agents on-chain (ERC-8004).
  • Activity — query verify + settle audit logs.
  • Errors — full error reference.
  • Migrating from v1 — for users of the legacy @0xgasless/agent-sdk.