Skip to main content

langchain-ampersend

LangChain integration for Ampersend x402 payments. Call remote A2A agents with automatic payment handling.

Installation

pip install langchain-ampersend

Usage

from langchain_ampersend import A2AToolkit, create_ampersend_treasurer
from langchain.agents import create_agent
from langchain_openai import ChatOpenAI

# Create treasurer (one-liner setup)
treasurer = create_ampersend_treasurer(
    smart_account_address="0x...",
    session_key_private_key="0x...",
)

# Create toolkit for a remote agent
toolkit = A2AToolkit(
    remote_agent_url="https://agent.example.com",
    treasurer=treasurer,
)

# Initialize (discovers the agent)
await toolkit.initialize()

# Use with LangGraph
llm = ChatOpenAI(model="gpt-4")
agent = create_agent(llm, toolkit.get_tools())

# Run
result = await agent.ainvoke({"messages": [("user", "Query some data")]})

Tools

The toolkit provides two tools:

  • a2a_get_agent_details - Get the capabilities and skills of the remote agent
  • a2a_send_message - Send a message to the remote agent (payments handled automatically)

Metadata

Release files for langchain-ampersend 0.0.28

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

Source distribution (sdist)

Source distribution for langchain-ampersend 0.0.28
File Size Uploaded
langchain_ampersend-0.0.28.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-ampersend 0.0.28
File Interpreter ABI Platform
langchain_ampersend-0.0.28-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / langchain_ampersend-0.0.28.tar.gz

Download URL langchain_ampersend-0.0.28.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4340613d181b677a0144cb901abf8961111d13717e3e148a07f3f2bde5644fae
BLAKE2b-256 checksum
How to use checksums
f24135d26fbde2e94be2b8ddcabd0bb3dfc66e75475fe4492d8f32da15ba8442
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 23, 2026.

Transparency log

Release files / langchain_ampersend-0.0.28-py3-none-any.whl

Download URL langchain_ampersend-0.0.28-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca689f9a614a60da6cfac1641540a490f7004a22d5f25526fc4e88a351fc591b
BLAKE2b-256 checksum
How to use checksums
4d7adb9ad887c39ae5d838fe3e3a747ff155e84596e7c10742a973fac3e4cbbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.28 This release

2 release files

0.0.22

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.1

2 release files

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