Anthropic SDK
The Anthropic SDK is the official client for Anthropic’s Claude models, supporting messages, streaming, and tool use. Respan gives you full observability over every Claude call, streamed response, and tool invocation — and gateway routing through the Anthropic-compatible Respan endpoint.
Set up Respan
Create an account at platform.respan.ai and grab an API key. For gateway, also add credits or a provider key.
Run npx @respan/cli setup to set up with your coding agent.
Example projects
Tracing
Gateway
Setup
Set environment variables
ANTHROPIC_API_KEY is used for Claude requests. RESPAN_API_KEY is used to export traces to Respan.
View your trace
Open the Traces page to see your auto-instrumented LLM spans with messages, tokens, and tool calls.
Configuration
Attributes
In Respan()
Set defaults at initialization — these apply to all spans.
With propagate_attributes
Override per-request using a context scope.
Decorators (optional)
Decorators are not required. All Anthropic calls are auto-traced by the instrumentor. Use @workflow and @task to add structure when you want to group related calls into a named workflow with nested tasks.
Examples
Streaming
Stream Claude responses with real-time text deltas.
Tool calls
Tool calls are automatically captured as spans with inputs, outputs, and timing.