Skip to main content

toll402 (Python)

One-line access to Toll402: pay-per-call tools for AI agents over x402 (USDC on Base). Every call is paid: either from a wallet (USDC on Base via x402, no account) or from prepaid credits bought by card at https://toll402.dev/credits (API key tk_…, header x-toll402-key). Charged only on 2xx.

pip install toll402            # discovery + credits (API key)
pip install "toll402[pay]"     # + x402 payments (x402[requests,evm], eth-account)
from toll402 import Toll402

t = Toll402(wallet_key=os.environ.get("WALLET_KEY"))     # omit → free trial

t.read("https://example.com")                                   # page → Markdown ($0.002)
t.do("convert 100 usd to mxn", {"base": "USD", "quote": "MXN", "amount": 100})
t.provenance("https://some-article")                            # human or synthetic? evidence + score
t.lookup("HTTP 402", sources=["wikipedia", "wikidata"])         # trusted sources with citations
t.business.search(city="Ciudad de México", category="dentist", minLevel="corroborated")
t.call("hn_top", {"n": 5})                                      # any catalog tool by name
t.last_payment      # settlement of the last paid call (tx hash on Base)
t.trial_remaining   # free-trial calls left today

Errors raise Toll402Error with .status, .code (payment_required, invalid_input, tool_failed, …) and .price. Charged only on 2xx.

LangChain

from toll402.langchain import toll402_tools
tools = toll402_tools(t, max_price_usd=0.05)      # StructuredTool list from the live catalog

CrewAI

from toll402.crewai import toll402_crewai_tools
tools = toll402_crewai_tools(t, kinds=["builtin", "forged"])

Docs for machines: https://toll402.dev/llms.txt · MIT.

Metadata

Release files for toll402 0.1.2

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

Source distribution (sdist)

Source distribution for toll402 0.1.2
File Size Uploaded
toll402-0.1.2.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for toll402 0.1.2
File Interpreter ABI Platform
toll402-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / toll402-0.1.2.tar.gz

Download URL toll402-0.1.2.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
735bccbe9dca6a58a1099b477805df3dec49f9262a4e7753015a739b5ad0b212
BLAKE2b-256 checksum
How to use checksums
f7f8d6eb115c32e4fe0936cec1784f94a588ab3f2e6dbc68be3dd60cb3a90e54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / toll402-0.1.2-py3-none-any.whl

Download URL toll402-0.1.2-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c86eb2c1bf910463d730a9636a7d0837897f955e384d5ee946efb0fbdf38a99
BLAKE2b-256 checksum
How to use checksums
56134e42d9b77b4e4656f225ce68510f4d45f32503e59f61384c010c73258949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.2 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