Radicas Docs
Framework integrationsProviders

Anthropic SDK

Observe raw Anthropic API calls in Radicas via the OpenInference instrumentor — single LLM spans, no agent tree.

Status: experimental — implemented, not fixture-verified; no registry card yet. This is a telemetry source, not an agent framework: each messages.create call becomes one LLM span (no agent/tool tree) — enough for cost estimation and reconciliation.

Install

pip install "radicas[anthropic]"   # = radicas + openinference-instrumentation-anthropic

Use

import radicas

radicas.init(service="my-service", feature="summarize")
# instrument="auto" detects anthropic and activates
# AnthropicInstrumentor().instrument() — or: radicas.init(instrument=["anthropic-sdk"])
# (alias: "anthropic")

import anthropic
client = anthropic.Anthropic()
message = client.messages.create(model="claude-sonnet-4-5", max_tokens=512, messages=[...])
radicas.shutdown()

What it emits

  • Scope name: openinference.instrumentation.anthropicexpected, pending fixture.
  • Namespace: llm.* / openinference.* — shim required.
  • Coverage: expected, pending fixture. Cache tokens matter here: the Anthropic API reports exclusive counters (input_tokens excluding cache reads/writes), which must be normalized to the canonical subset semantics (cache_read within input_tokens, cache_creation additive) — see the telemetry reference. That normalization is specified for the adapter layer and will be encoded in this source's registry card when the fixture lands.

Shim behavior

  • Client-side adapter: intended, pending card — until then spans pass through unmapped.
  • Server-side OTTL: pending the same card.

Known limitations

  • Not fixture-verified end-to-end.
  • Single-span source: no invoke_agent root, so the default feature (stamped only on invoke_agent* roots) will not appear on these spans. A scoped with radicas.feature(...) block DOES stamp every span inside it — use it to tag raw calls.
  • The Traceloop route (opentelemetry-instrumentation-anthropic, gen_ai.* + llm.*, lighter shim — but content on span attributes instead of the events channel) is the documented alternative; the deep-dive will pick the official route.

Verify it works

SELECT model, input_tokens, output_tokens, estimated_cost_usd
  FROM otel.llm_call ORDER BY ts DESC LIMIT 5;

Bench recipe: providers/anthropic-sdk/python in radicas-integrations.

On this page