Integrations
Anthropic Integration
Automatically track Claude completions in your agent sessions with a single line of setup.
π€ Anthropic Integration
Lucidic supports automatic tracking of Anthropic Claude completions in your agent sessions β with no extra instrumentation needed.
βοΈ How It Works
When you initialize the SDK with:
Lucidic will:
- Monkey patch
anthropic.Client().messages.create
- Automatically capture each Claude completion as an Event
- Attach the LLM call to the current active Step
β What Gets Captured
We automatically capture the following when you pass it to anthropic.Client().messages.create
:
- Input: your prompt to Claude (e.g.
"What's the capital of France?"
) - Model: the Claude model used (e.g.
claude-3-opus
,claude-3
) - Output: the Claude response
Based on your input, we automatically calculate the following:
- Cost: estimated based on input/output tokens
π§ Why This Matters
LLM calls are a core part of most agent workflows β but without visibility, itβs impossible to debug or optimize:
- Which call caused the failure?
- Which step was it part of?
- How much did it cost?
- What was the actual response?
This integration gives you full transparency, with zero boilerplate.
π§ͺ Example
π οΈ Notes
- Requires
anthropic
Python SDK installed (pip install anthropic
) - Only
Client().messages.create
is currently patched - You must have an active session and step for automatic event logging
- You can still manually use
create_event()
orupdate_event()
as needed