# Coinbase AgentKit PydanticAI Extension
This package provides integration between Coinbase AgentKit and PydanticAI, allowing you to use AgentKit actions as tools in PydanticAI agents.
## Setup
### Prerequisites
- [CDP API Key](https://portal.cdp.coinbase.com/access/api)
- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)
### Installation
```bash
pip install coinbase-agentkit coinbase-agentkit-pydantic-ai
```
### Environment Setup
Set the following environment variables:
```bash
export OPENAI_API_KEY=<your-openai-api-key>
export CDP_API_KEY_ID=<your-cdp-api-key-id>
export CDP_API_KEY_SECRET=<your-cdp-api-key-secret>
export CDP_WALLET_SECRET=<your-cdp-wallet-secret>
export NETWORK_ID=<your-network-id>
```
## Usage
### Basic Setup
```python
from coinbase_agentkit import AgentKit
from coinbase_agentkit_pydantic_ai import get_pydantic_ai_tools
from pydantic_ai import Agent
# Initialize AgentKit
agent_kit = AgentKit()
# Get PydanticAI compatible tools
tools = get_pydantic_ai_tools(agent_kit)
# Create PydanticAI agent with the tools
agent = Agent(
'openai:gpt-4o',
tools=tools,
system_prompt='You are a helpful crypto trading assistant.'
)
# Use the agent
result = agent.run_sync('What is my wallet balance?')
print(result.output)
```
For AgentKit configuration options, see the [Coinbase Agentkit README](https://github.com/coinbase/agentkit/blob/master/python/coinbase-agentkit/README.md).
For a full example, see the [chatbot example](https://github.com/coinbase/agentkit/blob/master/python/examples/pydantic-ai-cdp-chatbot/chatbot.py).
For PydanticAI configuration options, see the [PydanticAI Documentation](https://ai.pydantic.dev/).
## Contributing
See [CONTRIBUTING.md](https://github.com/coinbase/agentkit/blob/master/CONTRIBUTING.md) for detailed setup instructions and contribution guidelines.
Raw data
{
"_id": null,
"home_page": null,
"name": "coinbase-agentkit-pydantic-ai",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.10",
"maintainer_email": null,
"keywords": "agent, ai, cdp, coinbase, crypto, pydantic-ai, sdk",
"author": null,
"author_email": "Logan Kang <kcs93023@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d9/2a/7bca73afb8343c58aa500b1f0f8a1db32dfcaea2963d67245c460f693015/coinbase_agentkit_pydantic_ai-0.1.0.tar.gz",
"platform": null,
"description": "# Coinbase AgentKit PydanticAI Extension\n\nThis package provides integration between Coinbase AgentKit and PydanticAI, allowing you to use AgentKit actions as tools in PydanticAI agents.\n\n## Setup\n\n### Prerequisites\n\n- [CDP API Key](https://portal.cdp.coinbase.com/access/api)\n- [OpenAI API Key](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)\n\n### Installation\n\n```bash\npip install coinbase-agentkit coinbase-agentkit-pydantic-ai\n```\n\n### Environment Setup\n\nSet the following environment variables:\n\n```bash\nexport OPENAI_API_KEY=<your-openai-api-key>\nexport CDP_API_KEY_ID=<your-cdp-api-key-id>\nexport CDP_API_KEY_SECRET=<your-cdp-api-key-secret>\nexport CDP_WALLET_SECRET=<your-cdp-wallet-secret>\nexport NETWORK_ID=<your-network-id>\n```\n\n## Usage\n\n### Basic Setup\n\n```python\nfrom coinbase_agentkit import AgentKit\nfrom coinbase_agentkit_pydantic_ai import get_pydantic_ai_tools\nfrom pydantic_ai import Agent\n\n# Initialize AgentKit\nagent_kit = AgentKit()\n\n# Get PydanticAI compatible tools\ntools = get_pydantic_ai_tools(agent_kit)\n\n# Create PydanticAI agent with the tools\nagent = Agent(\n 'openai:gpt-4o',\n tools=tools,\n system_prompt='You are a helpful crypto trading assistant.'\n)\n\n# Use the agent\nresult = agent.run_sync('What is my wallet balance?')\nprint(result.output)\n```\n\nFor AgentKit configuration options, see the [Coinbase Agentkit README](https://github.com/coinbase/agentkit/blob/master/python/coinbase-agentkit/README.md).\n\nFor a full example, see the [chatbot example](https://github.com/coinbase/agentkit/blob/master/python/examples/pydantic-ai-cdp-chatbot/chatbot.py).\n\nFor PydanticAI configuration options, see the [PydanticAI Documentation](https://ai.pydantic.dev/).\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/coinbase/agentkit/blob/master/CONTRIBUTING.md) for detailed setup instructions and contribution guidelines.\n",
"bugtrack_url": null,
"license": null,
"summary": "Coinbase AgentKit PydanticAI extension",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [
"agent",
" ai",
" cdp",
" coinbase",
" crypto",
" pydantic-ai",
" sdk"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0b782b5aa4e76f386333983df052ef9009e2ad8934c3e1eaa9d195dd6b68d9a1",
"md5": "6802de954b71379df3e72e6f0d1a17c5",
"sha256": "d2e056687d7438a954a505b3f993a836ce8c3ffde9da6931024cd8339ab8b382"
},
"downloads": -1,
"filename": "coinbase_agentkit_pydantic_ai-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6802de954b71379df3e72e6f0d1a17c5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.10",
"size": 4227,
"upload_time": "2025-09-06T01:45:22",
"upload_time_iso_8601": "2025-09-06T01:45:22.515565Z",
"url": "https://files.pythonhosted.org/packages/0b/78/2b5aa4e76f386333983df052ef9009e2ad8934c3e1eaa9d195dd6b68d9a1/coinbase_agentkit_pydantic_ai-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d92a7bca73afb8343c58aa500b1f0f8a1db32dfcaea2963d67245c460f693015",
"md5": "4bf28681236c8ff374fbefaddda22215",
"sha256": "fbaa271253a83ca4c02e95aeafe89d14df16ec57ea3e266060105e067008a06d"
},
"downloads": -1,
"filename": "coinbase_agentkit_pydantic_ai-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "4bf28681236c8ff374fbefaddda22215",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.10",
"size": 4563,
"upload_time": "2025-09-06T01:45:24",
"upload_time_iso_8601": "2025-09-06T01:45:24.318031Z",
"url": "https://files.pythonhosted.org/packages/d9/2a/7bca73afb8343c58aa500b1f0f8a1db32dfcaea2963d67245c460f693015/coinbase_agentkit_pydantic_ai-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-06 01:45:24",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "coinbase-agentkit-pydantic-ai"
}