Skip to main content

Overview

langchain-oneshot is a Python package that wraps all 26 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.
This package ports the same HTTP + x402 payment flow from the TypeScript SDK into Python, using eth-account for EIP-712 signing and httpx for HTTP.

Installation

pip install langchain-oneshot

Requirements

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

Dependencies

PackagePurpose
langchain-coreBaseTool / BaseToolkit interfaces
eth-accountEIP-712 typed data signing
httpxAsync HTTP client
pydanticInput schema validation

Quick Start

With LangGraph Agent

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 26 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

from langchain_oneshot import OneShotClient, ResearchTool

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

Configuration

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

# Debug logging
toolkit = OneShotToolkit.from_private_key("0x...", debug=True)
ParameterDefaultDescription
private_keyrequiredHex-encoded wallet private key
base_urlNoneOverride API URL
debugFalsePrint debug logs
The SDK operates on Base Mainnet with real USDC. Fund your agent wallet before making paid tool calls.

Available Tools

See Pricing for current tool costs.

Communication

Tool ClassTool NameDescription
EmailTooloneshot_emailSend emails
VoiceTooloneshot_voiceMake phone calls
SmsTooloneshot_smsSend SMS messages

Research & Enrichment

Tool ClassTool NameDescription
ResearchTooloneshot_researchDeep web research with sources
PeopleSearchTooloneshot_people_searchSearch by title, company, location
EnrichProfileTooloneshot_enrich_profileEnrich profile from LinkedIn/email
FindEmailTooloneshot_find_emailFind email at a company
VerifyEmailTooloneshot_verify_emailVerify email deliverability

Person Intelligence

Tool ClassTool NameDescription
DeepResearchPersonTooloneshot_deep_research_personFull dossier on a person (2-5 min)
SocialProfilesTooloneshot_social_profilesFind all social accounts
ArticleSearchTooloneshot_article_searchFind articles about a person
PersonNewsfeedTooloneshot_person_newsfeedRecent social posts with engagement
PersonInterestsTooloneshot_person_interestsAnalyze interests across categories
PersonInteractionsTooloneshot_person_interactionsMap followers, following, replies

Browser

Tool ClassTool NameDescription
BrowserTooloneshot_browserAutonomous browser — navigate, click, extract
BrowserCreateProfileTooloneshot_browser_create_profileCreate persistent browser profile
BrowserListProfilesTooloneshot_browser_list_profilesList all browser profiles
BrowserDeleteProfileTooloneshot_browser_delete_profileDelete a browser profile

Web

Tool ClassTool NameDescription
WebSearchTooloneshot_web_searchSearch the web, get results instantly

Commerce

Tool ClassTool NameDescription
CommerceSearchTooloneshot_commerce_searchSearch for products
CommerceBuyTooloneshot_commerce_buyPurchase a product

Build

Tool ClassTool NameDescription
BuildTooloneshot_buildBuild and deploy websites
UpdateBuildTooloneshot_update_buildUpdate existing website

Inbox

Tool ClassTool NameDescription
InboxListTooloneshot_inbox_listList received emails
InboxGetTooloneshot_inbox_getGet email by ID
SmsInboxListTooloneshot_sms_inbox_listList received SMS
SmsInboxGetTooloneshot_sms_inbox_getGet SMS by ID

Account

Tool ClassTool NameDescription
NotificationsTooloneshot_notificationsList notifications
MarkNotificationReadTooloneshot_mark_notification_readMark notification read
GetBalanceTooloneshot_get_balanceGet USDC balance

Examples

Send an Email

from langchain_oneshot import OneShotClient, EmailTool

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

result = email.invoke({
    "to": "[email protected]",
    "subject": "Meeting Tomorrow",
    "body": "Hi John, let's meet at 3pm instead. Thanks!"
})

Deep Research

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

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": "[email protected]"})

Build a Website

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

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

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 [email protected]")]
})

How Payments Work

Paid tools use the x402 protocol. 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
Your private key never leaves your machine. All signing happens locally via eth-account.

langchain-oneshot on PyPI

LangChain integration package

oneshot-python on PyPI

Core Python SDK (dependency of langchain-oneshot)

TypeScript SDK

TypeScript SDK docs

MCP Server

MCP integration for Claude, Cursor

GitHub

Source code

Pricing

Detailed pricing