> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneshotagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Send your first email in under 5 minutes. The SDK handles wallet signing, payment flow, and job polling for you.

## Install the SDK

<Tabs>
  <Tab title="npm">`bash npm install @oneshot-agent/sdk `</Tab>
  <Tab title="bun">`bash bun add @oneshot-agent/sdk `</Tab>
  <Tab title="pip (Python)">`bash pip install langchain-oneshot `</Tab>
</Tabs>

## Send Your First Email

<Tabs>
  <Tab title="CDP Wallet (Recommended)">
    No private keys in your config. Signing happens in Coinbase's secure enclave.

    ```typescript theme={null}
    import { OneShot } from "@oneshot-agent/sdk";

    // Reads CDP_API_KEY_ID, CDP_API_KEY_SECRET, CDP_WALLET_SECRET from env
    const agent = await OneShot.create({ cdp: true });

    // The SDK handles quoting, payment signing, and job polling
    await agent.email({
      to: "recipient@example.com",
      subject: "Hello from OneShot",
      body: "This was sent autonomously.",
    });
    ```

    Get CDP credentials at [Coinbase Agentic Wallet](https://docs.cdp.coinbase.com/agentic-wallet/welcome).
  </Tab>

  <Tab title="Private Key">
    Direct wallet control for agents managing their own keys.

    ```typescript theme={null}
    import { OneShot } from "@oneshot-agent/sdk";

    const agent = new OneShot({
      privateKey: process.env.AGENT_PRIVATE_KEY,
    });

    await agent.email({
      to: "recipient@example.com",
      subject: "Hello from OneShot",
      body: "This was sent autonomously.",
    });
    ```
  </Tab>
</Tabs>

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

<Info>
  The SDK operates on **Base Mainnet** with real USDC. Fund your agent wallet before making paid tool calls.
</Info>

## What Just Happened

Under the hood, the SDK handled the [x402 payment protocol](/pricing):

```
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](/api-reference/email/quote) for raw endpoint docs.

## Try More Tools

```typescript theme={null}
// 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

```typescript theme={null}
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

<CardGroup cols={2}>
  <Card title="SDK Examples" icon="code" href="/sdk/examples">
    Email, voice, SMS, research, commerce, and build examples
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/email/quote">
    Raw endpoint docs for all tools
  </Card>

  <Card title="Pricing" icon="dollar-sign" href="/pricing">
    Cost per endpoint
  </Card>

  <Card title="LangChain (Python)" icon="python" href="/sdk/langchain">
    Python integration with 31 LangChain tools
  </Card>

  <Card title="MCP Server" icon="plug" href="/sdk/mcp">
    Use OneShot in Claude Desktop or Cursor
  </Card>
</CardGroup>
