Catalog PyPI
Back to packageRELEASE DETAILS

0.1.2

PyPI

agentpay-python

AgentPay Python SDK — Lightning Network payments for AI agents

Published10 Jun 2026
Direct dependencies1
Transitive dependenciesNot calculated

README

Version 0.1.2 documentation

AgentPay Python SDK

Lightning Network payment infrastructure for AI agents. L402 paywall, credit management, and idempotent spending — in one clean SDK.

Installation

pip install agentpay-python

Quickstart

from agentpay import AgentPayClient

# Get an API key (50 free credits on signup)
client = AgentPayClient(api_key="sg_...")
bal = client.get_balance()
print(f"Balance: {bal.credits_remaining} credits")

# Spend credits (idempotent — safe to retry)
result = client.spend(amount=5.0, description="AI call")
print(f"Spent: {result.credits_used}, Remaining: {result.credits_remaining}")

# Usage forecast
forecast = client.forecast(estimated_cost_per_call=0.05)
if forecast.will_exhaust:
    print("Credits running low!")
print(f"Estimated calls remaining: {forecast.estimated_calls_remaining}")

# L402 Paywall — generate Lightning invoice
pw = client.generate_paywall(amount=10.0, description="Premium content")
print(f"Invoice: {pw.invoice}")

# Topup — purchase more credits
top = client.topup(usd_amount=5.0)
print(f"Topup invoice: {top.invoice}")

API Reference

Full API documentation: api.aipp.dev/docs

Features

  • L402 Paywall — Lightning-native paywall with macaroon tokens
  • Credit System — Prepaid credits with spending limits
  • Idempotent Spending — Safe retry, no double-charges
  • Usage Forecasting — Predict when credits will run out
  • Rate Limiting — IP + API key rate limits
  • LNURL Auth — Login with your Lightning wallet

License

MIT — use it, ship it, build on it.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
httpx
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.25.0runtime

Distribution files

2 collected
agentpay_python-0.1.2-py3-none-any.whl

bdist_wheel · 4.96 KB · Python py3

Source file
agentpay_python-0.1.2.tar.gz

sdist · 4.3 KB · Python source

Source file

Repository

PENDING
aippdev/agentpay-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:53 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:b82235513a3f8e2e5572599f77a5ecddcd461d81742eacf6304b86717f1d718b

Other collected versions

View all collected versions →