Getting Started
Go from zero to full agent observability in under five minutes. This guide walks you through installing the SDK, initializing it, and sending your first trace.
Prerequisites
- Python 3.9+ or Node.js 18+
- An AgentLens instance (use agentlens.vectry.tech or self-host)
- An AgentLens account — sign up here if you haven't already
- An API key (create one in Dashboard → API Keys)
Step 0: Create your account
Before you can send traces, you need an AgentLens account. Register with your email and password at agentlens.vectry.tech/register. Once registered, log in to the dashboard and navigate to Settings → API Keys to generate your first API key.
Self-hosting? If you are running your own AgentLens instance, you do not need to register with the hosted service. See the Self-Hosting guide instead.
Step 1: Install the SDK
Python
pip install vectry-agentlensTypeScript / Node.js
npm install agentlens-sdkStep 2: Initialize AgentLens
Sign up at agentlens.vectry.tech, then go to Dashboard → API Keys to create your key. Pass it to the SDK during initialization:
Python
import agentlens
agentlens.init(
api_key="your-api-key",
endpoint="https://agentlens.vectry.tech"
)TypeScript
import { init } from "agentlens-sdk";
init({
apiKey: "your-api-key",
endpoint: "https://agentlens.vectry.tech",
});Step 3: Trace your first agent
Python
import agentlens
from agentlens import trace
agentlens.init(
api_key="your-api-key",
endpoint="https://agentlens.vectry.tech"
)
@trace(name="my-first-agent")
def my_agent(prompt: str) -> str:
# Your agent logic here
response = call_llm(prompt)
return response
# Run it — the trace is sent automatically
result = my_agent("What is the capital of France?")TypeScript
import { init, TraceBuilder } from "agentlens-sdk";
init({
apiKey: "your-api-key",
endpoint: "https://agentlens.vectry.tech",
});
const trace = new TraceBuilder("my-first-agent");
trace.addSpan({
name: "llm-call",
type: "LLM_CALL",
input: { prompt: "What is the capital of France?" },
output: { response: "Paris" },
status: "COMPLETED",
});
await trace.end();Step 4: View in the dashboard
Open your AgentLens dashboard to see the trace you just sent. You will see the trace name, its status, timing information, and any spans or decision points you recorded.
Open DashboardBilling and session limits
Each trace you send counts as one session for billing purposes. AgentLens cloud offers three tiers:
| Plan | Price | Sessions |
|---|---|---|
| Free | $0 | 20 sessions/day |
| Starter | $5/month | 1,000 sessions/month |
| Pro | $20/month | 100,000 sessions/month |
Manage your subscription in Settings → Billing in the dashboard. Self-hosted instances are not subject to these limits. See Authentication & Billing for full details.