Skip to main content

andreax-langchain-autopay

LangChain toolkit for Andreax's pay-per-call AI tools: 200+ tools discoverable and payable over x402 (HTTP 402 + USDC on Base), no API key, no signup.

from andreax_langchain_autopay import AndreaxToolkit

toolkit = AndreaxToolkit(
    wallet_address="0xYourAddress",
    private_key=None,          # optional; required only if auto_pay=True
    auto_pay=False,            # True = pay automatically within your caps
    per_call_cap_usd=0.10,
    daily_cap_usd=5.00,
)

tools = toolkit.get_tools()   # -> list[AndreaxTool], ready for a LangChain agent

Autopay

With auto_pay=True and a private_key, a tool call that answers 402 Payment Required is paid automatically: this SDK signs an EIP-3009 transferWithAuthorization locally (your private key never leaves the process) and retries the call with the signed payload in the X-PAYMENT header. Every payment is checked against two caps first:

  • per_call_cap_usd: reject if a single call costs more than this.
  • daily_cap_usd: reject if today's accumulated spend (in this process) would exceed this.

Without auto_pay (or without a private_key), a paid tool call raises/returns PaymentRequired with the full 402 challenge (amount, recipient, network) so you can decide.

Direct calls (no LangChain agent)

result = toolkit.call("leer-url", {"url": "https://example.com"})

Status

Alpha (0.1.0). Built against Andreax's live x402 catalog and 402 challenge format.

Release files for andreax-langchain-autopay 0.1.0

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

Source distribution (sdist)

Source distribution for andreax-langchain-autopay 0.1.0
File Size Uploaded
andreax_langchain_autopay-0.1.0.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for andreax-langchain-autopay 0.1.0
File Interpreter ABI Platform
andreax_langchain_autopay-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.6 kB

Release files / andreax_langchain_autopay-0.1.0.tar.gz

Download URL andreax_langchain_autopay-0.1.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
893567107fe195bc9ae540cc6df53e6c054e648c25855415aa2e8817699f1ebb
BLAKE2b-256 checksum
How to use checksums
654bc6ee2435c6a77c9118e18e22f595339a9991b454062ee03a2f6bb2a92aca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / andreax_langchain_autopay-0.1.0-py3-none-any.whl

Download URL andreax_langchain_autopay-0.1.0-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38c7f6f847de5f15844647c01495080366ef668429a144fc121da3713c4893de
BLAKE2b-256 checksum
How to use checksums
479c6ab8c100d8ea3b6667c9f71d6d54215519834a01d716d94298af95c6f2a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

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