For agent developers

Your agent's wallet is one import away.

The OpenUSDC SDK gives your agents a safe, policy-bound wallet and the ability to transparently pay any x402-priced API in USDC. Five lines of code, four chains, zero key management.

install
$ npm i @openusdc/sdk
$ openusdc init --chain base
pay an api
import { openusdc } from "@openusdc/sdk";

// pays automatically on 402
const data = await openusdc.fetch(
  "https://api.partner.io/v1/score",
  { maxSpend: "0.01 USDC" }
);
SDK features

Built for code that runs unattended at 3am.

Policy-bound wallets

Provision a scoped wallet per agent run, per task, or per session. Set spend caps, allow-lists, time-bounded keys, and per-counterparty velocity limits — all enforced at sign time.

Automatic 402 retries

The SDK intercepts any HTTP response with status 402, signs an x402 payment header, and replays the request transparently. Your business logic stays clean.

Receipts & idempotency

Every settlement returns a signed, structured receipt with an idempotency key. Replays are safe; double-spends are impossible by construction.

Multi-chain routing

USDC on Base, Solana, Arbitrum, and Optimism. The router picks the cheapest live path at settlement time unless you pin a chain.

Local sandbox

A deterministic chain simulator runs in-process for tests and CI. No testnet faucets, no flakes.

Bring your own wallet

Use a Coinbase MPC wallet, a Privy embedded signer, a Turnkey vault, or a raw EOA. We abstract them under one signer interface.

Wallet policies

Spend caps, allow-lists, and time-bounded keys.

Every payment is checked against a policy before the signer is ever invoked. Policies are JSON, version-controlled, and attached to a wallet at provisioning time — so a runaway loop can never overspend.

  • Per-call, per-hour, and per-day spend caps
  • Counterparty allow-lists by domain or wallet address
  • Chain pinning and gas ceiling enforcement
  • Hardware-backed signers via Coinbase MPC and Turnkey
policy.json
{
  "wallet": "agent.research-bot.v3",
  "chain": "base",
  "caps": {
    "perCall":  "0.05 USDC",
    "perHour":  "5.00 USDC",
    "perDay":  "50.00 USDC"
  },
  "allow": [
    "*.openusdc.ai",
    "api.tavily.com",
    "search.brave.com"
  ],
  "revokeAt": "2026-12-31T00:00:00Z"
}

Ship an agent that pays its own bills, this week.

Drop the SDK in, ship a wallet policy alongside your prompt, point your agent at any x402 endpoint. We'll watch the settlements roll in together.