Metadata-Version: 2.4
Name: x402-money-reactor
Version: 1.2.5
Summary: x402 pay-per-call API toolkit for AI agents: crypto prices, news, AI chat, token verdicts, honeypot scoring, url-to-text, weather, bounties. USDC on Base, no signup.
Author: Money Reactor
License: MIT
Project-URL: Homepage, https://money-reactor.makar52nn2016.workers.dev
Project-URL: Repository, https://github.com/makar52nn-crypto/x402-money-reactor
Project-URL: Agent Card, https://raw.githubusercontent.com/makar52nn-crypto/x402-money-reactor/main/AGENT_CARD.json
Project-URL: llms.txt, https://money-reactor.makar52nn2016.workers.dev/llms.txt
Keywords: x402,pay-per-call,usdc,base,ai-agents,api,micropayments,crypto,402,web3
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# x402-money-reactor (Python)

Python client for **Money Reactor** — an x402 pay-per-call API for AI agents and bots.
Live service: **https://money-reactor.makar52nn2016.workers.dev**

No signup. No API keys. Pay per request in USDC on Base via the
[x402](https://www.x402.org) protocol (HTTP 402 + EIP-3009). Machine-readable
discovery at [`/openapi.json`](https://money-reactor.makar52nn2016.workers.dev/openapi.json),
[`/llms.txt`](https://money-reactor.makar52nn2016.workers.dev/llms.txt) and
[`/mcp`](https://money-reactor.makar52nn2016.workers.dev/mcp) (MCP server).

## Install

```bash
pip install x402-money-reactor
```

## Free endpoints (no wallet needed)

```python
from x402_money_reactor import call_free, catalog, paid_endpoints

call_free("/api/health")        # liveness + receiver
call_free("/api/status")        # public payment ledger (recent x402 settlements)
call_free("/api/stats")         # usage counters
call_free("/api/bounties/demo") # free sample of the bounty feed

catalog()         # live endpoint list from /openapi.json
paid_endpoints()  # static price table
```

## Paid endpoints (x402, USDC on Base)

| Endpoint | Price | What you get |
|---|---|---|
| `GET /api/crypto-price?symbol=BTC-USD` | $0.001 | live spot price |
| `GET /api/usd-price?assets=btc,eth` | $0.001 | multi-asset USD snapshot |
| `GET /api/fear-greed` | $0.001 | crypto Fear & Greed index |
| `POST /api/ai-chat` | $0.002 | LLM chat completion |
| `GET /api/market-pulse?symbols=BTC,ETH` | $0.003 | market snapshot in plain language |
| `GET /api/weather?city=Moscow` | $0.002 | current weather by city |
| `GET /api/url-to-text?url=...` | $0.003 | any web page as clean plain text for LLMs |
| `GET /api/honeypot?repo=owner/name` | $0.001 | GitHub repo trust score |
| `GET /api/erc20-balance?address=...&token=...` | $0.001 | ERC20 balance on Base |
| `GET /api/token-verdict?address=0x...` | $0.01 | token safety verdict card |
| `GET /api/verdict?repo=owner/name` | $0.001 | one-line repo safety verdict |
| `GET /api/bounties` | $0.001 | funded bounty feed (launch promo) |
| `GET /api/block-number` | $0.001 | latest Base block height |
| `GET /api/time`, `/api/uuid` | $0.001 | UTC time / UUID v4 |
| `GET /api/dossier` | $0.05 | full research dossier: prices + sentiment + news + chain + AI verdict + AI summary |
| `GET /api/starter-kit` | $5.00 | x402 Starter Kit (docs + code samples) |

## Verdict ladder: pay only for the confidence you need

The premium track external agents re-buy most — three tiers, one settlement
mechanics:

| Tier | Price | Use it when |
|------|-------|-------------|
| `GET /api/verdict` · `/api/honeypot` | $0.001 | triage of a token list (100 tokens ≈ $0.10) |
| `GET /api/token-verdict` | $0.01 | machine verdict GREEN/MID/YELLOW/RED before a swap |
| `GET /api/dossier` | $0.05 | large position: full research dossier in one JSON |

```python
from x402_money_reactor import token_verdict_challenge, dossier_challenge

print(token_verdict_challenge("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"))
print(dossier_challenge("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"))
# -> ready-to-sign x402 accepts payload (amount=10000 / 50000, eip155:8453)
```

Agent card & mirrors: <https://makar-reactor.srht.site/>

## How payment works

A paid call returns **HTTP 402** with an x402 `accepts` payload. Settle it with
any x402-enabled client or EIP-3009 wallet, then repeat the request with the
`X-PAYMENT` header.

```python
from x402_money_reactor import challenge

ch = challenge("/api/crypto-price?symbol=BTC-USD")
print(ch)   # {"accepts": [{"scheme": "exact", "network": "base", "maxAmountRequired": "2000", ...}]}
```

Full auto-payment with the official SDK:

```python
# pip install x402
from x402 import x402Client  # see x402 docs for wallet setup
# client wraps fetch(): on 402 it signs an EIP-3009 USDC transfer on Base
# and retries the request automatically.
```

Or drive the settlement yourself with any Base signer — the 402 payload is a
standard EIP-3009 `transferWithAuthorization` to the receiver address in
`maxAmountRequired` (USDC, 6 decimals).

## MCP

The service also speaks MCP: point any MCP client at
`https://money-reactor.makar52nn2016.workers.dev/mcp`.

## Public ledger

All settlements are visible without a key:
`GET /api/status` → `paymentsTotal`, `recentPayments` with on-chain tx hashes.

## License

MIT
