botsrated (Python)
A pre-payment check for x402 agents. Before your agent pays a seller, it asks
BotsRated what it has measured about that seller, using the free
GET /v1/preflight route. Paid lookups are opt-in and capped by a budget you set.
BotsRated is in beta. It covers about 4,800 x402 seller hosts on Base, taken from the CDP Bazaar, Agentic.Market, 402index and x402-list. Each host gets an unpaid probe about every 5.4 h, and every receipt is signed.
Status: published on PyPI: botsrated 0.1.0.
pip install botsrated # free preflight + guard
pip install "botsrated[x402]" # + x402 SDK hook / paid lookups
Guard an x402 client (free)
from x402 import x402ClientSync
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact import ExactEvmScheme
from botsrated import PrePaymentGuard
client = x402ClientSync()
client.register("eip155:*", ExactEvmScheme(signer=EthAccountSigner(account)))
client.on_before_payment_creation(PrePaymentGuard().x402_hook)
Defaults:
- A payTo that differs from every payTo BotsRated saw for the host, on the same network, is blocked.
- A price above the last observed price on the same route is a warning.
- A host that is not covered is allowed.
- Data older than 24 h is allowed.
- If BotsRated cannot be reached (4 s timeout), the payment is allowed (
fail_open). - The minimum valid-402 rate is off.
Change these with GuardPolicy(...). Preflight answers are cached for 5 minutes per host.
Opt-in paid lookups with a budget
from x402.http.clients import x402_requests
from botsrated import BotsRatedClient, PrePaymentGuard
session = x402_requests(client) # pays x402 challenges
botsrated = BotsRatedClient(budget_usd="0.05", paying_get=session.get)
guard = PrePaymentGuard(botsrated, paid_check_at_or_above_usd=0.25)
client.on_before_payment_creation(guard.x402_hook)
botsrated.check("seller.example") # $0.001 (first 100/day free)
botsrated.report("seller.example") # $0.002 (first 10/day free)
botsrated.best("web search") # $0.01
How paid calls work:
- Free daily quota: the first 100
/v1/checkand 10/v1/reportcalls per client per UTC day are served free (200 withcharged: falseand afree_quotablock). The client asks unpaid first, so inside the quota nothing is paid and the budget is untouched;check()/report()also work without a budget until the quota is used up (thenpaid_disabled).client.last_free_quotashows what is left. - Otherwise the client reads the 402 quote unpaid first. It accepts only
exactUSDC on Base to BotsRated's payTo0x7F936f42F46B6c4Cbd3242cF8A1759dfe829E349, at or below the published price. - The amount is reserved from the budget before paying and released if the call fails.
- When the guard is registered, it refuses any payment to botsrated.com that the client did not reserve.
Tests
uv run --with pytest --with respx --with "x402[evm]" pytest
License: MIT. BotsRated reports measurements, not endorsements.
Metadata
Release files for botsrated 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| botsrated-0.1.0.tar.gz | 11.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| botsrated-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.6 kB
Release files / botsrated-0.1.0.tar.gz
| Download URL | botsrated-0.1.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aeec493520d7cbc5d3a2ca2ab33a83ea3a6e213685e420c96e5a5cea16162176
|
|
BLAKE2b-256 checksum How to use checksums |
1ea48c16270cd3cc535e2818f19402dca628f7069fe322c5ba620497db860bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / botsrated-0.1.0-py3-none-any.whl
| Download URL | botsrated-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8bcbe900cef23005926f21852c81300021b59cfc0e27f772b88fb746e8a191cc
|
|
BLAKE2b-256 checksum How to use checksums |
fc9d6cfcb4b44d712cf4eea764f6dcb8c28707db0da502d5f8fcf6f17effd230
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for botsrated 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.