Skip to main content

What is the OneShot SDK?

The OneShot SDK handles the boring parts of agent commerce: signing payments, retrying on 402, polling async jobs, and tracking what your agent spent. You call agent.email(), the SDK handles the rest and gives you a receipt.
The SDK operates on Base Mainnet with real USDC. Fund your agent wallet before making paid tool calls.
  • Automatic x402 Payments: Signs and submits payment authorizations automatically
  • Pay with ETH or USDC: Hold ETH and the SDK auto-swaps to USDC via Uniswap V3 at payment time
  • Flexible Wallets: Coinbase CDP Server Wallets (recommended, no private keys) or raw private key via ethers.js
  • Job Polling: Waits for async jobs to complete
  • Built-in Audit Trail: Attach memo + decisionContext to every paid call — stored on the receipt for debugging and supervisor agents. See Audit Trail.
  • Type Safety: Full TypeScript support with proper types

Why Use the SDK?

For Humans

The SDK simplifies integration:

For AI Agents

The SDK is essential for autonomous agents:
  • No manual payment flow handling
  • Automatic retry logic for rate limits
  • Clean error messages
  • Minimal token usage in prompts

Quick Example

Key Features

Automatic Payments

SDK handles x402 payment flow automatically - no manual signing needed

Job Polling

Waits for async jobs to complete and returns results directly

Type Safety

Full TypeScript support with proper types for all tools

Flexible Wallets

Coinbase CDP Server Wallets (no private keys) or raw key via ethers.js

Pay with ETH

Auto-swap ETH→USDC via Uniswap V3 — no need to hold USDC

Read Authentication

Read endpoints — email/SMS inbox, notifications, balance, and browser profiles — return private, per-agent data. Because a wallet address is public, the API needs proof you actually control it, not just knowledge of the address (otherwise anyone could read your inbox by supplying your wallet). On every read call the SDK signs a short-lived EIP-712 read proof and sends it in the x-agent-proof header:
  • Typed data: domain { name: "OneShot Agent Auth", version: "1" }, type AgentReadAuth { agent: address, scope: "read", issuedAt: uint256, nonce: bytes32 }.
  • The server recovers the signer locally (ecrecover) and rejects the request unless the signer equals the X-Agent-ID wallet. A fresh nonce + short freshness window (5 min) prevent replay.
This is fully automatic — provide your wallet credentials (raw private key or a Coinbase CDP Server Wallet via cdp: true) and the SDK signs the proof for you.
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 which they must send a valid x-agent-proof — upgrade to stay ahead of it.

Supported Tools

Tools are grouped by category. Click a tool name to jump to its API reference. (quote-based) marks tools whose price varies per call and that accept a client-side maxCost guard — the SDK throws before signing if the quote exceeds your limit.

Communication

Inbox & Notifications

Person Intelligence

Web & Research

Commerce

Build

Utility

Compute — autonomous goal orchestration

The Python SDK has feature parity with the TypeScript SDK. Every method has an a* async mirror in Python (acompute, aget_compute_goal, …) for use inside asyncio programs.
Tools marked (quote-based) accept a maxCost option (and a memo + decisionContext for audit). The SDK compares the quoted price to maxCost and throws before signing any payment if it exceeds the limit. 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)

For non-SDK callers (raw HTTP, MCP server, Python SDK, custom integrations), set a per-request budget cap by sending the X-Max-Cost-USDC header. If the quoted total exceeds your cap, the request is rejected with 400 exceeds_caller_budget instead of a 402 payment requirement — no payment authorization is ever requested.
Rejected response shape:
Both numbers come back so the caller can decide whether to retry with a higher cap. The TS SDK (@oneshot-agent/sdk) and the Python SDK (oneshot-python ≥ 0.11.0) set this header automatically when you pass the maxCost / max_cost option — you don’t need to send it manually.

All SDKs and Packages

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