AgentLens Documentation
AgentLens is an open-source agent observability platform that traces decisions, not just API calls. These docs cover everything from initial setup to advanced self-hosting.
Getting Started
Quick Start
Install the SDK, initialize AgentLens, and send your first trace in under five minutes.
Core Concepts
Understand Traces, Spans, Decision Points, and Events — the four building blocks of AgentLens.
Authentication & Billing
Register for an account, manage API keys, and understand billing tiers and session limits.
SDKs
Integrations
OpenAI
Auto-trace all OpenAI API calls with a single wrapper. Captures model, tokens, cost, and latency.
Anthropic
Wrap the Anthropic client to automatically trace Claude API calls with full metadata capture.
LangChain
Use the AgentLensCallbackHandler to trace LangChain chains, agents, and tool invocations.
Tools & Deployment
OpenCode Plugin
Capture OpenCode sessions including tool calls, LLM calls, file edits, and git diffs automatically.
REST API Reference
Complete contract for POST /api/traces and GET /api/traces including payload shapes and error codes.
Self-Hosting
Deploy AgentLens with Docker or from source. Configure database, API keys, and environment variables.