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

@apixauth/protocol

v1.0.5

Published

Secure AI API authentication, rate limiting, and cost control - Zero infrastructure, maximum security!

Readme

🔐 APIxAuth Protocol

Secure AI API authentication, rate limiting, and cost control - Zero infrastructure, maximum security!

npm version License: MIT Node.js Version

🚀 Features

  • 🔒 5-Layer Security - Clone keys, device fingerprinting, encryption, request signing, domain whitelisting
  • ⚡ Zero Infrastructure - No servers, no databases by default (optional encrypted storage)
  • 🤖 Multi-Provider - Gemini, OpenAI, Claude with auto-fallback
  • 💰 Cost Control - Real-time tracking, budget limits, automatic downgrade
  • 📊 Rate Limiting - Smart quota management with ML-based learning
  • 🔍 Built-in Search - Google Search (Gemini), Web browsing (GPT-4o)
  • 🧠 Deep Thinking - Reasoning modes (o1/o3/o4, Gemini thinking)
  • 📝 Audit Logging - Cryptographically signed request logs
  • 🎯 39 AI Models - Latest models from all providers (Feb 2026)

📦 Installation

npm install @apixauth/protocol

Optional Dependencies (Auto-updates)

# For always-updated AI models
npm install @google/generative-ai openai @anthropic-ai/sdk

# For database storage
npm install pg mysql2 mongodb sqlite3

🎯 Quick Start

import { APIxAuth } from '@apixauth/protocol';

const api = new APIxAuth({
  providers: {
    gemini: {
      key: process.env.GEMINI_API_KEY,
      dailyLimit: 100
    },
    openai: {
      key: process.env.OPENAI_API_KEY,
      dailyLimit: 200
    }
  },
  budget: {
    daily: 10.00,
    perRequest: 1.00
  }
});

// Basic chat
const response = await api.chat('Hello!');
console.log(response.text);

// Chat with search
const searchResponse = await api.chatWithSearch('Latest AI news 2026?');

// Chat with thinking
const thinkingResponse = await api.chatWithThinking('Solve: 2x + 5 = 15');

🔐 Key Vault Security

Protect your API keys with 5-layer security:

const api = new APIxAuth({
  keyVault: {
    enabled: true,
    masterPassword: process.env.MASTER_PASSWORD,
    allowedDomains: ['myapp.com']
  },
  providers: {
    gemini: { key: 'AIzaSy...' }  // Real key
  }
});

// After initialization, real key is encrypted
// Code now contains: axk_1a2b3c4d... (clone key)
// Clone key is useless if stolen - device-locked!

Security Layers:

  1. AES-256-GCM Encryption - Military-grade
  2. Clone Keys - Safe references (axk_*)
  3. Device Fingerprinting - Hardware-locked
  4. Request Signing - Timestamp + nonce
  5. Domain Whitelisting - Authorized domains only

Learn more about Key Vault →

💡 Use Cases

Express.js API

import express from 'express';
import { APIxAuth } from '@apixauth/protocol';

const app = express();
const api = new APIxAuth({ /* config */ });

app.post('/api/chat', async (req, res) => {
  const response = await api.chat(req.body.message);
  res.json(response);
});

SaaS Application

// Per-user rate limiting
const api = new APIxAuth({
  providers: {
    gemini: { key: user.apiKey, dailyLimit: user.plan.limit }
  }
});

Batch Processing

const messages = ['Question 1', 'Question 2', 'Question 3'];
const responses = await Promise.all(
  messages.map(msg => api.chat(msg))
);

More examples →

📊 Supported Models (Feb 2026)

Gemini (17 models)

  • gemini-2.5-flash (default) - Fast & efficient
  • gemini-2.5-pro - Most capable
  • gemini-2.0-flash-thinking-exp - Deep reasoning
  • Image: gemini-2.5-flash-image, imagen-4.0
  • Video: veo-3.1, veo-3.0

OpenAI (11 models)

  • gpt-4o (default) - Latest GPT-4
  • gpt-4.5, gpt-4.5-pro - Most advanced
  • o4-mini, o3, o3-pro - Reasoning models
  • gpt-4.1, gpt-4.1-mini - Coding focused

Claude (11 models)

  • claude-sonnet-4.5 (default) - Balanced
  • claude-opus-4.5 - Most capable
  • claude-haiku-4.5 - Fastest
  • claude-4.1 series

Full model list →

🎨 Features

Built-in Search

// Google Search grounding (Gemini)
const response = await api.chatWithSearch('Latest tech news?', {
  provider: 'gemini'
});

// Web browsing (GPT-4o)
const response = await api.chatWithSearch('Current Bitcoin price?', {
  provider: 'openai'
});

Deep Thinking Mode

// Gemini thinking mode
const response = await api.chatWithThinking('Complex math problem', {
  provider: 'gemini'
});

// OpenAI o1/o3/o4 reasoning
const response = await api.chatWithThinking('Logic puzzle', {
  provider: 'openai',
  model: 'o4-mini'
});

console.log(response.thinkingContent); // See reasoning process

Cost Tracking

// Get usage stats
const usage = await api.getUsage();
console.log(usage.cost); // Total cost
console.log(usage.quotas); // Per-provider quotas

// Get total cost
const cost = await api.getCost();
console.log(`Spent: $${cost.toFixed(2)}`);

Database Storage

const api = new APIxAuth({
  storage: {
    type: 'database',
    options: {
      type: 'postgresql',
      connection: {
        host: 'localhost',
        database: 'apixauth',
        user: 'user',
        password: 'pass'
      },
      encryptionKey: process.env.ENCRYPTION_KEY
    }
  }
});

📚 Documentation

🛠️ Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Lint
npm run lint

🤝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md first.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

MIT © APIxAuth

🌟 Star History

If you find this project useful, please consider giving it a star! ⭐

📧 Support

🎯 Roadmap

  • [ ] Next.js support (browser + edge runtime)
  • [ ] Streaming responses
  • [ ] Function calling support
  • [ ] Multi-modal inputs (images, audio)
  • [ ] Agent workflows
  • [ ] More AI providers

Made with ❤️ by the APIxAuth team