What is the OneShot SDK?
The SDK adds email, research, voice, web, and commerce tools to the agent you already run, on your current model, framework, and hosting. Callagent.email() from your own code and use the result in your workflow. The SDK signs payments and polls jobs. OneShot provides guaranteed execution: it owns execution, error recovery, and retries through completion.
Paid actions come with signed receipts and spend tracking. Attach memo + decisionContext to any paid call and both are stored on the receipt, for debugging and supervisor agents (see Audit Trail).
Add your first tool, or explore the supported tools.
The SDK operates on Base Mainnet with real USDC. Fund your agent wallet before making paid tool calls.
Why Use the SDK?
It collapses the payment flow into one call, for you and for the agent.For Humans
One call replaces the manual payment flow:For AI Agents
An autonomous agent gets:- The payment flow, handled for them
- Automatic retries on rate limits
- Clean error messages
- Minimal token usage in prompts
Quick Example
- CDP Wallet (Recommended)
- Private Key
Key Features
The SDK handles payment and polling, and the API enforces spend limits. Your agent code holds only the call.Automatic Payments
The SDK runs the x402 payment flow, including signing
Job Polling
Waits for async jobs and returns their results
Type Safety
TypeScript types for all tools
Flexible Wallets
Coinbase CDP Server Wallets (recommended, no private keys) or a raw key via ethers.js
Pay with ETH
Tops up USDC from ETH via Uniswap V3 when the balance runs low, so you don’t need to hold USDC
Spend Budgets
Daily and per-call caps enforced server-side, so the agent stops before the wallet empties
Read Authentication
Read calls prove you control the wallet, and the SDK signs that proof for you. Read endpoints (email/SMS inbox, notifications, balance, and browser profiles) return private, per-agent data. A wallet address is public; without the proof, anyone could read your inbox by supplying your address. On every read call the SDK signs a short-lived EIP-712 read proof and sends it in thex-agent-proof header:
- Typed data: domain
{ name: "OneShot Agent Auth", version: "1" }, typeAgentReadAuth { agent: address, scope: "read", issuedAt: uint256, nonce: bytes32 }. - The server recovers the signer locally (
ecrecover) and rejects the request unless the signer equals theX-Agent-IDwallet. A fresh nonce and a short freshness window (5 min) prevent replay.
cdp: true) and the SDK handles the rest.
Requires TypeScript SDK ≥ 0.25.0 or
oneshot-python ≥ 0.17.0 (and @oneshot-agent/sdk ≥ 0.25.0 for the MCP server). Older SDKs and raw HTTP callers keep working until the API turns on enforcement. After that they must send a valid x-agent-proof, so upgrade before then.Supported Tools
Every tool is a method onagent. Tool names link to their API reference. (quote-based) marks tools whose price varies per call. They accept a client-side maxCost guard, and the SDK throws before signing if the quote exceeds it.
Communication
Inbox & Notifications
Person Intelligence
Web & Research
Commerce
Build
Utility
Compute: autonomous goal orchestration
Goal IDs are UUIDs. Reads (goal, tasks, budget) send a signed read proof and lifecycle calls (cancel, respond, pause, resume) a signed write proof; the SDK adds both. Pause, resume, and fund work on recurring goals only (created with
schedule). Unspent budget comes back as OneShot credits when a goal ends. See Create Goal.
The Python SDK matches the TypeScript SDK, including access-token sessions (OneShotClient.create(access_token=...), oneshot-python ≥ 0.26.0). Every Python method has an a* async mirror (acompute, aget_compute_goal, …) for asyncio programs.
Tools marked (quote-based) accept a
maxCost option (and memo + decisionContext for audit). If the quoted price exceeds maxCost, the SDK throws before signing any payment. Non-SDK callers can set the same cap with the X-Max-Cost-USDC header; see Server-side cost cap below. All other tools have fixed low-cost pricing.Server-side cost cap (X-Max-Cost-USDC)
A request priced over its X-Max-Cost-USDC cap fails before any payment is requested. Non-SDK callers (raw HTTP, MCP server, Python SDK, custom integrations) set the header themselves. If the quoted total exceeds the cap, the API returns 400 exceeds_caller_budget instead of a 402 payment requirement.
@oneshot-agent/sdk) and the Python SDK (oneshot-python ≥ 0.11.0) set this header when you pass the maxCost / max_cost option.
Spend Budgets
maxCost guards one call. A spend budget guards the wallet: a daily cap (UTC day) and a per-call cap, stored per agent and enforced by the API against the receipt ledger. The total therefore holds across every process, restart, and serverless invocation using the same wallet. Concurrent paid calls are serialized through an atomic in-flight reservation (Redis). If Redis is unavailable, the guard falls back to a best-effort ledger check instead of blocking payments.
alertAt you get a budget_warning notification (in-app, plus email if set). At pauseAt, paid calls fail with a typed error until the window resets at the next UTC midnight:
budgets to leave the server-side setting untouched. Agents without a budget are unlimited. The sync fails closed: if the server can’t confirm the budget, the paid call raises BudgetSyncError and is not made (the sync retries on the next call), because proceeding would silently drop the guardrail. An invalid config throws ValidationError at construction. The MCP server reads the same config from ONESHOT_BUDGET_* environment variables. Every agent framework package exposes a read-only oneshot_budget_status tool, so the agent can plan around its remaining budget but never raise it. Full contract: Spend Budgets API.
Requires TypeScript SDK ≥ 0.27.0 or
oneshot-python ≥ 0.20.0. The budget endpoints always require the signed read proof.All SDKs and Packages
Five packages, one API. Pick by language and framework.
Source: github.com/oneshot-agent/sdk
Next Steps
Installation
Install and configure the SDK (TypeScript + Python)
Examples
TypeScript code examples
LangChain (Python)
Python integration with 31 LangChain tools
MCP Server
Use OneShot in Claude Desktop, Cursor, Claude Code
Virtuals GAME SDK
GAME plugin for Virtuals Protocol agents
Agent Skills
Install OneShot skills into Claude Code, Cursor, and 70+ agents
Pricing
Pay-per-use pricing details