AgentPay Python SDK — AI agent ödeme altyapısı
Project description
AgentPay Python SDK
AI agent'lar için Lightning Network tabanlı ödeme altyapısı.
Kurulum
pip install agentpay-sdk
Kullanım
from agentpay import AgentPayClient
# Yeni API key al (50 ücretsiz kredi ile)
client = AgentPayClient(api_key="sg_...")
bal = client.get_balance()
print(f"Bakiye: {bal.credits_remaining} kredi")
# Kredi harca (idempotent)
result = client.spend(amount=5.0, description="AI çağrısı")
print(f"Harcandı: {result.credits_used}, Kalan: {result.credits_remaining}")
# Bakiye tahmini
forecast = client.forecast(estimated_cost_per_call=0.05)
if forecast.will_exhaust:
print("Bakiye azalıyor!")
print(f"Tahmini çağrı: {forecast.estimated_calls_remaining}")
# Paywall (L402) — LN faturası ile ödeme
pw = client.generate_paywall(amount=10.0, description="Premium içerik")
print(f"Fatura: {pw.invoice}")
# Topup — kredi yükle
top = client.topup(usd_amount=5.0)
print(f"Yükleme faturası: {top.invoice}")
API Referansı
Tüm metodlar ve modeller için: api.aipp.dev/docs
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
agentpay_python-0.1.1.tar.gz
(4.1 kB
view details)
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 agentpay_python-0.1.1.tar.gz.
File metadata
- Download URL: agentpay_python-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f84bf8b1566972017e567c7b4c051ecbda41e2653adff5c80a9853fac2d8b61
|
|
| MD5 |
196463f21bcc3c64a2efbbd2a6f466ea
|
|
| BLAKE2b-256 |
ea2eb1b9ac4bc2d99f80a1c8095e08951ccab80694a6b6db53b9214e45fc22ff
|
File details
Details for the file agentpay_python-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agentpay_python-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b35642f5910fca7f3ce3b945b04f9a41b924c6cdbde1c8f3d0d15c8a8c799605
|
|
| MD5 |
ad6b45a04625d8e19e0a1d6039ecdf79
|
|
| BLAKE2b-256 |
c1ec246e76777e940fb2c85b2bae5273f55de5e20b62edc6a842d3dcc45875aa
|