Skip to main content

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


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.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

agentpay_python-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file agentpay_python-0.1.0.tar.gz.

File metadata

  • Download URL: agentpay_python-0.1.0.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

Hashes for agentpay_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cd98a42d3ac10e0ac4b73444562a3056c041af3baf81603c87341f34175a292a
MD5 30fdc4aa76508bccf8b5d39a16f9c555
BLAKE2b-256 e49d5063b162cc86c3b8557017b83eb60a3a8bfcb9f347509068eb716feb7516

See more details on using hashes here.

File details

Details for the file agentpay_python-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentpay_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30acad6f8c549c32fefb5667e36f3c52731dc63e76f8ea61e5de15dd20a01262
MD5 5e9c8fe5b6bde58d89750b496da52cb9
BLAKE2b-256 d522daeb98d3fa35271933c4118b7827ddfad5166c10d9a89a21ec8352ef5199

See more details on using hashes here.

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