AgentKit OpenAI Agents SDK Extension
May 28, 2025 ยท View on GitHub
OpenAI Agents SDK extension of AgentKit. Enables agentic workflows to interact with onchain actions.
Setup
Prerequisites
Installation
pip install coinbase-agentkit coinbase-agentkit-openai-agents-sdk
Environment Setup
Set the following environment variables:
export OPENAI_API_KEY=<your-openai-api-key>
export CDP_API_KEY_ID=<your-cdp-api-key-id>
export CDP_API_KEY_PRIVATE=<your-cdp-api-key-private>
Usage
Basic Setup
from coinbase_agentkit import AgentKit
from coinbase_agentkit_openai_agents_sdk import get_openai_agents_sdk_tools
from agents import Agent
agentKit = AgentKit()
tools = get_openai_agents_sdk_tools(agentKit)
agent = Agent(
name="CDP Agent",
instructions="You are a helpful agent that can interact with the blockchain using AgentKit tools.",
tools=tools
)
For AgentKit configuration options, see the Coinbase Agentkit README.
For a full example, see the chatbot example.
Contributing
See CONTRIBUTING.md for detailed setup instructions and contribution guidelines.