Common issues and solutions when running AgentPay.
Symptom: agentpay-bot exits immediately or loops.
- Check bot token: Ensure
BOT_TOKENin.envis valid. Get a new one from @BotFather. - Token conflict: Only one process can use a bot token at a time. If another instance is running (different server, local dev), stop it first — Telegram returns
409 Conflict. - Check logs:
docker compose logs agentpay-bot --tail=50
Symptom: All API calls return Internal Server Error.
- Database not ready: The API needs PostgreSQL running. Check:
docker compose ps— isdbhealthy? - Missing migrations: Run
docker compose exec api python -c "from database import init_db; import asyncio; asyncio.run(init_db())"to initialize tables. - Check logs:
docker compose logs agentpay-api --tail=50
Symptom: Webhooks not arriving at your endpoint.
- URL reachable?: AgentPay must be able to reach your webhook URL.
localhostwon't work — use a tunnel (ngrok, Cloudflare Tunnel) for development. - HTTPS required: Webhook URLs must use HTTPS.
- Signature verification failing?: Ensure you're using the correct webhook secret and comparing HMAC-SHA256 hex digests. See
examples/webhook_receiver.py. - Timeout: Endpoints must respond within 10 seconds or the delivery is marked failed.
Symptom: /fund command doesn't show payment option.
- Bot must have payments enabled: In BotFather, use
/mybots→ your bot → Payments → enable a provider. - Stars require Telegram 10.0+: Ensure the user's app is updated.
- Test mode: Stars payments don't work in test mode — use a real Telegram account.
Symptom: Sent USDC to agent wallet but balance doesn't update.
- Correct chain?: Each agent has separate addresses per chain (Base, Polygon, BNB, Solana). Sending to the wrong chain means funds go to a different address.
- Confirmation time: Base/Polygon: ~2-5 min. BNB: ~3 min. Solana: ~30 sec.
- Minimum amount: Very small amounts (< $0.01) may be ignored due to gas economics.
Symptom: ConnectionError or TimeoutError from Python/TS SDK.
# Python — increase timeout
from agentpay import AgentPay
client = AgentPay(api_key="...", base_url="https://leofundmybot.dev", timeout=30)// TypeScript — increase timeout
import { AgentPay } from 'agentpay';
const client = new AgentPay({ apiKey: '...', baseUrl: 'https://leofundmybot.dev', timeout: 30000 });- Check base URL: Default is
https://leofundmybot.dev. If self-hosting, setbase_url/baseUrl. - API key valid?: Use
/myagentsin the Telegram bot to verify your key is active. - Rate limited?: SDK retries automatically on 429. If persistent, you're exceeding limits.
docker compose logs <service> --tail=100Usually a missing env var or database connection issue.
# Find what's using port 8080
lsof -i :8080
# Or change the port in docker-compose.yml# Clean up Docker artifacts
docker system prune -a --volumesSymptom: MCP tools not showing up in your AI agent.
- stdio mode: Ensure
AGENTPAY_API_KEYis set in the environment where the MCP server runs. - HTTP mode: The
x-api-keyheader must be included in every request tohttps://leofundmybot.dev/mcp. - Tool list empty?: Check that the API key has sufficient permissions (agent-level keys can only access their own wallet).
- GitHub Issues: github.com/lfp22092002-ops/agentpay/issues
- Telegram: @FundmyAIbot —
/helpfor bot commands - API Docs:
https://leofundmybot.dev/docs(interactive Swagger UI)