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

@hedvion/endpoint2cost

v0.9.4

Published

See how much you and your team spend on Claude Code — token usage + API-equivalent cost from local session logs. Local-first.

Readme

@hedvion/endpoint2cost

See how much you — and your team — spend on AI coding assistants. endpoint2cost reads Claude Code and Codex CLI local session logs, prices every turn at metered Anthropic / OpenAI rates, and shows token usage and cost per model, per day, and per project. A paid team tier aggregates each developer's usage into a shared hub, and a transparent Anthropic API proxy captures usage from server-side bots and other apps that already call api.anthropic.com directly.

Works on subscriptions too — Claude Code and Codex log token counts whether you're on a flat Max/Pro/Team plan or metered API keys. The cost shown is API-equivalent: what the same usage would bill at API prices. Volume is always real.

Install

npm i -g @hedvion/endpoint2cost
# or run without installing:
npx @hedvion/endpoint2cost usage

The binary is endpoint2cost. Requires Node 18+.

Free — your own usage

endpoint2cost usage          # scan ~/.claude/projects + ~/.codex/sessions
endpoint2cost dashboard      # open a local React dashboard for that report

Flags:

  • --no-claude / --no-codex — skip a provider
  • -d <dir> / --codex-dir <dir> — override the log directory
  • -m <id> — override the member identity (default: git email)

The dashboard shows total cost, a per-model breakdown, a daily-cost chart, and per-project usage. Everything runs locally — no data leaves your machine.

Paid — team usage hub

The admin provisions accounts; each account gets an API key (for the CLI) and a password (for the web dashboard).

# admin: create an account on the team server
export E2C_ADMIN_TOKEN=<token from <dataDir>/admin-token>
endpoint2cost admin add-account [email protected] --plan team
# → prints a one-time password + API key. Hand both to the user.

# member: activate the API key locally
endpoint2cost login <api-key>

# member: push usage (e.g. from a daily cron)
endpoint2cost usage --push

# anyone with a session: open the web dashboard
open https://<server>/        # email + password login

The hub ranks members by cost and shows each one's share, turns, sessions, and top model. Members are identified by their git email (override with E2C_MEMBER).

Seats

A plan caps how many distinct members the hub aggregates: Team = 5, Enterprise = 100. A new member's push is rejected once the cap is reached; existing members can always re-push.

Roster (optional)

When a team prefers an explicit allowlist over open self-registration:

endpoint2cost team add [email protected]
endpoint2cost team list
endpoint2cost team remove [email protected]

Once the roster is non-empty, only listed members may push.

Server-side bots — Anthropic proxy

Set ANTHROPIC_BASE_URL=https://<server>/anthropic/<tenant-id> in any bot's .env. Both the official Python and TypeScript Anthropic SDKs honour this env var automatically — no code changes needed. Each call is forwarded to api.anthropic.com and the response's usage block is recorded against the synthetic anthropic-api member of that tenant. Streaming requests (stream: true) are rejected.

Run your own server

endpoint2cost serve --port 4400 --data ./e2c-data

On first boot the server writes an admin bearer to ./e2c-data/admin-token (mode 0600). Use it for endpoint2cost admin ... commands and keep it secret — anyone with the token can create or revoke accounts.

Commands

| Command | Description | | --- | --- | | usage | Scan local logs → usage report | | dashboard | Local dashboard for your usage report | | dashboard --team <url> | Team usage hub from a server (paid) | | usage --push | Upload your usage to the team server (paid) | | serve | Run the team server | | login / logout / license | Manage your API key locally | | team list / add / remove | Manage the team roster (paid) | | admin add-account / list-accounts / remove-account | Provision accounts (admin token) | | admin set-plan / reset-password / rotate-api-key | Maintain an account (admin token) |

How cost is computed

Each assistant turn in the logs carries token counts (input, output, and cache read / cache write). They are priced per model family — Anthropic Opus / Sonnet / Haiku at their full cache-aware rates, OpenAI GPT-5 / GPT-4 / o-series at the input + output + cached-input rates. Unknown models are counted but priced at zero. Pricing defaults live in usage-cost.ts and are easy to override.

Privacy

The free CLI is fully local. The team tier sends only the aggregated usage report (token counts, model names, project folder names, timestamps) to the server you run — never prompts, code, or message content. The Anthropic proxy reads usage out of the response but does not store the prompt or completion body.