DEV Community

Aifinpay
Aifinpay

Posted on

How to Add Payments to AI Agents in 3 Lines of Code

AI agents can call APIs but can't pay for services. AiFinPay x402 protocol fixes this.

from aifinpay import Agent
agent = Agent.new()
resp = agent.pay("https://api.example.com/data")
Enter fullscreen mode Exit fullscreen mode

One SDK call = one paid response. Settlement on Polygon mainnet.

GitHub: https://github.com/AiFinPay/sdk
Install: pip install aifinpay-agent --pre

Top comments (0)