Developer docs.
Autonomous HTTP 402 payment rails, bounded agent sub-wallets, and instant USDC settlement on Base L2. Operators control spend deterministically while agents buy compute, data, and goods without human forms.
Direct markdown documentation optimized for Claude, Cursor, Devin, and autonomous agents.
1. How It Works
Choose your perspective to view the integration lifecycle.
Deposit Vault Liquidity
Deposit native USDC on Base L2 using your mobile wallet QR code. Individual agents spend against this balance but never access master private keys.
Set SpendGuard Policy
Issue scoped API keys with hard rules: rolling daily cap (e.g. $25.00/day), per-transaction ceiling (e.g. $5.00/tx), and master kill switch protection.
Connect via REST API
Give your agent its Bearer API key and wrap its HTTP calls in bareFetch. It never holds a wallet or private key.
Autonomous 402 Settlement
When a merchant answers HTTP 402, bare. checks the agent's limits, the vault signs a USDC authorization, and the merchant settles it on Base. Every payment has a real tx hash.
2. Implementation Snippets
Copy-paste configurations for agent runners, middleware gates, and store bridges.
// Pay any x402 (HTTP 402) merchant with real USDC, inside your SpendGuard limits
// curl -O https://bare.money/sdk/bare.js (one file, no dependencies)
import { bareFetch } from './bare.js';
const res = await bareFetch('https://merchant.example/api/report', {
agentKey: process.env.BARE_AGENT_KEY, // bm_sk_live_...
onPayment: ({ amountUsdc, payTo, transaction }) =>
console.log(`Paid ${amountUsdc} USDC to ${payTo} in tx ${transaction}`)
});
if (res.ok) {
console.log(await res.json());
} else {
// SpendGuard rejections carry machine-readable remediation
const body = await res.json();
console.error(body.code, body.spendguard?.remediation?.suggested_action);
}3. Order Tracking and Asset Access
How autonomous agents query fulfillment updates and retrieve digital assets.
Query Order Status
Call GET /api/v1/orders/:orderId with Bearer authorization. The endpoint returns live status (paid, fulfilled, or processing), Base L2 tx hash, receipt ID, and shipping details.
Digital Asset Delivery Stream
For digital goods, call GET /api/v1/orders/:orderId/download to retrieve the license token, API credentials, or file attachment with an authenticated download token.
4. Merchant HTTP 402 Middleware
Protect APIs, compute resources, and services with 3-line drop-in HTTP 402 middleware.
Challenge Unpaid Traffic
Unpaid requests get HTTP 402 with a base64 PAYMENT-REQUIRED header: price in USDC atomic units, token contract, network and your receiving address (x402 v2).
Settlement Verification
The retry carries PAYMENT-SIGNATURE, a signed EIP-3009 authorization. The facilitator checks the signature and balance, settles it on-chain, and only then does your handler run. The response carries PAYMENT-RESPONSE with the tx hash.
5. E-Commerce Store Bridges
Enable autonomous AI agent shopping on Shopify, WooCommerce, and BigCommerce stores.
Shopify Bridge
App ProxyStandalone micro-bridge querying Shopify Admin GraphQL API. Maps products to /.well-known/bare-products.json and creates paid orders on Base L2 USDC settlement.
Download paused: this plugin is being rebuilt on the x402 flow and is not available yet.
WooCommerce
WordPressNative WordPress plugin. Exports machine-readable catalog, exposes ?wc-api=bare_checkout for HTTP 402 purchases, and marks orders processing upon on-chain verification.
Download paused: this plugin is being rebuilt on the x402 flow and is not available yet.
BigCommerce
REST V2/V3Micro-bridge integrating V3 Catalog and V2 Orders APIs. Responds with HTTP 402 to agents and writes Awaiting Fulfillment orders with tx notes upon USDC receipt.
Download paused: this plugin is being rebuilt on the x402 flow and is not available yet.
6. Agent Pairing
New agents request access; a human operator approves them and sets their limits.
Request Pairing
POST /api/v1/agents/pair with the vault id, agent name, role and requested limits. The request appears in Bare Cloud for that vault's owner.
Poll for Approval
Poll GET /api/v1/agents/pair/status?token=<pairingToken>. Once approved, the response contains the API key. Anonymous self-registration is off by default, since anyone could otherwise spend from the vault.
7. SpendGuard Invariants
Deterministic safety constraints enforced before every on-chain settlement.
Master Kill Switch
Hard BlockWhen armed, all incoming checkout requests across all agents immediately return HTTP 403 Forbidden. No funds can move under any circumstances.
Per-Agent Daily Limits
24h Rolling BudgetEach agent is allocated a dedicated daily ceiling. Once cumulative spending reaches this threshold, subsequent checkouts fail with HTTP 403 until the budget resets at 00:00 UTC.
Single Transaction Cap
Per-Request CeilingProtects against rogue high-cost requests. Even if an agent has a $100 daily limit, a single transaction cap of $5.00 guarantees no individual purchase can exceed $5.00.
Physical Shipping Protection
Physical OrdersItems flagged as physical in the merchant catalog require full shipping recipient, street, city, postal code, and country payload during checkout. Requests missing shipping details are rejected with HTTP 400.
8. Network Specifications
Live configuration of this deployment.