Skip to main content

LangChain tools for OneShot — commercial actions for AI agents

Project description

langchain-oneshot

LangChain tools for OneShot — commercial actions for AI agents.

Provides 19 tools as LangChain BaseTool subclasses with automatic x402 payment handling via USDC on Base.

Installation

pip install langchain-oneshot

Quick Start

from langchain_oneshot import OneShotToolkit
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

# Create toolkit (test mode uses Base Sepolia testnet)
toolkit = OneShotToolkit.from_private_key(
    private_key="0x...",
    test_mode=True,
)

# Use all 19 tools with a LangGraph agent
tools = toolkit.get_tools()
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...", test_mode=True)
research = ResearchTool(client=client)
result = research.invoke({"topic": "AI agent frameworks 2026"})

Available Tools

Tool Description Cost
oneshot_email Send emails ~$0.01
oneshot_voice Make phone calls ~$0.25/min
oneshot_sms Send SMS messages ~$0.035/segment
oneshot_research Deep web research $0.50–$2.00
oneshot_people_search Search for people ~$0.10/result
oneshot_enrich_profile Enrich a profile ~$0.10
oneshot_find_email Find email address ~$0.10
oneshot_verify_email Verify email ~$0.01
oneshot_commerce_search Search products Free
oneshot_commerce_buy Purchase product Price + fee
oneshot_build Build a website ~$10 base
oneshot_update_build Update a website ~$10 base
oneshot_inbox_list List inbox emails Free
oneshot_inbox_get Get email by ID Free
oneshot_sms_inbox_list List SMS inbox Free
oneshot_sms_inbox_get Get SMS by ID Free
oneshot_notifications List notifications Free
oneshot_mark_notification_read Mark read Free
oneshot_get_balance USDC balance Free

How Payments Work

Paid tools use the x402 protocol. When a tool requires payment:

  1. The client POSTs to the tool endpoint
  2. The API returns 402 Payment Required with a quote
  3. The client signs a USDC TransferWithAuthorization (EIP-3009) using your private key
  4. The client re-POSTs with the signed payment header
  5. The API processes the request and returns the result

All payment signing happens locally — your private key never leaves your machine.

Configuration

# Test mode (Base Sepolia — no real money)
toolkit = OneShotToolkit.from_private_key("0x...", test_mode=True)

# Production (Base Mainnet — real USDC)
toolkit = OneShotToolkit.from_private_key("0x...", test_mode=False)

Requirements

  • Python 3.10+
  • langchain-core >= 0.3.0
  • eth-account >= 0.13.0
  • httpx >= 0.27.0
  • pydantic >= 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_oneshot-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_oneshot-0.1.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file langchain_oneshot-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_oneshot-0.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for langchain_oneshot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 050e225a37e73c30a18c8dff1f9997d85a5554c6f4c14ed1b6293933238eab0d
MD5 46f4d1923ed9e7d00bfa54423a6c53b1
BLAKE2b-256 743be62ef0b84c59d7198571a6c53dfe3e494bfc6d3a94f1d33d3c7ddb3dac73

See more details on using hashes here.

File details

Details for the file langchain_oneshot-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_oneshot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85903066c6471c7349f1be7ad7aeb0943138270324f8822420d651e66e477669
MD5 5b0d0aab85c1dad568da695207d228c9
BLAKE2b-256 271d483bfb3b25302c716494189c087f1382b9200ca9bcaedc1d781ed48209dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page