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

@tokenbee/sdk

v1.3.0

Published

Official TypeScript SDK for TokenBee LLM inference gateway and observability.

Readme

TokenBee TypeScript SDK

Official TypeScript/JavaScript SDK for TokenBee - The Intelligent LLM Inference Gateway with Observability, Compression, and Privacy.

Features

  • Unified API: Access multiple LLM providers (OpenAI, Anthropic, Google, Mistral, etc.) through a single interface.
  • Intelligent Compression: Reduce token usage and latency with context-aware compression.
  • Privacy Guard: Automatic PII masking and privacy-preserving inference.
  • Built-in Observability: Automatic tracking of latency, costs, and token usage.

Links

Installation

npm install @tokenbee/sdk

Quick Start

import { TokenBee, TokenBeeModel, CompressionRate } from '@tokenbee/sdk';

// Initialize the client with your TokenBee API key 
// AND your LLM provider key (Bring Your Own Key - BYOK)
const client = new TokenBee({
  apiKey: 'your_tokenbee_api_key',
  llmKey: 'your_llm_provider_key', // e.g. OpenAI or Anthropic key
});

// Send a request
const res = await client.send({
  model: TokenBeeModel.AnthropicClaude3_5_Sonnet,
  input: {
    messages: [{ role: 'user', content: 'Explain quantum entanglement' }],
    compression: 'auto',
    rate: CompressionRate.High
  }
});

console.log(res);

Compression Control

You can specify the compression rate and method per request. TokenBee uses an intelligent semantic engine to reduce token usage while preserving meaning.

const res = await client.send({
  model: TokenBeeModel.AnthropicClaude3_5_Sonnet,
  input: {
    messages: [...],
    compression: 'auto',      // 'auto' (default), 'on', or 'off'
    rate: CompressionRate.High, // Medium (0.5), High (0.33), etc.
    privacy: true
  }
});
  • compression: Set to 'auto' to let TokenBee decide when to compress, or 'off' to bypass the compression engine entirely for high-precision tasks.
  • rate: Controls the aggressiveness of compression. High aims for ~67% token reduction.
  • sessionId: (Optional) String ID to group multiple requests into a single replayable session in the dashboard.
  • userId: (Optional) String ID to track usage and costs per unique end-user.
  • privacy: (Optional) Set to true to disable payload logging and session replays for this request. Metadata (latency, tokens) will still be recorded for observability.

Bring Your Own Key (BYOK)

TokenBee is a stateless gateway. We do not store your LLM provider API keys in our database. You pass your provider key (OpenAI, Anthropic, etc.) through the SDK's llmKey parameter. The SDK sends this in the X-LLM-Key header, allowing the TokenBee proxy to forward requests to the provider on your behalf while you maintain full control over your billing and security.

License

MIT