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

aisniff

v0.0.7

Published

LLM API proxy with real-time traffic sniffing and visualization

Downloads

773

Readme

AISniff

npm version license

See what your AI coding agents are actually doing.

AISniff is a lightweight LLM API proxy that gives you real-time visibility into every request your AI coding tools send — payloads, SSE streams, token usage, cache metrics, tool calls, and multi-turn loops — all in a live web dashboard.

One command to start. Zero config to sniff.

npm install -g aisniff
aisniff                  # proxy on :8088, dashboard auto-opens

Why AISniff?

When you use Claude Code, OpenCode, Codex, or Cline, you're sending prompts, code, and API keys to remote LLM services — with almost zero visibility into what's happening. AISniff fixes that:

  • No more blind API calls — see full request/response payloads live
  • Track your spend — token usage + cache metrics per call and per conversation loop
  • Debug agent behavior — watch thinking, tool calls, and multi-turn loops as they happen
  • Auth stays safe — API keys are forwarded but redacted in logs and dashboard
  • Works with any provider — Anthropic, OpenAI, Gemini, Dashscope, or any HTTPS endpoint

How It Works

  AI Coding Tools ──► AISniff (:8088) ──► LLM Services
 ┌───────────┐   ┌──────────────┐   ┌───────────────────┐
 │Claude Code│──►│              │──►│api.anthropic.com  │
 │ OpenCode  │──►│  proxy +     │──►│api.openai.com     │
 │  Codex    │──►│  dashboard   │──►│gemini.googleapis  │
 │  Cline    │──►│              │──►│dashscope / others │
 └───────────┘   └──────────────┘   └───────────────────┘
                     │
                     ▼
               /__dashboard
            (visualize logs & SSE)

AISniff sits between your AI tool and the LLM endpoint. It forwards requests unchanged while parsing SSE streams in-flight, logging structured data, and feeding a real-time web dashboard.

http://localhost:8088/anthropic/v1/messages      →  https://api.anthropic.com/v1/messages
http://localhost:8088/openai/v1/chat/completions  →  https://api.openai.com/v1/chat/completions

Features

Real-Time Dashboard

Open http://localhost:8088/ (auto-opens on startup):

  • Full payloads — every request and response, structured and searchable
  • Parsed SSE output — not raw chunks; text, thinking, tool calls reconstructed into readable turns
  • Token tracking — input/output tokens with cache creation and read metrics
  • Loop detection — multi-turn conversations grouped with unique IDs
  • Route management — add, edit, or delete routes from the dashboard with hot-reload

Smart SSE Parsers

| Provider | API | What's Parsed | |----------|-----|---------------| | Anthropic | Messages SSE | Text, thinking (with signatures), tool_use/result, usage + cache metrics | | OpenAI | Chat Completions SSE | Choices, content, usage | | OpenAI | Responses SSE | Content, reasoning summaries, usage, error/cancelled | | Any endpoint | Generic passthrough | JSON body logging, error summaries |

Auto-Config for AI Tools

One click from the dashboard — no manual env vars needed:

| Tool | What It Configures | |------|-------------------| | Claude Code | ANTHROPIC_BASE_URL in ~/.claude/settings.json | | OpenCode | baseURL in ~/.opencode/opencode.json | | Codex | base_url in ~/.codex/config.toml | | Cline | claude.apiEndpoint in VS Code settings |

Click to wire, click again to restore the original endpoint.

CLI

aisniff [options]          # full command
as [options]               # shortcut alias

| Flag | Description | |------|-------------| | -p, --port <port> | Port to listen on (default: 8088) | | --prefix <prefix> | Route prefix (must start with /) | | --baseurl <url> | Target base URL (pairs with preceding --prefix) |

aisniff                                                    # defaults, auto-open dashboard
aisniff -p 9090                                            # custom port
as --prefix /anthropic --baseurl https://api.anthropic.com  # single route
as --prefix /anthropic --baseurl https://api.anthropic.com \
   --prefix /openai --baseurl https://api.openai.com       # multi-route

CLI routes persist to ~/.aisniff/config.json and survive restarts.

Config & Logs

~/.aisniff/config.json is auto-created on first start. Routes are stored separately for auto-configured and manually added entries.

Log files:

  • Dev mode (no config): ./logs/ next to the project
  • Published mode: ~/.aisniff/logs/
  • Configurable via logsDir setting

Logs are NDJSON organized by route prefix, with an index.json per prefix tracking loop IDs, turn counts, token usage, and model names.

License

MIT