npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aivyuh/finops

v0.2.0

Published

V7 AI FinOps SDK — transparent cost telemetry for Anthropic and OpenAI clients

Readme

@aivyuh/finops

Transparent cost telemetry for Anthropic and OpenAI Node.js clients. Part of the V7 AI FinOps platform.

Wrap your existing AI SDK client in one line — @aivyuh/finops captures model, tokens, cost, and latency metadata and sends it to the V7 backend. It never reads or stores prompt or response content.

Install

npm install @aivyuh/finops

Quickstart

Anthropic

import Anthropic from "@anthropic-ai/sdk";
import { wrapClient } from "@aivyuh/finops";

const client = wrapClient(new Anthropic(), {
  telemetryEndpoint: "https://finops-api.aivyuh.com/telemetry",
  customerId: "cust-123",
  apiKey: process.env.AIVYUH_FINOPS_KEY, // per-customer key, sent as X-API-Key
  project: "my-app",
  tags: { feature: "chat", team: "product" },
});

// Use the client exactly as before — all types and overloads are preserved
const message = await client.messages.create({
  model: "claude-sonnet-4-6-20260320",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello, Claude!" }],
});

OpenAI

import OpenAI from "openai";
import { wrapClient } from "@aivyuh/finops";

const client = wrapClient(new OpenAI(), {
  telemetryEndpoint: "https://finops-api.aivyuh.com/telemetry",
  customerId: "cust-123",
  project: "my-app",
  tags: { feature: "search", team: "platform" },
});

// Use the client exactly as before
const completion = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello, GPT!" }],
});

Configuration

| Option | Type | Required | Description | |--------|------|----------|-------------| | telemetryEndpoint | string | Yes | V7 telemetry ingest URL (https://finops-api.aivyuh.com/telemetry) | | customerId | string | Yes | Your customer ID for cost attribution | | apiKey | string | Yes* | Per-customer API key, sent as X-API-Key header. Required by the production V7 ingest endpoint. | | project | string | No | Project name for grouping costs | | tags | Record<string, string> | No | Custom key-value tags attached to every request | | disableTelemetry | boolean | No | Set true to disable (useful in tests) |

Production API Endpoint

https://finops-api.aivyuh.com/telemetry

POST telemetry payloads are accepted with a 202 Accepted response. The endpoint is fire-and-forget — if unreachable, your application is unaffected.

How It Works

  1. wrapClient() detects whether you passed an Anthropic or OpenAI client (duck-typing).
  2. It monkey-patches messages.create() (Anthropic) or chat.completions.create() (OpenAI).
  3. After each successful call, it extracts usage metadata (model, tokens, latency) and estimates cost.
  4. A non-blocking fetch() sends the telemetry payload to V7 — errors are silently swallowed.
  5. Your original response is returned untouched.

Advanced: Individual Wrappers

If you only use one provider, import the specific wrapper to avoid unused type imports:

import { wrapAnthropic } from "@aivyuh/finops";
import { wrapOpenAI } from "@aivyuh/finops";

Requirements

  • Node.js >= 18 (uses native fetch)
  • @anthropic-ai/sdk >= 0.40.0 and/or openai >= 1.50.0 as peer dependencies

License

MIT