Hey everyone! 👋
I built a LangChain tool that lets agents pay for AI services autonomously using crypto (USDC on Base).
## Quick Setup
```python
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
from moltspay.integrations.langchain import MoltsPayTool
llm = ChatOpenAI(model="gpt-4")
tools = [MoltsPayTool()]
agent = initialize_agent(tools, llm, agent=AgentType.OPENAI_FUNCTIONS)
result = agent.run("Generate a video of a cat dancing")
What it does
- Agent discovers available services (video generation, transcription, etc.)
- Checks prices
- Pays with USDC (gasless - no ETH needed, uses x402 protocol)
- Returns results
Install
pip install moltspay[langchain]
Links
- Docs: Documentation - MoltsPay
- PyPI: Client Challenge
- Full writeup: Give Your AI Agent a Crypto Wallet in 3 Lines of Code - DEV Community
Also works with CrewAI out of the box since CrewAI uses LangChain tools.
Would love feedback! What services would you want your agents to be able to pay for?