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

@ermaaga/openai-proxy

v1.0.0

Published

Local proxy that maps the Anthropic Messages API to OpenAI-compatible providers (NVIDIA NIM, Groq, OpenAI, etc.). Drop-in endpoint for Claude Code.

Readme

openproxy

Run Claude Code against any OpenAI-compatible provider. Drop-in local proxy that translates the Anthropic Messages API into OpenAI chat completions — and back.

Claude Code  ──(Anthropic format)──▶  openproxy :4000
                                            │
                                            ▼  OpenAI format
                                      Provider API
                                  (NVIDIA NIM · Groq · OpenAI · …)
                                            │
                                            ▼  translated back
                                        Claude Code  ✅

Full support for streaming (SSE) and tool use. Works with any provider that speaks the OpenAI chat-completions API.


Install

npm install -g @ermaaga/openai-proxy

Installs the global openproxy command. Requires Node.js ≥ 18.


Supported providers

| Provider | API base | Notes | |----------|----------|-------| | NVIDIA NIM | https://integrate.api.nvidia.com/v1 | Free tier — large models (Qwen, Llama, …) | | Groq | https://api.groq.com/openai/v1 | Free tier — blazing fast inference | | OpenAI | https://api.openai.com/v1 | Paid |

Any provider with an OpenAI-compatible /chat/completions endpoint works.


Quick start

Option A — Browser wizard (recommended)

openproxy test

Opens http://127.0.0.1:4000/test in your browser. Fill in API Key, API Base URL and Model, hit Save configuration. Done. Next time, just:

openproxy start

Option B — CLI

openproxy config \
  --api-key   nvapi-XXXXXXXXXX \
  --api-base  https://integrate.api.nvidia.com/v1 \
  --model     qwen/qwen3-coder-480b-a35b-instruct

Use with Claude Code

export ANTHROPIC_BASE_URL="http://localhost:4000"
export ANTHROPIC_API_KEY="fake-key"   # any string — the proxy uses its own key
claude

To persist these across shell sessions:

echo 'export ANTHROPIC_BASE_URL="http://localhost:4000"' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY="fake-key"'               >> ~/.zshrc
source ~/.zshrc

Daily usage

openproxy start          # start in the background
openproxy status         # check if running
openproxy stop           # stop the background process
openproxy logs -f        # follow live logs
openproxy test           # open browser tester / config UI

On-the-fly overrides:

openproxy start --port 5000 --model another-model

Debug mode (attached to shell):

openproxy start --foreground

Browser tester

After openproxy start:

openproxy test

Opens http://localhost:4000/test. From here you can:

  • Send test requests and inspect parsed responses
  • Toggle streaming (SSE) on/off
  • Copy the equivalent curl command

All commands & options

openproxy start [options]    Start the proxy in the background
openproxy stop               Stop the proxy
openproxy status             Show running state
openproxy test               Open the browser-based tester
openproxy logs [-f]          Print proxy logs (-f to follow)
openproxy config [options]   Persist config to ~/.openproxy/config.json
openproxy help               Show usage

| Flag | Applies to | Default | |------|-----------|---------| | --api-key <key> | start, config | — | | --api-base <url> | start, config | https://integrate.api.nvidia.com/v1 | | --model <name> | start, config | — | | --port <n> | start, config | 4000 | | --timeout <s> | start, config | 300 | | --foreground | start only | — | | --clear | config only | — |


Configuration precedence

For every setting, the first source that has a value wins:

  1. CLI flag (--api-key, --model, …)
  2. Environment variable (API_KEY, MODEL, API_BASE, PORT, REQUEST_TIMEOUT)
  3. ~/.openproxy/config.json
  4. Built-in default (only for api-base, port, timeout)

The proxy starts even without API_KEY / MODEL, but /v1/messages returns 503 until both are configured.

Shell env vars vs. saved config

If you export API_KEY / MODEL / API_BASE in your shell, those take priority over ~/.openproxy/config.json on every start.

The browser config page makes this transparent:

  • Each field shows a source badge: saved (green) or from env var (yellow)
  • A yellow banner lists every env var that will override on the next restart, with the exact unset command

To make saved config authoritative, unset the conflicting shell vars and restart.


Files

| Path | Purpose | |------|---------| | ~/.openproxy/config.json | Persisted config (chmod 600 on POSIX) | | ~/.openproxy/proxy.pid | Background process PID | | ~/.openproxy/proxy.log | Combined stdout/stderr |

The proxy binds to 127.0.0.1 only — the config endpoint is never reachable from the network.


Troubleshooting

| Symptom | Cause | Fix | |---------|-------|-----| | 503 Proxy not configured | API key or model not set | openproxy test or openproxy config --api-key K --model M | | Proxy already running | Previous instance still alive | openproxy stop | | 401 Unauthorized from upstream | Wrong API key | openproxy config --api-key <correct-key> | | 404 Not Found from upstream | Wrong model name | Check the exact slug on the provider's dashboard | | Upstream timeout | Slow provider response | openproxy start --timeout 600 | | Saved values lost after restart | Shell env vars override the file | unset API_KEY MODEL then restart | | Claude Code: model not found | Missing client env vars | Re-export ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY |


License

Apache 2.0


powered with ❤️ from ermaaga · 🤖