Skip to main content

Install via npm/bun

bash npm install @oneshot-agent/sdk

Install via pip (Python)

If you’re building in Python, install the core SDK or the LangChain integration:
The core SDK gives you OneShotClient with the full x402 payment flow. Use this if you want direct HTTP access without a framework.
All Python packages use eth-account for local EIP-712 signing and httpx for HTTP. Your private key never leaves your machine.

Prerequisites

1

Wallet

A Coinbase CDP wallet (recommended) or a raw private key.
2

Funds

Fund your wallet with USDC or ETH on Base. The SDK can auto-swap ETH→USDC via Uniswap V3 at payment time.
3

Node.js

Version 18+ required.

Authentication

The SDK supports two wallet options for signing x402 payments:
The SDK operates on Base Mainnet with real USDC. Fund your agent wallet before making paid tool calls.

Environment Variables

Never commit secrets to version control! Use environment variables or a secrets manager.

Verify Installation

Pay with ETH

Don’t have USDC? The SDK can top up USDC from ETH via Uniswap V3 whenever your balance runs low. Just set currency: 'ETH':
Before each payment the SDK checks the wallet’s USDC (counting payments it has signed but that have not settled yet) and skips the swap when it covers the charge. When a swap is needed it buys swapBufferMultiplier × the charge (default 10, range 1–1000) via Uniswap V3’s exactOutputSingle on Base, so one swap covers many calls and any excess ETH is refunded; when the wallet provider exposes getBalance and its ETH cannot cover the buffer, it swaps just the shortfall (a send-only custom provider always gets the buffered amount). Run one process per wallet in ETH mode (each process keeps its own in-flight ledger). ETH mode is Base mainnet only. Requires a wallet provider that supports sendTransaction (private key or custom provider — CDP wallets don’t support ETH mode yet).

Advanced Configuration

Custom Wallet Provider

You can also bring your own WalletProvider implementation:
OneShot follows the x402 philosophy: it is designed to be chain and wallet agnostic. The SDK handles the cryptographic signing required for payment authorizations automatically.

TypeScript Configuration

If using TypeScript, ensure your tsconfig.json includes:
Source code: github.com/oneshot-agent/sdk

Next Steps

Examples

TypeScript code examples for email, research, and more

LangChain

Python LangChain integration with 34 tools