Skip to content

Anthropic

Trace Anthropic Claude API calls — conversations, tool use, and agent responses — by wrapping your client calls with AxonPushAnthropicTracer.

Terminal window
npm install @axonpush/sdk @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";
import { AxonPush } from "@axonpush/sdk";
import { AxonPushAnthropicTracer } from "@axonpush/sdk/integrations/anthropic";
const client = new AxonPush({
apiKey: process.env.AXONPUSH_API_KEY!,
tenantId: process.env.AXONPUSH_TENANT_ID!,
});
const tracer = new AxonPushAnthropicTracer({
client,
channelId: 1,
agentId: "my-agent",
});
const anthropic = new Anthropic();
const response = await tracer.createMessage(anthropic, {
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: "Explain quantum computing." }],
});
EventWhen
conversation.turnA new message is sent to the API
tool.*.startA tool use block is requested by the model
tool.resultA tool result is returned
agent.responseThe model returns a complete response
agent.messageAn individual content block is received