PaymanAI
PaymanAI provides functionality to send and receive payments (fiat and crypto) on behalf of an AI Agent. To get started:
- Sign up at app.paymanai.com to create an AI Agent and obtain your API Key.
 - Set environment variables (
PAYMAN_API_SECRETfor your API Key,PAYMAN_ENVIRONMENTfor sandbox or production). 
This notebook gives a quick overview of integrating PaymanAI into LangChain as a tool. For complete reference, see the API documentation.
Overviewโ
The PaymanAI integration is part of the langchain-community (or your custom) package. It allows you to:
- Send payments (
send_payment) to crypto addresses or bank accounts. - Search for payees (
search_payees). - Add new payees (
add_payee). - Request money from customers with a hosted checkout link (
ask_for_money). - Check agent or customer balances (
get_balance). 
These can be wrapped as LangChain Tools for an LLM-based agent to call them automatically.
Integration detailsโ
| Class | Package | Serializable | JS support | Package latest | 
|---|---|---|---|---|
| PaymanAI | langchain-payman-tool | โ | โ | [PyPI Version] | 
If you're simply calling the PaymanAI SDK, you can do it directly or via the Tool interface in LangChain.
Setupโ
- Install the PaymanAI tool package:
 
pip install langchain-payman-tool
- Install the PaymanAI SDK:
 
pip install paymanai
- Set environment variables:
 
export PAYMAN_API_SECRET="YOUR_SECRET_KEY"
export PAYMAN_ENVIRONMENT="sandbox"
Your PAYMAN_API_SECRET should be the secret key from app.paymanai.com. The PAYMAN_ENVIRONMENT can be sandbox or production depending on your usage.
Instantiationโ
Here is an example of instantiating a PaymanAI tool. If you have multiple Payman methods, you can create multiple tools.
from langchain_payman_tool.tool import PaymanAI
# Instantiate the PaymanAI tool (example)
tool = PaymanAI(
    name="send_payment",
    description="Send a payment to a specified payee.",
)