AgentGatePay examples use blockchain RPC endpoints to interact with Ethereum, Base, Polygon, and Arbitrum networks. The RPC provider you choose significantly impacts payment speed.
| RPC Provider | Ethereum Speed | Cost | Reliability | Sign Up |
|---|---|---|---|---|
| BlastAPI (default) | 60-120s | Free | 70% | None |
| Alchemy (recommended) | 5-10s | Free tier | 99.9% | alchemy.com |
| Infura | 5-10s | Free tier | 99.5% | infura.io |
| QuickNode | 3-5s | Paid | 99.9% | quicknode.com |
For Base, Polygon, Arbitrum: Default free RPCs are fast (5-15s). Ethereum is the only chain where premium RPC makes a big difference.
Free Tier: 300M compute units/month (sufficient for thousands of payments)
- Go to https://www.alchemy.com/
- Create a free account
- Dashboard → "Create new app"
- Chain: Ethereum Mainnet
- Network: Mainnet
- Copy the HTTPS URL
# Replace this line in your .env file:
ETHEREUM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEYpython3 examples/2a_api_buyer_agent.pyResult: Ethereum payments go from 60-120s → 5-10s ⚡
Free Tier: 100K requests/day
- Sign up at https://www.infura.io/
- Create project → Ethereum Mainnet
- Copy HTTPS endpoint
- Update .env:
ETHEREUM_RPC_URL=https://mainnet.infura.io/v3/YOUR_PROJECT_ID
Configure RPCs for all chains in .env:
# Ethereum (use premium RPC for best performance)
ETHEREUM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
# Base (default is fast enough)
BASE_RPC_URL=https://mainnet.base.org
# Polygon (default is okay, but Alchemy is faster)
POLYGON_RPC_URL=https://polygon-mainnet.g.alchemy.com/v2/YOUR_KEY
# Arbitrum (default is fast enough)
ARBITRUM_RPC_URL=https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY- Buyer broadcasts TX → Blockchain confirms in 12-30s
- Buyer verifies TX locally → RPC must return receipt
- Gateway verifies TX → Uses its own RPC
Slow RPC = buyer waits 60-120s even though blockchain confirmed in 12s
- Gateway: Always uses fast RPC (Cloudflare)
- Your buyer script: Uses YOUR .env RPC
- Gateway accepts payments in 3-10s regardless of your RPC
- YOU wait for YOUR RPC to confirm locally
Problem: Your RPC is too slow to return transaction receipt
Solution:
- Use Alchemy or Infura (recommended)
- OR increase timeout in buyer script (not recommended - just masks slow RPC)
Check:
- Verify you updated the correct .env file
- Restart the script after changing .env
- Check Alchemy dashboard for rate limit errors
Alchemy Free Tier: 300M compute units/month
- Each Ethereum payment: ~50K compute units
- Supports: ~6,000 payments/month free
- If exceeded: Upgrade to growth plan ($49/month unlimited)
| Provider | Monthly Limit | Ethereum Payments | Cost After Limit |
|---|---|---|---|
| BlastAPI | Unlimited | Unlimited | Always free (but slow) |
| Alchemy | 300M CU | ~6,000 | $49/month |
| Infura | 100K requests | ~50,000 | $50/month |
Hobbyist / Testing:
- Use BlastAPI (default) - Free and works
- Accept 60-120s payment time
Production / Better UX:
- Use Alchemy free tier - 6,000 payments/month free
- 5-10s payment time
- Upgrade to paid if needed
High Volume:
- Alchemy Growth ($49/month unlimited)
- QuickNode ($9-299/month based on throughput)
For production, consider configuring fallback RPCs:
# In your custom integration
rpcs = [
os.getenv('ETHEREUM_RPC_PRIMARY'),
os.getenv('ETHEREUM_RPC_FALLBACK'),
'https://eth-mainnet.public.blastapi.io' # Last resort
]This requires custom code modification (not supported in basic examples).
✅ Default free RPCs work - just slower for Ethereum ✅ Alchemy free tier recommended - 10-20x faster for Ethereum ✅ Easy setup - just change one line in .env ✅ No code changes needed - fully supported
For best UX: Use Alchemy for Ethereum, keep defaults for other chains.