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

@token2chat/t2c

v0.2.11

Published

t2c - Pay-per-request LLM access via Cashu ecash

Readme

t2c — Pay for AI with Ecash

CLI + local proxy that makes any AI tool work with token2chat. No accounts, no API keys.

t2c manages a local Cashu ecash wallet and runs a proxy that auto-attaches payment tokens to your LLM requests. Point your AI tool at localhost:10402 and it just works.

Built by an autonomous AI agent.

Install

npm install -g @token2chat/t2c

Quick Start

# 1. Initialize wallet and config
t2c init

# 2. Fund your wallet via Lightning
t2c mint 5000              # creates invoice for 5000 sats
t2c mint --check <quote>   # check payment & mint ecash

# 3. Connect your AI tool
t2c connect cursor         # or: openclaw, cline, aider, continue, env
t2c service start          # start the local proxy

# 4. Use AI as normal — t2c handles payment automatically

How It Works

Your AI Tool (Cursor, Cline, OpenClaw, etc.)
    │
    │  POST http://127.0.0.1:10402/v1/chat/completions
    │  Authorization: Bearer <proxy-secret>
    ▼
t2c proxy (local)
    │  1. Estimate price from request
    │  2. Select ecash proofs from wallet
    │  3. Encode as Cashu V4 token
    │  4. Attach X-Cashu header
    │  5. Forward to Gate
    ▼
Gate (gate.token2chat.com)
    │  6. Verify ecash, proxy to LLM
    │  7. Return response + change token
    ▼
Response flows back to your AI tool
(t2c reclaims change into wallet)

CLI Reference

Wallet

| Command | Description | |---------|-------------| | t2c init | Initialize config + wallet | | t2c balance | Show wallet balance (in USD) | | t2c mint [amount] | Fund wallet via Lightning invoice | | t2c mint --check <quote> | Check payment and mint ecash | | t2c recover | Recover failed change/refund tokens | | t2c audit | Full fund audit (wallet + mint + gate + anomalies) |

Proxy Service

| Command | Description | |---------|-------------| | t2c service start | Start local proxy (foreground) | | t2c service stop | Stop proxy | | t2c service restart | Restart proxy | | t2c service status | Show proxy status | | t2c service logs | View proxy logs | | t2c service install | Install as system service (launchd/systemd) | | t2c service uninstall | Remove system service |

Integration

| Command | Description | |---------|-------------| | t2c connect <app> | Auto-configure an AI tool | | t2c config <tool> | Print config snippet for a specific tool | | t2c status | Service status + balance overview | | t2c monitor | Live TUI dashboard | | t2c doctor | Self-diagnostic |

Supported AI Tools

| Tool | Command | What it does | |------|---------|-------------| | Cursor | t2c connect cursor | Writes proxy URL + key to Cursor config | | OpenClaw | t2c connect openclaw | Adds provider to OpenClaw config | | Cline | t2c connect cline | Configures VS Code extension | | Continue | t2c connect continue | Configures Continue extension | | Aider | t2c connect aider | Sets environment variables | | Any tool | t2c connect env | Prints env vars to export manually |

Configuration

Config is stored at ~/.t2c/config.json.

| Field | Default | Description | |-------|---------|-------------| | gate | https://gate.token2chat.com | Gate URL | | mint | https://mint.token2chat.com | Mint URL | | proxy.port | 10402 | Local proxy port | | proxy.secret | (auto-generated) | Bearer token for proxy auth | | wallet | ~/.t2c/wallet.json | Wallet file path |

Gate Discovery

t2c automatically discovers available gates from token2.cash/gates.json. If your primary gate is down, it fails over to other healthy gates that support your model.

Security

  • Local proxy auth — Bearer token with timing-safe comparison
  • Wallet file — 0o600 permissions, only readable by owner
  • Config directory — 0o700 permissions
  • Mutex-protected wallet — no concurrent double-spend from overlapping requests
  • Failed token persistence — tokens that fail to process are saved for recovery
  • No tracking — ecash is bearer money; the gate never knows who you are

Wallet

The wallet stores Cashu ecash proofs locally at ~/.t2c/wallet.json.

  • Unit: USD (1 unit = $0.00001, displayed as dollars)
  • Proof selection: largest-first greedy (minimizes number of proofs per payment)
  • Change handling: automatically reclaimed from gate responses (header or SSE event)
  • Funding: Lightning invoices via t2c mint

Balance Display

$ t2c balance
Wallet: $4.52 (452,000 units, 23 proofs)
Mint: https://mint.token2chat.com

System Service

Install t2c as a background service that starts on boot:

# macOS (launchd)
t2c service install

# Linux (systemd)
t2c service install

# Both auto-detect the platform

The proxy runs in the background, automatically paying for LLM requests from any connected AI tool.

License

MIT