Exporter for Anthropic Agent SDK telemetry to Respan
Project description
Respan Exporter for Anthropic Agent SDK
Exporter for Anthropic Agent SDK telemetry to Respan.
Respan is a proxy and tracing platform. Your Respan API key authenticates both LLM inference (proxy) and telemetry export (tracing).
Configuration
1. Install
pip install claude-agent-sdk respan-exporter-anthropic-agents
2. Set Environment Variables
| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. Authenticates both proxy and tracing. |
RESPAN_BASE_URL |
No | Defaults to https://api.respan.ai. |
export RESPAN_API_KEY=your_respan_key
# export RESPAN_BASE_URL=https://api.respan.ai # default, only override if self-hosting
That's it. Everything else is derived:
- Proxy:
ANTHROPIC_BASE_URL=RESPAN_BASE_URL+/api/anthropic - Auth:
ANTHROPIC_API_KEY=RESPAN_API_KEY - Tracing: The exporter reads
RESPAN_API_KEYandRESPAN_BASE_URLautomatically.
Quickstart
3. Run Script
Save this as quickstart.py:
import asyncio
import os
from claude_agent_sdk import ClaudeAgentOptions
from respan_exporter_anthropic_agents import RespanAnthropicAgentsExporter
respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai")
exporter = RespanAnthropicAgentsExporter()
async def main() -> None:
options = exporter.with_options(
options=ClaudeAgentOptions(
allowed_tools=["Read", "Glob", "Grep"],
permission_mode="acceptEdits",
env={
"ANTHROPIC_API_KEY": respan_api_key,
"ANTHROPIC_BASE_URL": f"{respan_base_url}/api/anthropic",
},
)
)
async for message in exporter.query(
prompt="Analyze this repository and summarize architecture.",
options=options,
):
print(message)
asyncio.run(main())
Run it:
python quickstart.py
4. View Dashboard
Open:
https://platform.respan.ai/platform/traces
Further Reading
Runnable examples with full setup instructions:
- Python examples root: python/tracing/anthropic-agents-sdk
- Python basic scripts:
- TypeScript examples root: typescript/tracing/anthropic-agents-sdk
Dev Guide
Running Tests
# Unit tests
python -m unittest tests.test_exporter -v
# Live integration test (opt-in, makes real API calls)
export RESPAN_API_KEY="your_respan_key"
export IS_REAL_GATEWAY_TESTING_ENABLED=1
python -m unittest tests.test_real_gateway_integration -v
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_exporter_anthropic_agents-1.0.16.tar.gz.
File metadata
- Download URL: respan_exporter_anthropic_agents-1.0.16.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.8 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b48070a2350c361019c02eb0b07296f40b2e5ff10740e987e8bcb2e503fd074
|
|
| MD5 |
299a4086bbda36b5f8fd514c8a9332e8
|
|
| BLAKE2b-256 |
e5b4e76679be5b5a6748ea7173b26fe1628e4b3c8023a737b3b4ad79f092870b
|
File details
Details for the file respan_exporter_anthropic_agents-1.0.16-py3-none-any.whl.
File metadata
- Download URL: respan_exporter_anthropic_agents-1.0.16-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.8 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfd65d9967fccbdd633f57e3787e552ffd1157ec9404ad8ae61cd67a8587ebfc
|
|
| MD5 |
9a4877d79ebdfdd00683b1f7a90b126d
|
|
| BLAKE2b-256 |
aa5b3aeecd7a5ee048904d292ac9146b58b98c6e23c835b013faa422aaf887d9
|