AgentKit integrates with several popular AI frameworks, enabling you to build blockchain-capable agents using your preferred development tools.

Visit our Quickstart Guide to bootstrap your project.

The following frameworks are currently supported:

Agents SDK by OpenAI

The OpenAI Agents SDK is a lightweight, Python-first framework that enables you to build production-ready AI agents with minimal abstractions. It’s designed to be easy to learn while providing powerful capabilities for real-world applications.

You can find our implementation in our Replit template or the AgentKit repository.

Step 1: Set Up Your Development Environment

  1. Fork the Python template
  2. Once forked, you’ll have your own version of the project to modify

Step 2: Configure Environment Variables

  1. Click on “Tools” in the left sidebar
  2. Select “Secrets”
  3. Add the following secrets:
CDP_API_KEY_NAME=your_cdp_key_name # From cdp.coinbase.com
CDP_API_KEY_PRIVATE_KEY=your_cdp_private_key
OPENAI_API_KEY=your_openai_key # from platform.openai.com
NETWORK_ID="base-sepolia" # Optional, defaults to base-sepolia.

Step 3: Run the Agent

You can start this chatbot by clicking the “Run” button.

Security of wallets on Replit template

Every agent comes with an associated wallet. Wallet data is read from wallet_data.txt, and if that file does not exist, this repl will create a new wallet and persist it in a new file. Please note that this contains your wallet’s private key and should not be used in production environments. Refer to the CDP docs on how to secure your wallets.

LangChain

LangChain is a framework for developing applications powered by language models. Our implementation is available in our Replit templates and the AgentKit repository.

Step 1: Set Up Your Development Environment

  1. Fork the template from NodeJS (EVM), Python (EVM), or NodeJS (Solana) Replit templates
  2. Once forked, you’ll have your own version of the project to modify

Step 2: Configure Environment Variables

  1. Click on “Tools” in the left sidebar
  2. Select “Secrets”
  3. Add the following secrets:
CDP_API_KEY_NAME=your_cdp_key_name
CDP_API_KEY_PRIVATE_KEY=your_cdp_private_key
OPENAI_API_KEY=your_openai_key
NETWORK_ID="base-sepolia" # Optional, defaults to base-sepolia.
MNEMONIC_PHRASE=your_mnemonic_phrase # Optional, if it is not provided the agent will create a new wallet

Step 3: Run the Agent

You can start this chatbot by clicking the “Run” button.

Security of wallets on Replit template

Every agent comes with an associated wallet. Wallet data is read from wallet_data.txt, and if that file does not exist, this repl will create a new wallet and persist it in a new file. Please note that this contains your wallet’s private key and should not be used in production environments. Refer to the CDP docs on how to secure your wallets.

Common Issues

  • If you’re trying to switch networks and your agent will not change, try renaming the wallet_data.txt file. Each network requires a new wallet, and if the program identifies a previously-created wallet it will not create the new one on the new network.

Adding Agent Functionality

Extend your agent with chat capabilities. To add more functionality, see the agent actions guide.

Testing Your Agent

Try these example interactions:

You: What is your wallet address?
You: transfer .001 ETH to 0x4c8bbcfc6DaE447228FcbB220C1DD4cae623EaaF
You: Register a basename for yourself that represents your identity

Eliza Framework

Eliza is a framework for building AI agents with a focus on simplicity and extensibility. For a detailed walkthrough, see our video tutorial.

Compatibility Note

When creating your CDP API key in the portal, make sure to select ECDSA as the signature algorithm. The Eliza framework integration requires CDP API keys configured with the ECDSA signature algorithm. Ed25519 signatures are not currently supported.

npx create-agentkit-app my-agent
cd my-agent
cp .env.example .env
# edit .env file with your own values
pnpm install
pnpm start

Vercel AI SDK

Vercel AI SDK is a library for building AI-powered applications with React and JavaScript/TypeScript. Our implementation demonstrates creating a terminal-style chatbot with access to CDP AgentKit actions.

Prerequisites

Checking Node Version

Before using the example, ensure that you have Node.js 18 or higher installed. You can check your Node version by running:

node --version

If you don’t have the correct version, you can install it using nvm:

nvm install node

API Keys

You’ll need the following API keys:

Once you have them, rename the .env-local file to .env and set the API keys to their corresponding environment variables:

  • CDP_API_KEY_NAME
  • CDP_API_KEY_PRIVATE_KEY
  • OPENAI_API_KEY

Setting Up the Example

Clone the repository and navigate to the example directory:

# Clone the repository
git clone https://github.com/coinbase/agentkit.git
cd agentkit

# Install dependencies and build packages
npm install
npm run build

# Navigate to the example directory
cd typescript/examples/vercel-ai-sdk-cdp-chatbot

# Start the chatbot
npm start

Testing Your Agent

Try these example interactions:

You: What is your wallet address?
You: Transfer a portion of your ETH to a random address
You: What is the price of BTC?
You: Deploy an NFT that will go super viral!
You: Deploy an ERC-20 token with total supply 1 billion

For more detailed documentation on using Vercel AI SDK with AgentKit, see the Vercel AI SDK integration guide.

Model Context Protocol (MCP)

The Anthropic Model Context Protocol (MCP) is a standardized protocol designed to facilitate structured interactions between AI models and external tools or APIs. This example demonstrates how to set up an MCP server integrated with AgentKit, allowing Claude Desktop to access the full set of CDP AgentKit actions.

Prerequisites

Checking Node Version

Before using the example, ensure that you have Node.js 18 or higher installed. You can check your Node version by running:

node --version

If you don’t have the correct version, you can install it using nvm:

nvm install node

API Keys

You’ll need the following API key:

You’ll need to configure the Claude Desktop config file with your CDP API keys. Copy the contents from claude_desktop_config.json to your Claude Desktop config file and update the following:

  1. Update the args path to match the location of your built index.js file.
  2. Set your CDP API keys in the env section:
    • CDP_API_KEY_NAME
    • CDP_API_KEY_PRIVATE_KEY

Then, navigate to the claude_desktop_config.json file found in your Claude Desktop app’s settings and update its contents to match the contents of our provided claude_desktop_config.json file.

Setting Up the Example

Clone the repository and navigate to the example directory:

# Clone the repository
git clone https://github.com/coinbase/agentkit.git
cd agentkit

# Install dependencies and build packages
npm install
npm run build

# Navigate to the MCP example directory
cd typescript/examples/model-context-protocol-cdp-server

Configure your Claude Desktop by updating the claude_desktop_config.json file with your CDP API keys and the correct path to your built index.js file.

To use the chatbot, simply open Claude Desktop after configuring your API keys. The MCP server will run automatically when you interact with Claude.

Testing Your Agent

Try these example interactions in Claude Desktop:

Transfer a portion of your ETH to a random address
What is the price of BTC?
Deploy an NFT that will go super viral!
Deploy an ERC-20 token with total supply 1 billion

For more detailed documentation on using MCP with AgentKit, see the Model Context Protocol extension information.