Observability, prompt management, and evals for LLM engineering teams.
Respan's library for sending telemetries of LLM applications in OpenLLMetry format.
pip install respan respan-tracing respan-instrumentation-openainpm install @respan/respan @respan/tracing @respan/instrumentation-openai openai @traceloop/instrumentation-openai| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. Authenticates both proxy and tracing. Get it from the platform. |
RESPAN_BASE_URL |
No | Defaults to https://api.respan.ai/api. |
The Respan API key is used for both LLM inference (proxy) and telemetry export (tracing). Vendor-specific keys (OPENAI_API_KEY, etc.) are derived from the Respan key in code.
import os
from openai import OpenAI
from respan import Respan
from respan_instrumentation_openai import OpenAIInstrumentor
respan = Respan(instrumentations=[OpenAIInstrumentor()])
# Respan API key authenticates both proxy and tracing
respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api")
client = OpenAI(api_key=respan_api_key, base_url=respan_base_url)
response = client.chat.completions.create(
model="gpt-4.1-nano",
messages=[{"role": "user", "content": "Say hello in three languages."}],
)
print(response.choices[0].message.content)
respan.flush()import OpenAI from "openai";
import { Respan } from "@respan/respan";
import { OpenAIInstrumentor } from "@respan/instrumentation-openai";
// Respan API key authenticates both proxy and tracing
const respan = new Respan({
apiKey: process.env.RESPAN_API_KEY,
baseURL: process.env.RESPAN_BASE_URL,
instrumentations: [new OpenAIInstrumentor()],
});
await respan.initialize();
const client = new OpenAI({
apiKey: process.env.RESPAN_API_KEY,
baseURL: process.env.RESPAN_BASE_URL,
});
const response = await client.chat.completions.create({
model: "gpt-4.1-nano",
messages: [{ role: "user", content: "Say hello in three languages." }],
});
console.log(response.choices[0].message.content);
await respan.flush();See your traces in the Respan platform.
- Python OpenAI SDK examples — hello world, decorators, attributes, batch, streaming, tool calls
- Python OpenAI Agents SDK examples — hello world, handoffs, routing, guardrails
- TypeScript OpenAI SDK examples — hello world, decorators, attributes
The plugin system supports 50+ tools via OTEL instrumentation wrappers:
| Package | Python | TypeScript |
|---|---|---|
| OpenAI SDK | respan-instrumentation-openai |
@respan/instrumentation-openai |
| OpenAI Agents SDK | respan-instrumentation-openai-agents |
@respan/instrumentation-openai-agents |
| Anthropic SDK | respan-instrumentation-anthropic |
@respan/instrumentation-anthropic |
| OpenInference (Arize) | respan-instrumentation-openinference |
@respan/instrumentation-openinference |
| Any OTEL instrumentor | OTELInstrumentor(cls) |
new OTELInstrumentor(cls) |
Auto-discovery also supports: Azure OpenAI, Cohere, Bedrock, Vertex AI, LangChain, LlamaIndex, Pinecone, ChromaDB, Qdrant, Together AI, and more.
Structure traces with @workflow / @task (Python) or withWorkflow / withTask (TypeScript). See the decorators example for details.
Attach customer_identifier, thread_identifier, and metadata to all spans in scope. See the attributes example.
Please star us if you found this helpful!

