Package
GitHub Repository
View source code and contribute
Supported Providers
| Provider | SDK Package | Status |
|---|---|---|
| OpenAI | openai | Full support (Chat, Responses API, streaming) |
| Anthropic | @anthropic-ai/sdk | Full support (Messages API, streaming, tools) |
| Google Gemini | @google/generative-ai | Full support (generateContent, chat) |
| Google GenAI | @google/genai | Full support (for Google ADK) |
Framework Compatibility
| Framework | Integration |
|---|---|
| Vercel AI SDK | Via fetch instrumentation |
| LangChain | Instruments underlying providers |
| LlamaIndex | Works with instrumented providers |
| Mastra | Full agent stack tracking |
Metrics Captured
| Metric | Description |
|---|---|
input_tokens | Prompt/input tokens used |
output_tokens | Completion/output tokens generated |
cached_tokens | Tokens served from prompt cache |
reasoning_tokens | Reasoning tokens (o1/o3 models) |
latency_ms | Request duration in milliseconds |
model | Model name (e.g., gpt-4o, claude-3-5-sonnet) |
provider | Provider name (openai, anthropic, gemini) |
tool_calls | Function/tool calls made |
trace_id | OpenTelemetry-compatible trace ID |
agent_stack | Named agent context for multi-agent systems |
SDK Documentation
Installation
Install the SDK and peer dependencies
Instrumentation
Global and per-instance instrumentation
Frameworks
Framework-specific integrations
Emitters
Metric destinations (console, HTTP, file)
Agent Tracking
Track multi-agent workflows
Support
Provider and framework compatibility
Troubleshooting
Common issues and solutions