Switch for agents

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.

Agent · ops-bot-v3

Daily budget · $5.00 USDC

Spent today
$2.63
Calls
1,958
Status
Within cap
Inference (gpt-5)$1.42 · 1842 calls
Browser sessions$0.86 · 12 calls
Search API$0.31 · 96 calls
Vector retrieval$0.04 · 8 calls
The SDK

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
agent.ts
ts
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: '...' });
Capabilities

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.

Get started

Your agent makes its first paid call before you finish your coffee.