Skip to main content

Python SDK for AsterPay — EUR settlement for AI agent commerce via x402 protocol

Project description

asterpay

Python SDK for AsterPay — EUR settlement for AI agent commerce via x402 protocol.

PyPI Python License

What is AsterPay?

AsterPay is the EUR settlement layer for AI agent commerce. Convert USDC to EUR via SEPA Instant in under 5 seconds — on Base, MiCA-compliant, and listed in the Coinbase x402 ecosystem.

Key features:

  • KYA (Know Your Agent) — 5-layer trust scoring (0-100) for AI agent wallets
  • EUR Settlement — USDC/EURC → EUR via SEPA Instant
  • LangChain + CrewAI — 20+ ready-made tools
  • x402 Protocol — HTTP 402 pay-per-call with USDC
  • Referenced in Google A2A spec for trust.signals[]

Install

pip install asterpay

Quick Start

from asterpay import AsterPay

client = AsterPay()

# Get a crypto price ($0.001 USDC)
price = client.market.price("bitcoin")
print(f"BTC: ${price['price']}")

# Get EUR settlement estimate (FREE)
quote = client.settlement.estimate(amount_usdc=100)
print(f"100 USDC → {quote['eur_amount']} EUR")

# AI text summarization ($0.01 USDC)
result = client.ai.summarize("Your long article text here...")
print(result['summary'])

# Check your ASTERPAY tier (FREE)
tier = client.token.check_wallet("0xYourWallet...")
print(f"Tier: {tier['tier']} ({tier['discount']}% discount)")

LangChain Integration

pip install asterpay[langchain]
from asterpay.langchain import get_asterpay_tools
from langchain.agents import create_react_agent

# 19 tools — market data, AI, EUR settlement, crypto analytics
tools = get_asterpay_tools()
agent = create_react_agent(llm, tools)

# Or just the free tools (no x402 payment needed)
from asterpay.langchain import get_free_tools
free_tools = get_free_tools()

# Or just the KYA (trust scoring) tools
from asterpay.langchain import get_asterpay_kya_tools
kya_tools = get_asterpay_kya_tools()

CrewAI Integration

pip install asterpay[crewai]
from asterpay.crewai import get_asterpay_tools
from crewai import Agent

analyst = Agent(
    role="Crypto Analyst",
    goal="Analyze market trends and settle profits to EUR",
    tools=get_asterpay_tools()
)

Both Frameworks

pip install asterpay[agents]  # installs langchain + crewai support

Async Support

from asterpay import AsyncAsterPay
import asyncio

async def main():
    async with AsyncAsterPay() as client:
        price = await client.market.price("ethereum")
        print(f"ETH: ${price['price']}")

asyncio.run(main())

Services

Service Endpoints Pricing
client.market price(), ohlcv(), trending() $0.001–$0.005
client.ai summarize(), sentiment(), translate(), code_review() $0.01–$0.05
client.crypto wallet_score(), token_analysis(), whale_alerts() $0.02–$0.10
client.utility qr_code(), screenshot(), pdf() $0.005–$0.03
client.settlement estimate(), quote(), transfer_status() FREE
client.token tiers(), check_wallet(), stats() FREE
client.discovery resources() FREE

ASTERPAY Token Discounts

Hold $ASTERPAY tokens to unlock API discounts:

Tier Balance Discount
Explorer 0 0%
Builder 100K 10%
Professional 1M 25%
Enterprise 10M 40%
Whale 50M 60%
# Pass your wallet for automatic tier discounts
client = AsterPay(wallet_address="0xYourWallet...")

EUR Settlement

AsterPay's core feature — USDC to EUR via SEPA Instant:

# 1. Get a quote
quote = client.settlement.estimate(amount_usdc=500)
print(f"500 USDC → {quote['eur_amount']} EUR (fee: {quote['fee']})")

# 2. Check Bridge provider health
health = client.settlement.bridge_health()
print(f"Bridge status: {health['status']}")

x402 Protocol

Paid endpoints use the x402 HTTP payment protocol. When a 402 response is returned, your x402-compatible wallet or agent framework handles the USDC micropayment automatically.

Also Available

  • MCP Server: npx @asterpay/mcp-server — for Claude, Cursor, and other AI tools
  • REST API: Direct HTTP access at https://x402-api-production-ba87.up.railway.app

Links

License

MIT

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

asterpay-0.2.1.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

asterpay-0.2.1-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file asterpay-0.2.1.tar.gz.

File metadata

  • Download URL: asterpay-0.2.1.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for asterpay-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ea91ea81052ed27e4b52662b1a8b567d5605c6bdba760da038663bb21a45b406
MD5 3b70bca314dce7429890be3edabf8ffb
BLAKE2b-256 aa9ea5363aac0d94ee722885e314c212639106a01d914e80ec357302d48d9bd4

See more details on using hashes here.

File details

Details for the file asterpay-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: asterpay-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for asterpay-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6614a88a38002c9142018883a0a4227c12528d748385057c1b2e11659fa82505
MD5 a0cb5dbbef956028107915d82125a787
BLAKE2b-256 cc24d4f0508553a95d351fd3027aafc9c8412cf3a1bd9ee03e2fb7391b538267

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