⚡ A-Pay Protocol (AgentPay)
The Universal Micropayment & Economic Layer for Autonomous AI Agents
🎯 Vision & Identity
A-Pay is an ultra-lightweight, zero-latency, open economic rail designed for the machine-to-machine (M2M) economy. Just as UPI revolutionized human digital payments in India, A-Pay enables autonomous AI software agents to discover, consume, and pay for data, compute, APIs, and micro-services on the fly—without credit cards, human KYC, or seed phrase friction.
🚀 1-Command Experience
1. Website / API Owners (The Sellers)
Protect ANY existing website or API with an instant HTTP 402 crypto paywall—zero code modifications required:
apay protect --target http://localhost:8000 --price 0.001 --wallet 0xYourWalletAddress
- Incoming requests from AI bots will automatically receive an HTTP 402 Payment Required challenge.
- Once the AI agent's cryptographic micropayment is verified (<15ms), the request is forwarded to your server and data is unlocked!
2. AI Agent Developers (The Buyers)
Give your AI agent an in-memory wallet and strict spending guardrails with 2 lines of code:
from apay import APaySession, AgentWallet
# Generate or load wallet with daily safety limit
wallet = AgentWallet(private_key="0x...", max_per_call_usdc=0.01, daily_budget_usdc=5.0)
session = APaySession(wallet)
# Automatically handles HTTP 402 challenges & settles on the fly
response = session.get("https://protected-api.com/market-data")
print(response.json())
📦 Directory Structure
/home/sagar/a_pay/
├── .aum_identity.md # AUM Project Core Identity binding
├── RULEBOOK.md # 📜 Master Rulebook: M2M Core, H2B Checkout & $APAY Token
├── neural_ais/ # Symlink to /home/sagar/neural_core
├── pyproject.toml # Hatchling & uv build system (CLI entrypoint: `apay`)
├── src/
│ └── apay/
│ ├── __init__.py # Package exports
│ ├── cli.py # ⚡ 1-Command CLI (`apay protect`, `apay wallet new`, `apay pay`)
│ ├── client.py # 🤖 Auto-settling HTTP client (sync & async)
│ ├── wallet.py # 🔐 In-memory wallet + local spending limits
│ └── proxy.py # 🛡️ Ultra-light reverse proxy paywall (Starlette + viem/eth)
├── contracts/
│ └── src/
│ └── APayRouter.sol# Solidity ^0.8.28 Smart Contract Router (1% protocol fee)
├── tests/
│ └── test_flow.py # Automated integration & guardrail test suite
├── spec/
│ ├── HTTP_402_SPEC.md # Official RFC wire format
│ └── SECURITY_MODEL.md # Anti-replay & infinite-loop drain mitigations
└── ARCHITECTURE.md # Technical deep-dive
🛠️ Quickstart & Local Testing
# 1. Activate virtual environment
source .venv/bin/activate
# 2. Run automated test suite
pytest tests/
# 3. Generate a new Agent Wallet
apay wallet new
# 4. Protect a local service
apay protect --target http://localhost:8000 --price 0.001 --wallet 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
Standalone root project under /home/sagar/a_pay, connected to AUM / system_core.
Release files for apay 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 | |
|---|---|---|---|
| apay-0.1.0.tar.gz | 18.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apay-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.4 kB
Release files / apay-0.1.0.tar.gz
| Download URL | apay-0.1.0.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b322ca6e277cf988a6acdeab08a95e96c4efc8070e3feb2a87cd16fb74d005bf
|
|
BLAKE2b-256 checksum How to use checksums |
7ea4a49a2faab2c4d8f848f4951eb62dd23109aab10a3c90db8b55db5ad8b55a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / apay-0.1.0-py3-none-any.whl
| Download URL | apay-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e2f123a51dae24de3d631ad190e2773dc2631e7f9e1ff5e9e37271812609f7c
|
|
BLAKE2b-256 checksum How to use checksums |
9fd1145adb7001f7e1ef41aae204603f74c24968b250c7a98d4563fd06009609
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|