AsterPay AutoGPT/AgentGPT Integration
Payment capabilities for autonomous AI agents.
Overview
asterpay-autogpt provides payment tools for AI agent frameworks:
- AutoGPT - Component-based architecture support
- AgentGPT - Generic tool interface
- Any Framework - OpenAI function calling format
Installation
pip install asterpay-autogpt
Quick Start
AutoGPT Component
from autogpt.agents import Agent
from asterpay_autogpt import AsterPayComponent
class PaymentAgent(Agent):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.asterpay = AsterPayComponent(
private_key=os.environ["AGENT_PRIVATE_KEY"],
network="base",
daily_limit=10.0,
max_auto_pay=0.50,
)
Generic Tools (Any Framework)
from asterpay_autogpt import AsterPayTools
tools = AsterPayTools(
private_key=os.environ["AGENT_KEY"],
daily_limit=10.0,
)
# Check balance
balance = await tools.check_balance()
print(f"Balance: {balance}")
# Access paid API
result = await tools.paid_fetch("https://api.paid-service.com/data")
print(f"Data: {result['data']}")
# Make payment
payment = await tools.make_payment(
recipient="0x...",
amount=5.00,
memo="Service payment"
)
OpenAI Function Calling
from asterpay_autogpt import AsterPayTools
import openai
tools = AsterPayTools(private_key=os.environ["KEY"])
# Get function definitions
functions = tools.get_openai_function_definitions()
# Use with OpenAI
response = openai.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Check my wallet balance"}],
tools=functions,
)
# Execute function call
if response.choices[0].message.tool_calls:
call = response.choices[0].message.tool_calls[0]
result = await tools.execute_function(
call.function.name,
json.loads(call.function.arguments)
)
Available Commands
| Command | Description |
|---|---|
asterpay_balance |
Check wallet USDC balance |
asterpay_spending |
View spending against limits |
asterpay_fetch |
Fetch URLs with automatic x402 payment |
asterpay_pay |
Make direct USDC payments |
asterpay_transactions |
View payment history |
Spending Limits
Protect your agent with configurable limits:
AsterPayComponent(
private_key=key,
per_transaction_limit=2.0, # Max $2 per transaction
hourly_limit=5.0, # Max $5/hour
daily_limit=25.0, # Max $25/day
monthly_limit=200.0, # Max $200/month
max_auto_pay=0.50, # Max auto-pay for x402
)
Networks
| Network | Chain ID | Use Case |
|---|---|---|
base |
8453 | Production (recommended) |
base-sepolia |
84532 | Testing |
polygon |
137 | Alternative L2 |
arbitrum |
42161 | Alternative L2 |
Environment Variables
# Required
AGENT_PRIVATE_KEY=0x...
# Optional
ASTERPAY_NETWORK=base
ASTERPAY_DAILY_LIMIT=10.0
Security
- Never hardcode private keys
- Set appropriate spending limits
- Use testnet for development
- Monitor agent transactions
Links
- Website: asterpay.io
- Demo: demo.asterpay.io
- Docs: asterpay.io/docs
License
MIT License
Metadata
Release files for asterpay-autogpt 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asterpay_autogpt-1.0.0.tar.gz | 10.8 kB | Without provenance | Details for asterpay_autogpt-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asterpay_autogpt-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for asterpay_autogpt-1.0.0-py3-none-any.whl |
Total release size: 23.8 kB
Release files / asterpay_autogpt-1.0.0.tar.gz
| Download URL | asterpay_autogpt-1.0.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a56d6c85aab137aea01251b57182a7840c5cafc02afe6829b614ece36325a4a
|
|
BLAKE2b-256 checksum How to use checksums |
24f7056874384e8316eb76dbdf1c9940942d25ec046b295890807a272a479f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / asterpay_autogpt-1.0.0-py3-none-any.whl
| Download URL | asterpay_autogpt-1.0.0-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a43c0f40eee41a90a0e9cdf2956be1702247beb114b9a21bb4a2fdb2d44e2b6
|
|
BLAKE2b-256 checksum How to use checksums |
eaa32b9f26f0049ef152013123cafdf0b174a5b558cadb39c2ab3e896c70909f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for asterpay-autogpt 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.