Wrap yourDocumentation Index
Fetch the complete documentation index at: https://docs.lumiqtrace.com/llms.txt
Use this file to discover all available pages before exploring further.
Anthropic client instance with wrapAnthropic(). Every messages.create call is traced automatically, including tool use and streaming responses.
Installation
Setup
Example
What gets captured
| Field | Details |
|---|---|
| Model | claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5, etc. |
| Input tokens | From usage.input_tokens |
| Output tokens | From usage.output_tokens |
| Cost | Calculated from token counts and Anthropic pricing |
| Latency | Total time from request to first token (streaming) or full response |
| Stop reason | end_turn, max_tokens, tool_use, stop_sequence |
Tool use
Tool calls and tool results are captured as child spans under the message span.Streaming
Streaming responses are traced end-to-end. Token counts accumulate frommessage_delta events.
Enable
storePrompts: true in lumiqtrace.init() to persist prompt and completion text. Off by default.Next steps
- Agent tracing — trace multi-turn Claude conversations as agents
- Guardrails — enforce safety policies on Claude outputs