> ## 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.

# LangChain (Python)

> Use all 31 OneShot tools as LangChain tools in your Python agents

## Overview

`langchain-oneshot` is a Python package that wraps all 31 OneShot tools as LangChain `BaseTool` subclasses. It handles x402 payment signing automatically so your LangChain or LangGraph agents can send emails, make phone calls, run research, buy products, and more.

<Info>
  This package ports the same HTTP + x402 payment flow from the [TypeScript SDK](/sdk/overview) into Python, using `eth-account` for EIP-712 signing and `httpx` for HTTP.
</Info>

## Installation

```bash theme={null}
pip install langchain-oneshot
```

### Requirements

* Python 3.10+
* A wallet private key (for x402 payment signing)
* USDC on Base Mainnet

### Dependencies

| Package          | Purpose                           |
| ---------------- | --------------------------------- |
| `langchain-core` | BaseTool / BaseToolkit interfaces |
| `eth-account`    | EIP-712 typed data signing        |
| `httpx`          | Async HTTP client                 |
| `pydantic`       | Input schema validation           |

## Quick Start

### With LangGraph Agent

```python theme={null}
from langchain_oneshot import OneShotToolkit
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

toolkit = OneShotToolkit.from_private_key(
    private_key="0x...",
)

# All 31 tools, ready to go
tools = toolkit.get_tools()

# Wire into any LangChain-compatible agent
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, tools)

result = agent.invoke({
    "messages": [("user", "Research the latest AI agent frameworks")]
})
```

### Individual Tools

```python theme={null}
from langchain_oneshot import OneShotClient, ResearchTool

client = OneShotClient(private_key="0x...")
research = ResearchTool(client=client)
result = research.invoke({"topic": "AI agent frameworks 2026"})
```

## Configuration

```python theme={null}
toolkit = OneShotToolkit.from_private_key("0x...")

# Debug logging
toolkit = OneShotToolkit.from_private_key("0x...", debug=True)
```

| Parameter     | Default    | Description                    |
| ------------- | ---------- | ------------------------------ |
| `private_key` | *required* | Hex-encoded wallet private key |
| `base_url`    | `None`     | Override API URL               |
| `debug`       | `False`    | Print debug logs               |

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

## Available Tools

<Info>See [Pricing](/pricing) for current tool costs.</Info>

### Communication

| Tool Class  | Tool Name       | Description       |
| ----------- | --------------- | ----------------- |
| `EmailTool` | `oneshot_email` | Send emails       |
| `VoiceTool` | `oneshot_voice` | Make phone calls  |
| `SmsTool`   | `oneshot_sms`   | Send SMS messages |

### Research & Enrichment

| Tool Class          | Tool Name                | Description                        |
| ------------------- | ------------------------ | ---------------------------------- |
| `ResearchTool`      | `oneshot_research`       | Deep web research with sources     |
| `PeopleSearchTool`  | `oneshot_people_search`  | Search by title, company, location |
| `EnrichProfileTool` | `oneshot_enrich_profile` | Enrich profile from LinkedIn/email |
| `FindEmailTool`     | `oneshot_find_email`     | Find email at a company            |
| `VerifyEmailTool`   | `oneshot_verify_email`   | Verify email deliverability        |

### Person Intelligence

| Tool Class               | Tool Name                      | Description                         |
| ------------------------ | ------------------------------ | ----------------------------------- |
| `DeepResearchPersonTool` | `oneshot_deep_research_person` | Full dossier on a person (2-5 min)  |
| `SocialProfilesTool`     | `oneshot_social_profiles`      | Find all social accounts            |
| `ArticleSearchTool`      | `oneshot_article_search`       | Find articles about a person        |
| `PersonNewsfeedTool`     | `oneshot_person_newsfeed`      | Recent social posts with engagement |
| `PersonInterestsTool`    | `oneshot_person_interests`     | Analyze interests across categories |
| `PersonInteractionsTool` | `oneshot_person_interactions`  | Map followers, following, replies   |

### Browser

| Tool Class                 | Tool Name                        | Description                                   |
| -------------------------- | -------------------------------- | --------------------------------------------- |
| `BrowserTool`              | `oneshot_browser`                | Autonomous browser — navigate, click, extract |
| `BrowserCreateProfileTool` | `oneshot_browser_create_profile` | Create persistent browser profile             |
| `BrowserListProfilesTool`  | `oneshot_browser_list_profiles`  | List all browser profiles                     |
| `BrowserDeleteProfileTool` | `oneshot_browser_delete_profile` | Delete a browser profile                      |

### Web

| Tool Class      | Tool Name            | Description                           |
| --------------- | -------------------- | ------------------------------------- |
| `WebSearchTool` | `oneshot_web_search` | Search the web, get results instantly |

### Commerce

| Tool Class           | Tool Name                 | Description         |
| -------------------- | ------------------------- | ------------------- |
| `CommerceSearchTool` | `oneshot_commerce_search` | Search for products |
| `CommerceBuyTool`    | `oneshot_commerce_buy`    | Purchase a product  |

### Build

| Tool Class        | Tool Name              | Description               |
| ----------------- | ---------------------- | ------------------------- |
| `BuildTool`       | `oneshot_build`        | Build and deploy websites |
| `UpdateBuildTool` | `oneshot_update_build` | Update existing website   |

### Inbox

| Tool Class         | Tool Name                | Description          |
| ------------------ | ------------------------ | -------------------- |
| `InboxListTool`    | `oneshot_inbox_list`     | List received emails |
| `InboxGetTool`     | `oneshot_inbox_get`      | Get email by ID      |
| `SmsInboxListTool` | `oneshot_sms_inbox_list` | List received SMS    |
| `SmsInboxGetTool`  | `oneshot_sms_inbox_get`  | Get SMS by ID        |

### Account

| Tool Class                 | Tool Name                        | Description            |
| -------------------------- | -------------------------------- | ---------------------- |
| `NotificationsTool`        | `oneshot_notifications`          | List notifications     |
| `MarkNotificationReadTool` | `oneshot_mark_notification_read` | Mark notification read |
| `GetBalanceTool`           | `oneshot_get_balance`            | Get USDC balance       |

## Examples

### Send an Email

```python theme={null}
from langchain_oneshot import OneShotClient, EmailTool

client = OneShotClient(private_key="0x...")
email = EmailTool(client=client)

result = email.invoke({
    "to": "john@example.com",
    "subject": "Meeting Tomorrow",
    "body": "Hi John, let's meet at 3pm instead. Thanks!"
})
```

### Deep Research

```python theme={null}
from langchain_oneshot import OneShotClient, ResearchTool

client = OneShotClient(private_key="0x...")
research = ResearchTool(client=client)

result = research.invoke({
    "topic": "State of AI agent frameworks in 2026",
    "depth": "deep"
})
```

### Find and Verify an Email

```python theme={null}
from langchain_oneshot import OneShotClient, FindEmailTool, VerifyEmailTool

client = OneShotClient(private_key="0x...")

# Find someone's email
finder = FindEmailTool(client=client)
found = finder.invoke({
    "full_name": "Jane Smith",
    "company_domain": "acme.com"
})

# Verify it's deliverable
verifier = VerifyEmailTool(client=client)
verified = verifier.invoke({"email": "jane.smith@acme.com"})
```

### Build a Website

```python theme={null}
from langchain_oneshot import OneShotClient, BuildTool

client = OneShotClient(private_key="0x...")
build = BuildTool(client=client)

result = build.invoke({
    "product": {
        "name": "Acme Analytics",
        "description": "Real-time analytics dashboard for modern teams"
    },
    "type": "saas",
    "lead_capture": {"enabled": True}
})
```

### Browser with Persistent Profile

```python theme={null}
from langchain_oneshot import OneShotClient, BrowserTool, BrowserCreateProfileTool

client = OneShotClient(private_key="0x...")

# Create a profile
create = BrowserCreateProfileTool(client=client)
profile = create.invoke({"name": "my-scraper"})

# Use it in a browser task with credentials
browser = BrowserTool(client=client)
result = browser.invoke({
    "task": "Go to github.com/notifications and list unread items",
    "profile_id": profile["id"],
    "secrets": {"github.com": "user:ghp_token"},
    "allowed_domains": ["github.com"],
})
```

### Full Agent with Selective Tools

```python theme={null}
from langchain_oneshot import (
    OneShotClient,
    EmailTool,
    ResearchTool,
    InboxListTool,
)
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

client = OneShotClient(private_key="0x...")

# Pick only the tools you need
tools = [
    ResearchTool(client=client),
    EmailTool(client=client),
    InboxListTool(client=client),
]

agent = create_react_agent(ChatOpenAI(model="gpt-4o"), tools)
result = agent.invoke({
    "messages": [("user", "Research quantum computing breakthroughs and email a summary to me@example.com")]
})
```

## How Payments Work

Paid tools use the [x402 protocol](https://x402.org). The flow is fully automatic:

1. Your agent calls a tool (e.g. `ResearchTool.invoke(...)`)
2. The client POSTs to the OneShot API
3. The API returns **402 Payment Required** with a USDC quote
4. The client signs a `TransferWithAuthorization` (EIP-3009) locally using your private key
5. The client re-POSTs with the signed payment in the `x-payment` header
6. The API processes the job and returns the result

<Warning>
  Your private key never leaves your machine. All signing happens locally via `eth-account`.
</Warning>

## Links

<CardGroup cols={2}>
  <Card title="langchain-oneshot on PyPI" icon="python" href="https://pypi.org/project/langchain-oneshot/">
    LangChain integration package
  </Card>

  <Card title="oneshot-python on PyPI" icon="python" href="https://pypi.org/project/oneshot-python/">
    Core Python SDK (dependency of langchain-oneshot)
  </Card>

  <Card title="TypeScript SDK" icon="npm" href="/sdk/overview">
    TypeScript SDK docs
  </Card>

  <Card title="MCP Server" icon="plug" href="/sdk/mcp">
    MCP integration for Claude, Cursor
  </Card>

  <Card title="GitHub" icon="github" href="https://github.com/oneshot-agent/sdk">
    Source code
  </Card>

  <Card title="Pricing" icon="dollar-sign" href="/pricing">
    Detailed pricing
  </Card>
</CardGroup>
