01
Install the SDK
We ship TypeScript, Python, and Rust SDKs. All accept the same environment variables and produce compatible traces.
# node / deno / bun pnpm add loupe-sdk # python pip install loupe # rust cargo add loupe
02
Get credentials
Create a project in the console; copy the project id and the API key. Set them as environment variables.
export LOUPE_API_KEY=lp_sk_live_abc123… export LOUPE_PROJECT=support-bot export LOUPE_ENV=prod
For self-hosted, point LOUPE_URL at your instance; no other changes.
03
Wrap your existing client
No code changes downstream — all your chat.completions.create calls, tool calls, and retrievals now produce a trace.
import { loupe } from "loupe-sdk";
import OpenAI from "openai";
const ai = loupe(new OpenAI());
// use it exactly as before — every call is a span
const resp = await ai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: input }],
});Or use framework-specific integrations for LangChain, LlamaIndex, Vercel AI SDK, and Anthropic/Gemini directly.
04
Verify it's recording
Run one request. Open the console — a trace should land in under a second.
curl -X POST https://api.yourdomain.com/chat \
-d '{"message": "where is my order?"}'
# in another shell
loupe tail --project support-bot
✓ trace t_01jjq… · 1.8s · 1.17k tokens · $0.0019You're observable.
Next: write your first eval suite (evals/_README.md in your repo), or pin a prompt version so rolling back is a single click.