Skip to main content

agent402-langchain (Python)

Turn Agent402's catalog of 500+ pay-per-call tools and skill packs into LangChain tools for Python agents.

Agent402 is the applied layer of Agentic Finance - agents that pay and get paid on their own over the two open wires, x402 and MPP (Machine Payments Protocol). Every paid endpoint answers both on the same 402; this package pays wallet-only tools through the x402_fetch callable you pass (below).

Pure-CPU tools (hashing, encoding, QR, markdown, JSON, readability…) are free via built-in proof-of-work - no wallet, no API keys. Live-data tools (market data, web search, EDGAR, on-chain) are wallet-only and settle in USDC.

pip install "agent402-langchain[langchain]"
from agent402_langchain import Agent402Toolkit

toolkit = Agent402Toolkit(base_url="https://agent402.tools")
tools = toolkit.get_tools()   # four meta-tools your agent can call

It exposes four meta-tools rather than 500+ individual ones (frameworks and LLMs both choke on thousands of tools):

Tool What it does
agent402_find Resolve a plain-language task to the best tool (slug, price, schema, example)
agent402_route Cross-seller x402 router across the sellers Agent402 indexes
agent402_call Call a tool by slug - auto-pays via proof-of-work (free) or your x402 fetch (paid)
agent402_about The service manifest (identity, payment options, trust signals)

Paid (wallet-only) tools

Pass x402_fetch - a callable with the requests-style signature (method, url, **kwargs) -> requests.Response that signs the USDC payment:

toolkit = Agent402Toolkit(base_url="https://agent402.tools", x402_fetch=my_signed_fetch)

The callable is passed allow_redirects=False: a paid call never follows a redirect, and one is refused with the origin it pointed to, so point base_url at the address that serves the routes directly.

Without it, calling a wallet-only tool raises a clear error naming what's needed; the free proof-of-work tier keeps working regardless.

Without LangChain

agent402_tool_specs() returns the same four entries as framework-agnostic dicts (name, description, JSON Schema, and a plain execute callable) - no langchain-core needed.

MIT © Havok Holdings LLC · github.com/MikeyPetrillo/Agent402

Metadata

Release files for agent402-langchain 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent402-langchain 0.1.6
File Size Uploaded Provenance Actions
agent402_langchain-0.1.6.tar.gz 8.6 kB With provenance Details for agent402_langchain-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent402-langchain 0.1.6
File Interpreter ABI Platform Actions
agent402_langchain-0.1.6-py3-none-any.whl Python 3 none any Details for agent402_langchain-0.1.6-py3-none-any.whl

Total release size: 16.0 kB

Release files / agent402_langchain-0.1.6.tar.gz

Download URL agent402_langchain-0.1.6.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bb42f777ac43cedcfae9ed9555ca1e487c647f1899bc53e0e665f246ad2853a0
BLAKE2b-256 checksum
How to use checksums
75b7cf4a0155f9f0a21003bf7ffeff5a7ce0c50d8d3a4d53197d856bfcf9a83a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / agent402_langchain-0.1.6-py3-none-any.whl

Download URL agent402_langchain-0.1.6-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba54634569b42ce342df60b0593edd787d2750b558c7ff9c36f091da24b4f5f0
BLAKE2b-256 checksum
How to use checksums
df1fed1e24d2d828ab531d8ec39bb9e0f1cd0d0377e97b0f8024c26fa455964b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for agent402-langchain 0.1.6

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent402_langchain-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page