# Dexter — full reference > A spending limit your agent can't exceed. Dexter Tabs let an AI agent spend real USDC, metered per call and capped on-chain — the money never leaves the owner's wallet, and the seller is paid per call without being drained mid-stream. Non-custodial, enforced by a Solana program, not by a company. Live on mainnet. This is the full reference for agents and integrators. The short index is at https://dexter.cash/llms.txt. ## What a tab is A tab is one spending authorization with a hard cap, opened by an owner over a non-custodial passkey vault. An agent spends within the cap across many small charges — model calls, tool calls, GPU-seconds, messages — consumed as the work happens. The seller meters each call. What's been accrued is crystallized and **reserved on-chain** (lock-mode): the owner can withdraw the rest of their balance any time, but cannot claw back what's already owed; the seller is guaranteed payment for what it served and cannot be drained mid-stream. Neither side can rug the other. Tabs are for spend that accumulates — tokens, GPU-seconds, message volume — where a cap and drain-protection matter. Cheap one-off lookups are better served by simple per-call x402 (see the Facilitator) or the x402gle catalog. ## The tab lifecycle 1. **Open** — the owner opens a tab with a cap and an expiry over their passkey vault. Money stays in the owner's wallet. 2. **Meter** — the seller meters each call (per token, per GPU-second, per send) using `tabOrExactMiddleware` / `x402Middleware`. 3. **Reserve** — accrued amounts crystallize and reserve on-chain (lock-mode reservation). The reservation guard blocks any owner withdrawal that would dip into what's owed. 4. **Settle** — on close, the seller is paid the reserved amount. Drain-proof in both directions. ## Build it — the canonical v4 surface Install: `npm i @dexterai/x402` (current major: `@dexterai/x402@4`). Buyer (any agent / Node): ```ts import { payAndFetch, createKeypairWallet } from '@dexterai/x402/client'; const solana = await createKeypairWallet(process.env.AGENT_KEY!); const result = await payAndFetch('https://seller.example/v1/chat', { method: 'POST', body: JSON.stringify({ messages, max_tokens: 512 }), }, { solana }); if (result.ok) console.log(await result.response.json()); ``` Seller (Express) — `tabOrExactMiddleware` advertises a tab and a one-shot exact price in one 402, so tab buyers pay by tab and one-shot callers pay exact, at the same `perUnit` price. The buyer's tab caps cumulative spend across calls: ```ts import { Connection } from '@solana/web3.js'; import { tabOrExactMiddleware } from '@dexterai/x402/tab/seller'; const connection = new Connection(process.env.SOLANA_RPC_URL!); app.post('/v1/chat', tabOrExactMiddleware({ connection, sellerPubkey: process.env.SELLER_SOLANA_ADDRESS!, network: 'solana:mainnet', perUnit: '0.002', // USDC per call }), (req, res) => res.json(/* served content */), ); ``` Removed in v4 (do not use): `createX402Client`, `wrapFetch`, `x402AccessPass`, `x402BrowserSupport`, `createDynamicPricing`, `formatPricing`, `stripePayTo`, `useAccessPass`, and the hardcoded token/model pricing helpers (`createTokenPricing`, `MODEL_REGISTRY`). Price per request from your model provider's live API instead. EVM one-shot pay-per-call is unchanged (`payAndFetch` is the EVM path until Tabs reaches EVM). ## Use cases (worked examples) - **LLM inference (pay-per-token)** — https://dexter.cash/examples/llm-inference — meter completions per token; the tab caps total spend so a runaway loop or bad prompt can't drain the owner. Buyers open/fund a tab via the hosted passkey flow, then call the inference API. - **GPU rental (pay-per-second)** — https://dexter.cash/examples/gpu-rental — bill per GPU-second as a job runs; the tab caps the run and reserves what's accrued, so an overrun stops at the limit, not the balance. - **Push & messaging (pay-per-send)** — https://dexter.cash/examples/push — charge per message at high volume; metered micro-spend that can't be over-billed by a buyer or stiffed after delivery. ## Open and fund a tab The owner uses the hosted, non-custodial passkey wallet at https://dexter.cash/tabs — a real on-chain USDC vault authorized by Face ID. One vault holds many concurrent tabs, each with its own cap, expiry, and counterparty, all enforced on-chain. ## Proven on mainnet Program `Hg3wRaydFtJhYrdvYrKECacpJYDsC9Px7yKmpncj2fhc` on Solana mainnet. Committed, public, pointable receipts: - Drain-protection kill-move (seller paid, buyer can't rug mid-tab; reservation guard 0x1781) and the credit/standby surface — https://github.com/Dexter-DAO/dexter-vault-sdk/tree/main/scripts/receipts - The full draw/repay/seize credit lifecycle is exercised on the same live program. Program is pre-audit; audit funding in flight — disclose plainly. ## The rails underneath - **Facilitator** (https://dexter.cash/facilitator) — x402 settlement across 8 chains. - **OpenDexter** (https://dexter.cash/opendexter) — a non-custodial hosted MCP with a passkey smart wallet that drops into Claude, ChatGPT, or any MCP host. - **x402gle** (https://x402gle.com) — semantic search over the paid-API catalog. - **Instinct** (https://x402ads.io) — next-step recommendations for agents (ads for agents). ## SDKs - `@dexterai/x402` (npm) — the front-door SDK partners install: buyer `payAndFetch`, seller `x402Middleware` / `tabOrExactMiddleware`. Source: https://github.com/Dexter-DAO/dexter-x402-sdk - `@dexterai/vault` (npm) — the engine (vault + tab + credit builders). Source: https://github.com/Dexter-DAO/dexter-vault-sdk