@spanora-ai/sdk
v0.1.9
Published
OTEL-native observability SDK for AI executions
Readme
@spanora/sdk
TypeScript SDK for Spanora. Provides a simple interface for recording LLM calls, tool calls, retries, and execution outcomes as OpenTelemetry traces and spans.
Installation
pnpm add @spanora/sdkQuick Start
import { init, track, trackLlm } from "@spanora/sdk";
init({
apiKey: "ak_your_api_key",
});
const result = await track({ agent: "my-agent", operation: "chat" }, () =>
trackLlm({ model: "gpt-4o", prompt: "Hello" }, async () => {
return await llm.chat("Hello");
}),
);Documentation
Full API reference and integration guides are available at:
- SDK Reference — Initialization, options tables, and detailed usage for every function
- OTEL Attributes — Semantic attribute conventions (
gen_ai.*andspanora.*) - OpenAI Integration —
trackOpenAI(),trackOpenAIStream() - Anthropic Integration —
trackAnthropic(),trackAnthropicStream() - Vercel AI SDK Integration — Automatic instrumentation via
experimental_telemetry - LangChain (Python) — Auto-instrumentation via OpenLLMetry
