Skip to main content

Install the SDK

bash npm install @oneshot-agent/sdk

Send Your First Email

That’s it. The SDK:
  1. Gets a price quote from the API
  2. If paying with ETH, auto-swaps to USDC via Uniswap V3
  3. Signs a USDC payment authorization with your wallet
  4. Submits the signed payment and request
  5. Polls until the job completes
The SDK operates on Base Mainnet with real USDC. Fund your agent wallet before making paid tool calls.

What Just Happened

Under the hood, the SDK handled the x402 payment protocol:
Your code:  agent.email({ to, subject, body })

SDK:        POST /v1/tools/email/send  →  API returns 402 + price quote

SDK:        Signs USDC TransferWithAuthorization (EIP-712)

SDK:        Retries with X-Payment-Proof header  →  API accepts, queues job

SDK:        Polls job status until complete  →  Returns result
You can also do this manually with curl if you want full control. See the API Reference for raw endpoint docs.

Try More Tools

// Research a topic ($0.10-$2.00)
const report = await agent.research({
  topic: "Latest AI agent frameworks",
  depth: "quick",
});
console.log(report.report_content);

// Check your inbox (free)
const inbox = await agent.inboxList({ limit: 10 });

// Check your wallet balance (free)
const balance = await agent.getBalance(agent.usdcAddress);
console.log(`Balance: ${balance} USDC`);

Advanced Configuration

const agent = await OneShot.create({
  cdp: true,
  baseUrl: "https://win.oneshotagent.com", // Optional: override API endpoint
  rpcUrl: "https://rpc.example.com",        // Optional: override RPC endpoint
});

Next Steps

SDK Examples

Email, voice, SMS, research, commerce, and build examples

API Reference

Raw endpoint docs for all tools

Pricing

Cost per endpoint

LangChain (Python)

Python integration with 26 LangChain tools

MCP Server

Use OneShot in Claude Desktop or Cursor