Direct wallet control for agents managing their own keys.
import { OneShot } from "@oneshot-agent/sdk";const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY,});await agent.email({ to: "[email protected]", subject: "Hello from OneShot", body: "This was sent autonomously.",});
That’s it. The SDK:
Gets a price quote from the API
If paying with ETH, auto-swaps to USDC via Uniswap V3
Signs a USDC payment authorization with your wallet
Submits the signed payment and request
Polls until the job completes
The SDK operates on Base Mainnet with real USDC. Fund your agent wallet before making paid tool calls.
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.