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

nous-token

v0.3.5

Published

Open-source AI usage tracker. One command to track all your AI spending.

Readme

nous-token

Open-source AI usage tracker. Every token, verified.

One command to track all your AI spending across every provider. Your data is signed, verifiable, and yours.

Live leaderboard: token.nousai.cc

Quick Start

npx nous-token setup

The CLI asks one thing: your wallet address (0x...) — your permanent identity.

Then it auto-detects your AI tools (Claude Code, Cursor, Python SDKs, etc.) and routes them through the gateway. Works with both API keys and subscription plans (Claude Max, etc.).

How It Works

You → AI Tool → Gateway → LLM Provider
                  ↓
            extract .usage from response
            sign receipt (ECDSA)
            record in Merkle tree
                  ↓
            token.nousai.cc

The gateway is a transparent proxy. It forwards your request untouched, reads only the .usage field from the response, signs a receipt, and records it. Your prompts and completions are never read or stored.

Supported Providers

Works with any OpenAI-compatible API out of the box:

| Provider | Route | |----------|-------| | OpenAI | /openai/v1/... | | Anthropic | /anthropic/... | | DeepSeek | /deepseek/v1/... | | Google Gemini | /gemini/... | | Groq | /groq/v1/... | | Together | /together/v1/... | | Mistral | /mistral/v1/... | | OpenRouter | /openrouter/api/v1/... | | Fireworks | /fireworks/v1/... | | Perplexity | /perplexity/v1/... | | Cohere | /cohere/v1/... | | Any custom | Set X-Nous-Upstream header |

Wallet Identity

Your wallet address is your permanent identity. API keys expire and rotate — your wallet doesn't.

  • Run npx nous-token setup with your wallet address
  • All usage across any API key or OAuth token links to your wallet
  • Switch keys, switch machines, switch plans — your history follows you
  • First bind is permanent per auth token (prevents rebind with leaked keys)
  • Works with API keys and subscription plans (Claude Max, ChatGPT Plus, etc.)

Privacy by Structure

Not by promise — by code. Audit the source.

| Data | What happens | |------|-------------| | Auth Token | Hashed (SHA-256) for identity. Never stored. Works with API keys and OAuth tokens. | | Prompts | request.body piped directly to provider. Never read. | | Responses (streaming) | Tee'd. Only last 4KB buffered to extract .usage. | | Responses (non-streaming) | In V8 isolate memory. Only .usage accessed. GC'd after request. | | Storage | D1 stores: timestamp, user_hash, wallet, provider, model, token counts. Nothing else. |

Verification

Every API call produces a signed receipt. Anyone can verify independently.

Run a sentinel

npx tsx sentinel.ts          # one-shot verify
npx tsx sentinel.ts --watch  # continuous monitoring

The sentinel pulls all records, recomputes leaf hashes, rebuilds the Merkle tree, and verifies receipt signatures. No API key needed.

Trust model

  1. Code is open-source — audit everything
  2. Per-call ECDSA signatures — every receipt is signed
  3. Merkle Mountain Range — tampering breaks the tree
  4. Sentinels — independent verifiers anyone can run
  5. On-chain anchoring — store receipts on BASE or any EVM chain

API

Gateway: https://gateway.nousai.cc

| Endpoint | Method | Description | |----------|--------|-------------| | /{provider}/v1/... | * | Proxy to LLM provider | | /api/leaderboard | GET | Top users by tokens (?days=30, ?days=0 for all time) | | /api/leaderboard/model | GET | Per-model user ranking (?model=...) | | /api/models | GET | Usage breakdown by model | | /api/stats | GET | Global totals | | /api/wallet/{address} | GET | Usage for a wallet (all linked hashes) | | /api/user/{hash} | GET | Single user stats | | /api/user/{hash}/receipts | GET | Signed receipts (paginated) | | /api/records | GET | Raw records for sentinel verification | | /api/chain | GET | Merkle root and MMR state | | /api/sign | POST | Signed summary for on-chain storage | | /api/pubkey | GET | Gateway's ECDSA public key |

Architecture

nous-token/
├── gateway/          Cloudflare Worker — proxy + usage extraction + signing
│   └── src/
│       ├── index.ts      API routes + proxy logic
│       ├── db.ts         D1 storage + Merkle Mountain Range
│       ├── providers.ts  Usage format auto-detection (OpenAI/Anthropic/Gemini)
│       └── stream.ts     Streaming response usage extraction
├── web/              Cloudflare Pages — leaderboard frontend
│   └── index.html
├── cli/              CLI setup tool
│   └── setup.ts
├── index.ts          OpenClaw plugin
├── sentinel.ts       Independent Merkle tree verifier
└── PROTOCOL.md       Full protocol specification

License

MIT