Metadata-Version: 2.5
Name: toll402
Version: 0.2.0
Summary: One-line client for Toll402 — 2,600+ pay-per-call tools for AI agents (web, PDF, provenance, business directory, ID validators, SEO/social/enrichment/ads/market-data provider APIs). Pay per call with USDC via x402 (no account) or with prepaid credits bought by card (API key). Charged only on success.
Project-URL: Homepage, https://toll402.dev
Project-URL: Repository, https://gitlab.com/toll402/toll402
Project-URL: Documentation, https://toll402.dev/llms.txt
Author: Toll402
License-Expression: MIT
Keywords: ai-agents,api-key,base,credits,crewai,enrichment,langchain,seo,tools,usdc,x402
Requires-Python: >=3.10
Requires-Dist: httpx>=0.25
Provides-Extra: crewai
Requires-Dist: crewai>=0.30; extra == 'crewai'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.2; extra == 'langchain'
Provides-Extra: pay
Requires-Dist: eth-account>=0.10; extra == 'pay'
Requires-Dist: requests>=2.31; extra == 'pay'
Requires-Dist: x402[evm,requests]>=2.20; extra == 'pay'
Description-Content-Type: text/markdown

# toll402 (Python)

One-line access to [Toll402](https://toll402.dev): 2,600+ pay-per-call tools for AI agents (web, PDF, provenance, verified business directory, ID validators, and SEO/social/enrichment/ads/market-data provider APIs).
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.

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

```python
from toll402 import Toll402

t = Toll402(api_key=os.environ.get("TOLL402_API_KEY"))    # prepaid credits (card)
# or: Toll402(wallet_key=os.environ.get("WALLET_KEY"))      # x402 (wallet)

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.last_charge       # {'usd', 'balance_usd'} of the last credits-paid call
```

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

## LangChain
```python
from toll402.langchain import toll402_tools
tools = toll402_tools(t, max_price_usd=0.05)      # StructuredTool list from the live catalog
```
## CrewAI
```python
from toll402.crewai import toll402_crewai_tools
tools = toll402_crewai_tools(t, kinds=["builtin", "forged"])
```
Docs for machines: https://toll402.dev/llms.txt · MIT.
