Skip to main content

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).

PyPI version License: MIT Base Mainnet


⚡ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aimpn-2.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aimpn-2.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for aimpn-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8bc82161038b864eeae3471c37b0358ff2233577a2f1fe0e07242db07e27f668
MD5 f02c9cbd45be17ae2401558185a995c7
BLAKE2b-256 648b9fb5b2c9ff00c5edfcd6a75f0636580737f95cd0862bfbcae93399a4d652

See more details on using hashes here.

Provenance

The following attestation bundles were made for aimpn-2.0.0.tar.gz:

Publisher: publish-pypi.yml on tdpeta754-design/ai-micropayment-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for aimpn-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60ad8c96852406ebc4966c03fa627c8d8630078d84fb8b2c8dc9ab81c26ba9ea
MD5 b4088a15bbf7bbcbbe6b8b02f1bd8708
BLAKE2b-256 dbcdeb38efa609999366b8d301abf75448d256f674955ef49489f86f190ddd07

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page