A chat app where you talk to an AI agent that can act on the blockchain. You type a request in plain English, and the agent can check balances, move tokens, read prices, and more on Base Sepolia (a free test network).
It is built on Coinbase's AgentKit starter template, so it is a good base for your own on-chain agent.
- Use its own CDP smart wallet (created for you)
- Send and read ERC-20 tokens, wrap ETH into WETH
- Read live prices from the Pyth oracle
- Call Coinbase Developer Platform (CDP) APIs, including the testnet faucet
- Pay for APIs with x402
Next.js, TypeScript, Tailwind CSS, LangChain + LangGraph, OpenAI (gpt-4o-mini), Coinbase AgentKit, viem, wagmi
You need Node.js 18+, an OpenAI API key, and a CDP API key.
-
Install dependencies:
npm install
-
Create a
.envfile in the project root:OPENAI_API_KEY=your_openai_key CDP_API_KEY_ID=your_cdp_key_id CDP_API_KEY_SECRET=your_cdp_key_secret CDP_WALLET_SECRET=your_cdp_wallet_secret NETWORK_ID=base-sepolia
RPC_URLandPAYMASTER_URLare optional. -
Start the app and open http://localhost:3000:
npm run dev
| What | File |
|---|---|
| Wallet and actions the agent can use | app/api/agent/prepare-agentkit.ts |
| AI model and system prompt | app/api/agent/create-agent.ts |
| Chat API endpoint | app/api/agent/route.ts |
| Chat page | app/page.tsx |
Released under the MIT License.