Give your agent a wallet that thinks like an API key.
Switch lets autonomous AI agents pay for tools, compute, and content with the same ease as making an HTTP call. Five-line integration, capability-scoped budgets, and cryptographic receipts on every transaction.
Daily budget · $5.00 USDC
Pay-per-call, in five lines.
Wrap any HTTP client. Switch handles 402 responses transparently — your agent sees the same response shape it would for a 200, with a payment receipt attached.
- Drop-in replacement for fetch / axios
- Spend caps, asset allow-lists, expiry
- Receipts as first-class Tool memory
- Open source under MIT
1import { Switch } from '@switch/sdk';2import { OpenAI } from 'openai';3 4const ai = new OpenAI();5const switch_ = new Switch({6 apiKey: process.env.SWITCH_KEY,7 budget: { max: '5.00', asset: 'USDC', period: '24h' },8 onSpend: (tx) => log.info('paid', tx.amount, tx.merchant),9});10 11const tools = [{12 name: 'forecast',13 description: 'Get weather for a region.',14 call: (args) =>15 switch_.fetch('https://api.example.com/forecast', {16 method: 'POST',17 body: JSON.stringify(args),18 }).then((r) => r.json()),19}];20 21await ai.responses.create({ model: 'gpt-5', tools, input: '...' });Built for the way agents actually transact.
Per-call wallets
Spin up an ephemeral, capability-scoped wallet per task. The agent can spend up to a budget, expire on a schedule, or restrict assets — no global keys at risk.
Verifiable receipts
Every settlement returns a signed receipt with the merchant ID, amount, and timestamp. Pipe it straight into your audit log or memory store.
Auto-routing
We pick the cheapest, fastest network for the asset and corridor — Solana, Base, Ethereum L2s, off-chain corridors — without your code knowing or caring.
Tool-call native
First-class adapters for OpenAI tools, Anthropic tools, LangChain, and the Model Context Protocol. The agent learns "spend" the same way it learns "fetch."
Pay any compute
Settle GPU, model inference, browser sessions, scrapers, and code-exec sandboxes by the unit. No prepaid credits, no monthly minimums.
Spend governance
Hard caps, soft caps, allow-lists, anomaly alerts, and a human-in-the-loop hook for any single payment over your threshold.