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:
// Without SDK: Handle 402 responses, sign payments, poll jobs manually
// With SDK: One line
await agent.email({ to: "[email protected]", subject: "Hi", body: "Hello" });

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

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

ToolMethodDescription
Emailagent.email()Send emails with attachments
Voiceagent.voice()Place a phone call (quote-based)
SMSagent.sms()Send SMS messages (quote-based)

Inbox & Notifications

ToolMethodDescription
Email Inboxagent.inboxList()List inbound emails
Email Messageagent.inboxGet(id)Get a specific email by ID
SMS Inboxagent.smsInboxList()List inbound SMS messages
SMS Messageagent.smsInboxGet(id)Get a specific SMS by ID
Notificationsagent.notifications()List agent notifications
Mark Readagent.markNotificationRead(id)Mark notification as read

Person Intelligence

ToolMethodDescription
People Searchagent.peopleSearch()Search for people by criteria
Profile Enrichmentagent.enrichProfile()Enrich from LinkedIn/email
Email Finderagent.findEmail()Find email for a person
Email Verificationagent.verifyEmail()Verify email deliverability
Deep Research Personagent.deepResearchPerson()Full dossier on a person (2-5 min)
Social Profilesagent.socialProfiles()Find all social accounts for a person
Article Searchagent.articleSearch()Find articles about a person
Person Newsfeedagent.personNewsfeed()Recent social posts with engagement
Person Interestsagent.personInterests()Analyze interests across categories
Person Interactionsagent.personInteractions()Map followers, following, replies

Web & Research

ToolMethodDescription
Researchagent.research()Deep web research with sources
Web Searchagent.webSearch()Search the web, get results instantly
Web Readagent.webRead()Read any URL as markdown + screenshot
Browseragent.browser()Autonomous browser — navigate, click, extract (quote-based)
Browser Profileagent.createBrowserProfile()Create persistent browser profile (cookies/sessions)
List Profilesagent.listBrowserProfiles()List all browser profiles
Delete Profileagent.deleteBrowserProfile(id)Delete a browser profile

Commerce

ToolMethodDescription
Commerce Searchagent.commerceSearch()Search for products
Commerce Buyagent.commerceBuy()Purchase products (quote-based)

Build

ToolMethodDescription
Buildagent.build()Build and deploy production websites (quote-based)
Update Buildagent.updateBuild()Update an existing website (quote-based)

Utility

ToolMethodDescription
Wallet Balanceagent.getBalance(tokenAddress)Get USDC wallet balance
Universal Toolagent.tool(name, options)Call any OneShot tool by name

Compute — autonomous goal orchestration

MethodEndpointPaid?
agent.compute(options) / Python client.compute(...)POST /v1/compute✅ x402 quote-based
agent.getComputeGoal(goalId) / Python client.get_compute_goal(goal_id)GET /v1/compute/:id
agent.getComputeTasks(goalId) / Python client.get_compute_tasks(goal_id)GET /v1/compute/:id/tasks
agent.getComputeBudget(goalId) / Python client.get_compute_budget(goal_id)GET /v1/compute/:id/budget
agent.cancelComputeGoal(goalId, reason?) / Python client.cancel_compute_goal(goal_id, reason=None)POST /v1/compute/:id/cancel
agent.respondToComputeTask(goalId, input) / Python client.respond_to_compute_task(...)POST /v1/compute/:id/respond
agent.pauseComputeGoal(goalId, reason?) / Python client.pause_compute_goal(goal_id, reason=None)POST /v1/compute/:id/pause
agent.resumeComputeGoal(goalId) / Python client.resume_compute_goal(goal_id)POST /v1/compute/:id/resume
agent.fundComputeGoal(goalId, amount) / Python client.fund_compute_goal(goal_id, amount)POST /v1/compute/:id/fund✅ x402 quote-based
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. The same value is forwarded to the server as the X-Max-Cost-USDC header, so the API rejects the request with 400 exceeds_caller_budget before any payment is requested — the cap is enforced regardless of which client makes the call. 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. The API computes its usual quote and, if the total exceeds your cap, returns 400 exceeds_caller_budget instead of a 402 payment requirement — no payment authorization is ever requested.
curl -X POST https://win.oneshotagent.com/v1/tools/voice/call \
  -H "X-Agent-ID: 0x..." \
  -H "X-Max-Cost-USDC: 2.00" \
  -H "Content-Type: application/json" \
  -d '{"objective":"book a table","target_number":"+14155551234","max_duration_minutes":3}'
Rejected response shape:
{
  "error": "exceeds_caller_budget",
  "message": "Quote $2.500000 exceeds X-Max-Cost-USDC cap $2.00",
  "quote": { "total": "2.500000", "cap": "2.00" }
}
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

PackageRegistryLanguageTools
@oneshot-agent/sdknpmTypeScriptFull SDK with CDP wallet support
@oneshot-agent/mcp-servernpmTypeScript31 tools for Claude, Cursor, Claude Code
oneshot-pythonPyPIPythonCore HTTP client with x402 payments
langchain-oneshotPyPIPython32 LangChain BaseTool subclasses
game-plugin-oneshotPyPIPython12 tools for Virtuals GAME agents
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 32 LangChain tools

MCP Server

Use OneShot in Claude Desktop, Cursor, Claude Code

Virtuals GAME SDK

GAME plugin for Virtuals Protocol agents

Pricing

Pay-per-use pricing details