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

@polyswitch/proxy

v0.1.0

Published

Zero-Code Transparent CLI Proxy Daemon for Polyswitch Enterprise AI Gateway — route Cursor, Claude Code, and any OpenAI-compatible tool through Polyswitch in seconds

Readme

@polyswitch/proxy

Zero-code transparent proxy daemon — route Cursor, Claude Code, VS Code Copilot, or any OpenAI-compatible tool through Polyswitch Enterprise AI Gateway in under 60 seconds. No code changes needed.

npm version License: MIT


How It Works

The proxy starts a local HTTP server that:

  1. Accepts requests from any tool that talks OpenAI API (Cursor, Claude Code, Python scripts, etc.)
  2. Forwards them to the Polyswitch Gateway with your API key injected automatically
  3. Returns the response transparently — the tool doesn't know anything changed

Your API key never needs to be entered into third-party tools.


Installation

# Install globally (recommended for CLI use)
npm install -g @polyswitch/proxy

# Or run directly with npx (no install needed)
npx @polyswitch/proxy

Quick Start

Step 1 — Set your environment variables

# Required: Your Polyswitch API key
export POLYSWITCH_API_KEY="pr_your_key_here"

# Optional: The Polyswitch gateway URL (defaults to localhost:3000/api/v1)
export POLYSWITCH_GATEWAY_URL="https://polyswitch.io/api/v1"

# Optional: Proxy port (defaults to 8080)
export POLYSWITCH_PROXY_PORT=8080

Step 2 — Start the proxy

polyswitch-proxy
# or
npx @polyswitch/proxy

You'll see:

⚡ Polyswitch Zero-Code Local Proxy listening on http://127.0.0.1:8080
   Forwarding traffic to: https://gateway.polyswitch.dev/api/v1

   To route Cursor / Claude Code / Python scripts seamlessly, set:
   export OPENAI_BASE_URL="http://127.0.0.1:8080"

Step 3 — Point your tool at the proxy

export OPENAI_BASE_URL="http://127.0.0.1:8080"

That's it. Open Cursor, Claude Code, or run your Python script — all traffic goes through Polyswitch automatically.


Configuration

| Environment Variable | Default | Description | | ------------------------ | ------------------------------ | -------------------------------------------------------------- | | POLYSWITCH_API_KEY | — | Your Polyswitch API key (injected into all forwarded requests) | | POLYSWITCH_GATEWAY_URL | http://localhost:3000/api/v1 | The Polyswitch gateway to forward traffic to | | POLYSWITCH_PROXY_PORT | 8080 | Local port the proxy listens on |


Use Cases

Cursor IDE

  1. Start the proxy
  2. In Cursor settings → Models → set API Base URL to http://127.0.0.1:8080

Claude Code / Claude CLI

export ANTHROPIC_BASE_URL="http://127.0.0.1:8080"
claude

Python scripts

export OPENAI_BASE_URL="http://127.0.0.1:8080"
python your_script.py

Any OpenAI-compatible tool

export OPENAI_BASE_URL="http://127.0.0.1:8080"
export OPENAI_API_KEY="anything"  # The proxy injects the real key

Programmatic Use

You can also use the proxy server in your own Node.js code:

const { createProxyServer } = require('@polyswitch/proxy');

const server = createProxyServer();
server.listen(8080, '127.0.0.1', () => {
  console.log('Polyswitch proxy running on port 8080');
});

License

MIT © Polyswitch