Documentation
One base-URL change to adopt DriftWatch. Pick a topic to see the exact snippet.
Quickstart
Swap the base URL of your existing OpenAI, Anthropic or Gemini client. Nothing else in your code changes.
proxy.ts
import OpenAI from "openai"; const openai = new OpenAI({ baseURL: "https://api.driftwatchproxy.com/v1/openai", apiKey: process.env.OPENAI_API_KEY, defaultHeaders: { "x-driftwatch-key": process.env.DRIFTWATCH_KEY, "x-driftwatch-prune": "balanced", },}); const res = await openai.chat.completions.create({ model: "gpt-4o", messages,}); // res.headers["x-driftwatch-tokens-saved"] -> 4128