Official Python SDK & x402 Zero-Gas Micropayment Paywall Decorator for HuggingFace Spaces and AI Agents on Base Mainnet
Project description
🤖 aimpn — Official Python SDK for AI Micropayment Network v2.0
Zero-Gas x402 Micropayment Paywalls for HuggingFace Spaces, Gradio, FastAPI, and AI Agents on Base Mainnet (L2).
⚡ Installation
pip install aimpn
🚀 Quick Start (HuggingFace Spaces / Gradio / FastAPI)
Add an instant zero-gas x402 paywall to any AI model inference endpoint in just 1 line of code:
from aimpn import require_x402_payment
@require_x402_payment(amount="0.01", recipient="0xYourBaseWalletAddress", model_name="Llama-3-70B Space")
def predict(prompt: str, payment_header: str = None):
# Your standard AI generation logic here
return f"🤖 AI Generated response for: {prompt}"
🎁 Why developers love this
When an AI agent calls your monetized endpoint without a payment header, aimpn automatically returns an HTTP 402 Payment Required exception with full instructions on how to send the $0.01 USDC micropayment using our Zero-Gas ERC-4337 Paymaster (0x7Df0AA...).
Bonus: Builders who call your endpoint 100 times automatically receive a $10.00 USDC Builder Bounty from our on-chain indexer!
Visit https://github.com/tdpeta754-design/ai-micropayment-network for full documentation and interactive playgrounds.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aimpn-2.0.0.tar.gz.
File metadata
- Download URL: aimpn-2.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bc82161038b864eeae3471c37b0358ff2233577a2f1fe0e07242db07e27f668
|
|
| MD5 |
f02c9cbd45be17ae2401558185a995c7
|
|
| BLAKE2b-256 |
648b9fb5b2c9ff00c5edfcd6a75f0636580737f95cd0862bfbcae93399a4d652
|
Provenance
The following attestation bundles were made for aimpn-2.0.0.tar.gz:
Publisher:
publish-pypi.yml on tdpeta754-design/ai-micropayment-network
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aimpn-2.0.0.tar.gz -
Subject digest:
8bc82161038b864eeae3471c37b0358ff2233577a2f1fe0e07242db07e27f668 - Sigstore transparency entry: 2279749242
- Sigstore integration time:
-
Permalink:
tdpeta754-design/ai-micropayment-network@71684a178ad6bd356aea7316a2bba33513820f65 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tdpeta754-design
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@71684a178ad6bd356aea7316a2bba33513820f65 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file aimpn-2.0.0-py3-none-any.whl.
File metadata
- Download URL: aimpn-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60ad8c96852406ebc4966c03fa627c8d8630078d84fb8b2c8dc9ab81c26ba9ea
|
|
| MD5 |
b4088a15bbf7bbcbbe6b8b02f1bd8708
|
|
| BLAKE2b-256 |
dbcdeb38efa609999366b8d301abf75448d256f674955ef49489f86f190ddd07
|
Provenance
The following attestation bundles were made for aimpn-2.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on tdpeta754-design/ai-micropayment-network
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aimpn-2.0.0-py3-none-any.whl -
Subject digest:
60ad8c96852406ebc4966c03fa627c8d8630078d84fb8b2c8dc9ab81c26ba9ea - Sigstore transparency entry: 2279749271
- Sigstore integration time:
-
Permalink:
tdpeta754-design/ai-micropayment-network@71684a178ad6bd356aea7316a2bba33513820f65 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tdpeta754-design
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@71684a178ad6bd356aea7316a2bba33513820f65 -
Trigger Event:
workflow_dispatch
-
Statement type: