Skip to main content

respan-instrumentation-anthropic

Respan instrumentation plugin for the Anthropic Python SDK.

This package patches Anthropic client calls and emits spans using the Respan/Traceloop GenAI attribute shape used across this repository.

Install

pip install respan-instrumentation-anthropic

Quickstart

import os

from anthropic import Anthropic
from respan import Respan
from respan_instrumentation_anthropic import AnthropicInstrumentor

respan = Respan(
    api_key=os.environ["RESPAN_API_KEY"],
    instrumentations=[AnthropicInstrumentor()],
)

client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])

message = client.messages.create(
    model="claude-3-5-haiku-latest",
    max_tokens=128,
    messages=[{"role": "user", "content": "Write one line about tracing."}],
)

print(message.content)
respan.flush()

Notes

  • The instrumentor patches both Anthropic and AsyncAnthropic.
  • messages.create() and streaming responses are traced.
  • Managed agent session streaming is also captured when available through the Anthropic SDK.

Metadata

Release files for respan-instrumentation-anthropic 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-instrumentation-anthropic 1.1.0
File Size Uploaded
respan_instrumentation_anthropic-1.1.0.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-anthropic 1.1.0
File Interpreter ABI Platform
respan_instrumentation_anthropic-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / respan_instrumentation_anthropic-1.1.0.tar.gz

Download URL respan_instrumentation_anthropic-1.1.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
32dc512c6e5a10f799015bbe62b50904eeb0257f416d71d4c754c7bbf2ac1dd3
BLAKE2b-256 checksum
How to use checksums
d1a9279d6cc400f2d3014d24ff8b659f738648a2afde65f04e424692414a9166
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / respan_instrumentation_anthropic-1.1.0-py3-none-any.whl

Download URL respan_instrumentation_anthropic-1.1.0-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad89b70ef0b6b4f215e33335f33e08f24184c9a1d88ae8767d4bbbd08f1f3a53
BLAKE2b-256 checksum
How to use checksums
483aa056ae4a708c50d8c2b64eab66fbfb5bebba8006bb1b7fff98253846f76f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.0

2 release files

This release

1.1.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page