DEV Community

Yaqing2023
Yaqing2023

Posted on

MoltsPay Python SDK 0.7.0: Multi-Chain Agent Payments Are Here

TL;DR

MoltsPay Python SDK now supports 8 blockchain networks for AI agent payments. Pay for services on Base, Polygon, BNB, Solana, and more — all gasless.

pip install moltspay==0.7.0
Enter fullscreen mode Exit fullscreen mode

What's MoltsPay?

MoltsPay is payment infrastructure for AI agents. It lets agents pay for services (video generation, image processing, API calls) using stablecoins — without needing gas tokens or complex wallet management.

The protocol uses x402 for gasless payments: client signs an intent, server settles on-chain.


What's New in 0.7.0

8 Supported Chains

Chain Network ID Tokens
Base base USDC, USDT
Polygon polygon USDC
BNB Chain bnb USDC, USDT
opBNB opbnb USDC
Solana solana USDC
Tempo tempo_moderato pathUSD
Base Sepolia base_sepolia USDC
BNB Testnet bnb_testnet USDC

Multi-Chain Server

The Python server now handles payments from ANY supported chain automatically:

from moltspay.server import create_server

app = create_server(
    skill_dir='./my-skill',
    networks=['base', 'polygon', 'bnb', 'solana'],  # Accept all!
    wallet='0x...',
    solana_wallet='So1ana...'
)
Enter fullscreen mode Exit fullscreen mode

The server detects which chain the client wants to pay on and routes to the correct facilitator.

Solana Support

Solana uses a separate Ed25519 keypair (not EVM). The SDK handles this automatically:

# Initialize creates both EVM + Solana wallets
moltspay init

# Check balances on all chains
moltspay status
Enter fullscreen mode Exit fullscreen mode

Quick Start: Client

# Install
pip install moltspay

# Create wallet
moltspay init

# Fund with testnet USDC
moltspay faucet --chain base_sepolia

# Pay for a service
moltspay pay https://example.com/api text-to-video \
  --prompt "a cat dancing" \
  --chain base_sepolia
Enter fullscreen mode Exit fullscreen mode

Quick Start: Server

Create a paid AI service in 3 files:

moltspay.services.json

{
  "provider": {
    "name": "My AI Service",
    "wallet": "0xYourWallet"
  },
  "services": [{
    "id": "generate-image",
    "name": "AI Image Generation",
    "function": "generate",
    "price": 0.50,
    "currency": "USDC",
    "networks": ["base", "polygon", "bnb"]
  }]
}
Enter fullscreen mode Exit fullscreen mode

index.py

async def generate(prompt: str) -> dict:
    # Your AI logic here
    image_url = await my_ai_model(prompt)
    return {"image": image_url}
Enter fullscreen mode Exit fullscreen mode

Run it:

moltspay start ./my-skill --port 8402
Enter fullscreen mode Exit fullscreen mode

That's it. Your service now accepts gasless USDC payments on 3 chains.


For AI Agent Developers

We also updated the MoltsPay Skill for agent frameworks:

# OpenClaw / LangChain agents can install:
npm install moltspay-skill
Enter fullscreen mode Exit fullscreen mode

The skill teaches agents how to:

  • Initialize wallets
  • Check balances across chains
  • Discover and pay for services
  • Handle errors gracefully

Why Multi-Chain?

Different chains have different tradeoffs:

  • Base: Lowest fees, Coinbase ecosystem
  • Polygon: Widely supported, good liquidity
  • BNB: High liquidity in Asia
  • Solana: Fastest confirmations
  • opBNB: Ultra-low fees for micro-payments

Letting your service accept multiple chains means more potential customers.


Links


Questions? Drop a comment or open an issue on GitHub.

Happy building! 🚀

Top comments (0)