Integrate LetAgentPay with your AI agents in minutes.
agt_...)All Agent API endpoints use Bearer token authentication:
Authorization: Bearer agt_your_token_herepip install letagentpayfrom letagentpay import LetAgentPay
client = LetAgentPay(token="agt_your_token")
# Submit a purchase request
result = client.purchase(
amount=49.99,
category="groceries",
merchant_name="Whole Foods",
description="Weekly groceries",
)
if result.status == "auto_approved":
client.confirm(result.request_id, success=True, actual_amount=47.50)
elif result.status == "pending":
final = client.wait_for_decision(result.request_id, timeout=300)
if final.status == "approved":
client.confirm(result.request_id, success=True)
elif result.status == "rejected":
print(f"Rejected: {result.policy_check}")from letagentpay import LetAgentPay, guard
client = LetAgentPay(token="agt_your_token")
@guard(client, category="groceries")
def buy_groceries(items: list[str]) -> dict:
total = calculate_total(items)
return {"items": items, "total": total}LetAgentPay works with popular AI agent frameworks. Each integration wraps the Python SDK as a native tool for the framework.
Custom BaseTool for any LangChain agent.
from letagentpay_langchain import LetAgentPayTool
tool = LetAgentPayTool()
agent = create_tool_calling_agent(llm, [tool], prompt)Full exampleFunction tool with @function_tool.
@function_tool
def request_purchase(amount, category, ...):
return client.request_purchase(...)Full exampleCrewAI tool with @tool decorator.
@tool("Request Purchase")
def request_purchase(amount, category, ...):
return client.request_purchase(...)Full exampleZero-code integration via MCP server.
"letagentpay": {
"command": "npx",
"args": ["letagentpay-mcp"],
"env": {"LETAGENTPAY_TOKEN": "agt_..."}
}Full guideBase URL: https://letagentpay.com/api/v1/agent-api