langchain-oneshot
LangChain tools for OneShot: 52 tools plus additional tools from the lookup manifest, as LangChain BaseTool subclasses. Your agent sends email, makes calls, researches, enriches, and buys; each paid call is paid automatically in USDC on Base (x402).
Installation
pip install langchain-oneshot
Quick Start
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...",
)
# Use all the tools (49, plus additional tools from the lookup manifest) 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")]
})
Access-token sessions
Hosted agents pay from prepaid credits and never hold a wallet key:
import os
from langchain_oneshot import OneShotToolkit
toolkit = OneShotToolkit.from_access_token(os.environ["ONESHOT_ACCESS_TOKEN"])
# Inside an async application:
# toolkit = await OneShotToolkit.afrom_access_token(os.environ["ONESHOT_ACCESS_TOKEN"])
tools = toolkit.get_tools()
Mint the token and set budgets from a wallet session. Token calls spend the agent's
credits within its stored caps and cannot change budgets or manage tokens.
An insufficient balance raises InsufficientCreditsError. Fund credits from a wallet
with OneShotClient.top_up_credits(amount) and retry. See the
hosted setup guide.
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"})
Available Tools
| Tool | Description |
|---|---|
oneshot_email |
Send emails |
oneshot_voice |
Make phone calls |
oneshot_sms |
Send SMS messages |
oneshot_physical_mail_upload |
Upload print-ready artwork (base64 PDF, PNG or JPEG, 20 MB max) for a letter or postcard |
oneshot_physical_mail_send |
Print and post an approved mailpiece (quote id, approval id, an idempotency key you keep); preview, approve and the order reads are manifest tools |
oneshot_research |
Deep web research |
oneshot_web_search |
Search the web |
oneshot_web_read |
Read a web page as markdown |
oneshot_person_find |
Search for people |
oneshot_person_profile |
Enrich a profile |
oneshot_person_email |
Find email address |
oneshot_person_email_status |
Verify email |
oneshot_person_dossier |
A person’s profile, known social accounts, articles, posts and written summary |
oneshot_person_social_accounts |
Find all social accounts |
oneshot_person_articles |
Find articles about a person |
oneshot_person_posts |
Recent social posts |
oneshot_person_interests |
Analyze interests |
oneshot_person_followers |
Map followers/following |
oneshot_product_find |
Search products |
oneshot_commerce_buy |
Purchase product |
oneshot_build |
Build a website |
oneshot_update_build |
Update a website |
oneshot_browser |
Browser automation task |
oneshot_browser_create_profile |
Create a browser profile |
oneshot_browser_list_profiles |
List browser profiles |
oneshot_browser_delete_profile |
Delete a browser profile |
oneshot_inbox_list |
List inbox emails |
oneshot_inbox_get |
Get email by ID |
oneshot_sms_inbox_list |
List SMS inbox |
oneshot_sms_inbox_get |
Get SMS by ID |
oneshot_notifications |
List notifications |
oneshot_mark_notification_read |
Mark read |
oneshot_get_balance |
USDC balance |
oneshot_budget_status |
Today's spend vs the configured budget (read-only) |
oneshot_linkedin_connect |
Hosted login link for a human to connect their LinkedIn account (free) |
oneshot_linkedin_accounts |
Connected LinkedIn accounts / pending connection status (free) |
oneshot_linkedin_sync |
One bounded, resumable LinkedIn history-sync run (paid) |
oneshot_linkedin_conversations |
Synced LinkedIn conversations with coverage state (free) |
oneshot_linkedin_messages |
Synced LinkedIn messages, filterable by direction / since (free) |
oneshot_linkedin_reply |
Send a reply through the connected account (paid, idempotent) |
oneshot_linkedin_message |
Message a first-degree connection, in the existing 1:1 conversation or a new one (paid, idempotent) |
oneshot_linkedin_invitation |
Status of one sent invitation: pending, accepted, withdrawn (free) |
oneshot_linkedin_invitations |
Sent invitations by status / changed since (free) |
oneshot_linkedin_view_profile |
View a profile through the connected account (paid) |
oneshot_linkedin_react |
React to a post through the connected account (paid) |
oneshot_list_domains |
Sending domains + reputation/rotation state |
oneshot_pause_domain |
Take a domain out of rotation |
oneshot_resume_domain |
Put a paused domain back into rotation |
Paid tools are priced in USDC via x402. Current rates are on the Pricing page.
How Payments Work
Payment signing happens locally; your private key never leaves your machine. Paid tools use the x402 protocol. When a tool requires payment:
- The client POSTs to the tool endpoint
- The API returns
402 Payment Requiredwith a quote - The client signs a USDC
TransferWithAuthorization(EIP-3009) using your private key - The client re-POSTs with the signed payment header
- The API processes the request and returns the result
Read tools (inbox, SMS inbox, notifications, balance, browser profiles) also send a signed EIP-712 read proof (x-agent-proof) so the API can verify you control the X-Agent-ID wallet before returning private data. The underlying oneshot-python client handles this with no extra code. It requires oneshot-python >= 0.18.0, which is already the dependency floor.
Configuration
toolkit = OneShotToolkit.from_private_key("0x...")
# Custom API URL
toolkit = OneShotToolkit.from_private_key("0x...", base_url="https://custom-api.example.com")
The SDK runs on Base Mainnet with real USDC. Fund your wallet before making paid tool calls.
Spend budget
toolkit = OneShotToolkit.from_private_key(
"0x...",
budgets={"daily": 50, "per_transaction": 5, "alert_at": 0.8},
alert_email="you@example.com",
)
The server enforces the budget on every paid call (403 budget_exceeded → oneshot.BudgetExceededError). The agent can read its utilization with oneshot_budget_status but cannot change the cap. Requires oneshot-python >= 0.20.0.
LinkedIn connection recovery
If the active account list is empty or an account is connection_deleted or
revoked, ask the human to use oneshot_linkedin_connect and authorize fresh
grants. An existing account with reconnect_required must be reconnected through
the owning application. Reconnect and revoke are deliberately not agent tools.
Do not create a new connection automatically after authentication failures or
timeouts.
Requirements
- Python 3.10+
langchain-core >= 0.3.0oneshot-python >= 0.18.0pydantic >= 2.0
Links
- Documentation
- oneshot-python on PyPI: core HTTP client (dependency)
- TypeScript SDK
- MCP Server
- GitHub
License
MIT
Optional phone lookup
person_find, person_profile, and person_dossier accept include_phone, off by default. It adds the per-person add-on listed on the pricing page × the requested search limit (default 100) for a search, or once for profile/dossier, for up to that many people with no promised hit. Existing source numbers and published business or record numbers remain available without opting in. Fallbacks and callbacks cost nothing extra; a completed no-match is charged and a failed job is refunded. Use a boolean true / false. The full quote is checked before payment.
Solve
Plan vehicle routes, pack items into bins, or schedule jobs on resources, returning constraint checks and conflicts. Use oneshot_solve with problem: "routing" and a routing block containing vehicles, stops and an objective, problem: "packing" and a packing block containing variant (bin or knapsack), dimensions, bins and items, or problem: "schedule" and a schedule block containing jobs, resources and an objective. Provide only the block matching the selected problem.
See Solve for input examples, results and limits.
Predict
Use PredictTool(client=client) or the toolkit’s oneshot_predict tool. Supports model: "simulation" with a simulation block of named distributions and arithmetic outputs, or model: "forecast" with a forecast block containing a time series and horizon. Returns uncertainty ranges and consistency checks.
See Predict for inputs, results and limits.
Metadata
Release files for langchain-oneshot 0.21.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| langchain_oneshot-0.21.0.tar.gz | 146.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_oneshot-0.21.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 183.2 kB
Release files / langchain_oneshot-0.21.0.tar.gz
| Download URL | langchain_oneshot-0.21.0.tar.gz |
|---|---|
| Size | 146.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9097383c761ae4e48f5da33a4de57fcee22a4cf9e7e2e9d226bf61242f81ca03
|
|
BLAKE2b-256 checksum How to use checksums |
32dcb33e517b84b3196a79aea6f9edf1e7083447a1a943bc866f45496cca346d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / langchain_oneshot-0.21.0-py3-none-any.whl
| Download URL | langchain_oneshot-0.21.0-py3-none-any.whl |
|---|---|
| Size | 36.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a04c2f6a0b0471af1783a98a65d0c89e8acd93fdeddc7846d3e1ca5e3e7dc392
|
|
BLAKE2b-256 checksum How to use checksums |
a4b6ceeaa7f7697e67b875c773f702c5deab09e95b5d83a7bac482e1e9abeed5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for langchain-oneshot 0.21.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.