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

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.5
File Size Uploaded Provenance Actions
agent402_langchain-0.1.5.tar.gz 8.5 kB With provenance Details for agent402_langchain-0.1.5.tar.gz

Built distribution (wheel)

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

Total release size: 15.8 kB

Release files / agent402_langchain-0.1.5.tar.gz

Download URL agent402_langchain-0.1.5.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c94e6230b2c19af961813399262df1b0b94fe28432e3d7e3a46ecd4d7ad3f7e0
BLAKE2b-256 checksum
How to use checksums
83f8ae60ca59974f96dfcd32396c683bb2b3c62f4248c00cdbcbdc58a5d6a200
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 22, 2026.

Transparency log

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

Download URL agent402_langchain-0.1.5-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b2e5272da4834d476a2652cdb0111afa597d071c2496bb1ee2109a6e7cf567f
BLAKE2b-256 checksum
How to use checksums
58b12d1c1010291fc0133b1f20a882eb5a9322c63a89f79fc49794bb1ab44909
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 22, 2026.

Transparency log

Security for agent402-langchain 0.1.5

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent402_langchain-0.1.5.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 22, 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