Docs
Anthropic

Anthropic

Ingest Claude traces into AITracer via the SDK or API.

Agent Lab: Run local Ollama agents in the dashboard — no SDK required (Quick Start). This guide is for ingesting traces from this provider via the SDK or API.

Anthropic logo

Use the SDK or API to store Anthropic (Claude) runs in AITracer — same Traces store as Agent Lab and coach.

Each ingested record typically includes:

  • prompt and response text
  • model id (e.g. claude-3-5-sonnet-latest)
  • input_tokens / output_tokens and latency
  • optional tool-use metadata

Anthropic integration workflow

Rendering diagram...

Messages API

After anthropic.messages.create, record:

await trace.record({
  actionName: "support-bot",
  model: "claude-3-5-sonnet-latest",
  prompt: userText,
  response: assistantText,
  metrics: {
    promptTokens: msg.usage.input_tokens,
    completionTokens: msg.usage.output_tokens,
    latencyMs,
  },
  provider: { provider: "anthropic" },
})

Tool use

When Claude returns tool_use blocks, attach a summary in parameters.tools or metadata so you can debug failed tool chains in Traces.


Coach and training

Claude production traces can feed Training export when curated. For quality iteration, reproduce a failing case in Agent Lab, run Coach, and keep the version you prefer.


Optional advanced

Enabled only when your team configures compliance on ingest.


Anthropic – AITracer — AITracer