Skip to main content
Catalyst instruments Anthropic Messages API calls in TypeScript and Python. The span includes content blocks, tool-use blocks, model name, invocation parameters, finish reason, usage, and prompt-cache token details when Anthropic returns them.

Install

Basic Messages Call

Anthropic Inside An Agent

Tool Use Round Trip

Anthropic tool use is a two-turn pattern: the assistant returns a tool_use block, then your app returns a matching tool_result block. Catalyst records both sides of that relationship on the auto-emitted LLM span — what the model asked for and the result you passed back.
The capture below is the model-side view: it shows the request/response the LLM saw. To also capture the caller-side view (the actual function that ran, its input, output, and duration), wrap the tool function in a TOOL span using Manual spans. For a full agent loop, see the Production Agent Example.
TypeScript

Prompt Caching

When Anthropic returns cache creation and cache read token counts, Catalyst maps them into OpenInference token detail attributes.
TypeScript