Skip to main content
This cookbook shows how to integrate Anthropic’s Claude models with Maxim for full observability and tracing. You’ll learn how to log both standard and streaming completions, making it easy to monitor and debug your LLM-powered applications.

Prerequisites

1. Set Up Environment Variables

2. Initialize Maxim SDK

Maxim will automatically pick up MAXIM_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.

Resources

Cookbook Code

Python Notebook for Anthropic & Maxim