Prerequisites
- Python 3.8+
- Anthropic Python SDK (
pip install anthropic
) - Maxim Python SDK (
pip install maxim-py
) - python-dotenv (
pip install python-dotenv
) - API keys for Anthropic and Maxim
- (Optional) Set up a
.env
file with your API keys
1. Set Up Environment Variables
2. Initialize Maxim SDK
Maxim will automatically pick upMAXIM_API_KEY
and MAXIM_LOG_REPO_ID
from your environment variables.
3. Wrap Anthropic Client with Maxim
4. Basic Usage: Log a Claude Completion
5. Streaming Usage: Log a Claude Streaming Completion
6. Visualize in Maxim
All requests, responses, and streaming events are automatically traced and can be viewed in your Maxim dashboard.
For more details, see the Anthropic Python SDK documentation and the Maxim Python SDK documentation.