-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Yaqing2023 edited this page Mar 7, 2026
·
1 revision
Get up and running with MoltsPay Python SDK.
- Python 3.9+
- USDC on Base network
pip install moltspayFor LangChain integration:
pip install moltspay[langchain]from moltspay import MoltsPay
client = MoltsPay()
print(f"Wallet address: {client.address}")On first run, a wallet is automatically created at ~/.moltspay/wallet.json.
Send USDC to your wallet address on Base network.
No ETH needed! MoltsPay uses gasless transactions.
print(f"Balance: {client.balance()} USDC")services = client.discover("https://juai8.com/zen7")
for svc in services:
print(f"{svc.id}: {svc.price} {svc.currency}")Output:
text-to-video: 0.99 USDC
image-to-video: 1.49 USDC
result = client.pay(
"https://juai8.com/zen7",
"text-to-video",
prompt="a happy cat playing piano"
)
print(f"Video URL: {result.result['video_url']}")Done! The payment happens automatically via x402.
Protect your wallet:
# Check current limits
limits = client.limits()
print(f"Max per tx: {limits.max_per_tx}")
print(f"Spent today: {limits.spent_today}")
# Update limits
client.set_limits(max_per_tx=20, max_per_day=200)For high-performance applications:
import asyncio
from moltspay import AsyncMoltsPay
async def main():
async with AsyncMoltsPay() as client:
result = await client.pay(
"https://juai8.com/zen7",
"text-to-video",
prompt="a cat dancing"
)
print(result.result)
asyncio.run(main())Wallet format is compatible with the Node.js CLI:
# Create wallet with Node CLI
npx moltspay init --chain base
# Use same wallet in Python
python -c "from moltspay import MoltsPay; print(MoltsPay().address)"- API Reference - All methods
- LangChain Integration - Use with AI agents
- Examples - More use cases