Quickstart
Get up and running with Warpmetrics in under 5 minutes.
Prerequisites
- Node.js 18+ installed
- An OpenAI or Anthropic API key
Setup Steps
2
Create an API key
Go to your API keys page and create a new key. You'll use this to authenticate the SDK with Warpmetrics.
Manage API keys3
Install the SDK
Install the Warpmetrics SDK in your project:
Terminal
npm install @warpmetrics/warpSet the WARPMETRICS_API_KEY environment variable to your API key.
4
Instrument your first call
Wrap your LLM client and start tracking:
index.js
import { warp, run, call, outcome } from '@warpmetrics/warp';
import OpenAI from 'openai';
// 1. Wrap your client
const openai = warp(new OpenAI());
// 2. Create a run
const r = run('my-agent');
// 3. Make LLM calls (automatically captured)
const res = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
});
// 4. Emit the call to the run
call(r, res);
// 5. Record the outcome
outcome(r, 'Completed');