Skip to main content

langchain-ausca

LangChain tools that pay for HTTP 402 APIs over x402 instead of carrying API keys. A tool built here works against any x402 v2 resource; nothing in it is specific to one vendor. The model authors the request; the caller's signing key and hard per-call USD cap stay outside the model's reach, enforced by the official x402 library's spend controls before anything is signed.

Install

pip install langchain-ausca

Use

import os
from langchain_ausca import payable_tool
from pydantic import BaseModel

class LeaseBrowser(BaseModel):
    duration_seconds: int

browser = payable_tool(
    name="lease_browser",
    description="Lease a remote browser with CDP access for 10, 30, or 60 minutes. Costs $0.10 to $0.25 in USDC on Base.",
    args_schema=LeaseBrowser,
    url="https://ausca.com/v1/lease-browser",
    private_key=os.environ["WALLET_PRIVATE_KEY"],  # pays USDC on Base
    max_payment_usd=0.50,                          # hard per-call cap
)

The tool result is a JSON string with the resource result and, when the call was paid, the decoded settlement proof from the PAYMENT-RESPONSE header.

The example uses Ausca, pay-per-call agent infrastructure services with no accounts or API keys; its catalog-bound Python client is the ausca package. Any other x402 v2 resource works the same way: point url at it.

The npm sibling of this package is langchain-ausca.

License

MIT

Metadata

Release files for langchain-ausca 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 langchain-ausca 0.1.0
File Size Uploaded Provenance
langchain_ausca-0.1.0.tar.gz 5.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 10.7 kB

Release files / langchain_ausca-0.1.0.tar.gz

Download URL langchain_ausca-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
82db6d97d54b47eb8b74eeb56534e54c6a6572c7632208623bc40118d2258529
BLAKE2b-256 checksum
How to use checksums
cfa660845f4d47f4518fcb193e1e1be04d44f8cb4c7b3fba5681fa013fdd0e40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

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

Download URL langchain_ausca-0.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e2ada16c0a3d62101d517015bc2d234a5243949d01f1561e292c1dd0e077951
BLAKE2b-256 checksum
How to use checksums
bce3d515207b3ffcdbe36a9eb9e005f066a6439d1b2e84ae1183b6256d70dfdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for langchain-ausca 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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