Metadata-Version: 2.1
Name: minia2a
Version: 0.1.0
Summary: Python SDK for minia2a.uk — discover, try, and pay for 323+ x402 agent APIs
Home-page: https://minia2a.uk
Author: minia2a
Author-email: hello@minia2a.uk
License: UNKNOWN
Keywords: x402 agent payments usdc m2m ai-agent api marketplace micropayments
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# minia2a Python SDK

**Give your Python AI agents access to 323+ pay-per-call APIs.** USDC on Base. Free trials. No KYC.

```python
from minia2a import Client

client = Client()

# Free trial — no wallet needed (5 calls per endpoint)
gas = client.try_service("gas")
print(gas["data"]["gas"]["price"])  # "0.151 gwei"

# Register your agent — 500 free credits, auto-wallet, 10 seconds
client.register("my-trading-bot")
# → {'wallet': '0x...', 'privateKey': '0x...', 'credits': 500}

# Now call with your wallet
token = client.call("token-security", address="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48")
print(token["data"]["isHoneypot"])  # False

# Search the marketplace
results = client.discover("captcha")
for s in results["services"][:3]:
    print(f"{s['name']}: {s['priceCents']}¢ — {s['description']}")

# Check your balance
print(client.my_credits())
```

## Installation

```bash
# From minia2a.uk
pip install https://minia2a.uk/sdk/minia2a-py/minia2a-0.1.0.tar.gz

# Or from GitHub
pip install git+https://github.com/minia2a-org/minia2a-py.git
```

## Features

- **Zero dependencies** — stdlib only (no requests, no aiohttp)
- **Auto-wallet** — first call registers you, 500 free credits
- **Cross-compatible** — shares wallet file with the JS/Node SDK (`~/.minia2a/wallet.json`)
- **Full marketplace access** — discover, search, get stats, check credits
- **5 free trials per endpoint** — try before you pay

## API Overview

| Method | Description |
|--------|-------------|
| `client.call(service, **params)` | Call any x402 endpoint with wallet |
| `client.try_service(service, **params)` | Free trial call (no wallet) |
| `client.discover(query)` | Search the marketplace |
| `client.service_info(id)` | Get service details |
| `client.stats()` | Live platform stats |
| `client.register(name)` | Create wallet + 500 free credits |
| `client.my_credits()` | Check credit balance |
| `client.top_services(n)` | Top services by usage |
| `client.list_categories()` | Service categories with counts |

## Quick Start: LangChain Agent

```python
from minia2a import Client
from langchain.agents import Tool

client = Client()
client.register("langchain-agent")  # One-time setup

tools = [
    Tool(name="gas_price", func=lambda _: client.call("gas")["data"]["gas"]["price"],
         description="Get Ethereum gas price"),
    Tool(name="token_audit", func=lambda addr: client.call("token-security", address=addr)["data"],
         description="Audit a token contract for security risks"),
    Tool(name="web_scrape", func=lambda url: client.call("web-scrape", url=url)["data"],
         description="Scrape a webpage"),
]
```

## Pricing

- **Free**: 5 trial calls per endpoint
- **Registration**: 500 free credits (= $2.50 value)
- **Paid**: Per-call pricing, 1 credit = $0.005 (half a cent)
- **Top-up**: 1 USDC = 200 credits on Base L2

## License

MIT


