Let AI agents spend safely

Open-source Python SDK that lets AI agents spend real money. Policy guardrails, pluggable payment gateways, full audit trail.

pip install paygraph
View on GitHub →
LangGraphStripe Issuingx402
quickstart.py
from paygraph import PayGraph
pg = PayGraph()
spend_tool = pg.get_spend_tool()
# Pass spend_tool to your LangGraph agent
production.py
from paygraph import PayGraph
from paygraph.gateways import StripeCardGateway
pg = PayGraph(
gateway=StripeCardGateway(
api_key="sk_live_..."
),
max_amount=100.00,
currency="usd"
)
spend_tool = pg.get_spend_tool()

Policy engine

Set spending limits, approved merchants, and budget caps. Every transaction gets checked before it goes through.

Payment gateways

Pluggable gateway interface. Ships with Stripe Issuing, bring your own gateway tomorrow. x402 and MPP on the roadmap.

Audit trail

Every spend attempt is logged: which agent, what policy was checked, approved or denied, and why.

How it works

Agentspend_tool()PoliciesGatewayAudit Log

Agent calls spend_tool

Your agent hits the spend tool with an amount, merchant, and reason. Just a normal tool call.

Policies get checked

PayGraph runs the request through your policies. Spending limits, approved categories, remaining budget.

Payment goes through

If it passes, the gateway processes it. Everything gets logged either way.

Why PayGraph

AI agents can book flights, order supplies, pay invoices. But giving an LLM a credit card with no guardrails is a terrible idea. PayGraph sits between your agent and the payment gateway so you can define exactly what it's allowed to spend. Open source, built for LangGraph first, designed for every payment rail your agents will need.

Open source

PayGraph is MIT-licensed and built in the open. Contributions, issues, and feedback are welcome.

Star on GitHub →

PayGraph Cloud

Managed version coming soon. Hosted policy engine, dashboard, team controls. Join the waitlist for early access.