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

stx7-gateway

v0.1.0

Published

Multi-provider gateway for Claude Code — route requests to OpenAI, Gemini, Ollama, Mistral, and more

Readme

⚡ claude-gateway

Multi-provider gateway for Claude Code — route your Claude Code requests through OpenAI, Gemini, Ollama, Mistral, and more.

What is this?

A local proxy server that sits between Claude Code and any LLM provider. Claude Code sends Anthropic API requests → the gateway translates them to the active provider's format → streams responses back as Anthropic-format SSE.

Claude Code  ──→  claude-gateway (localhost:4747)  ──→  OpenAI / Gemini / Ollama / ...

Supported Providers

| Provider | Models | Auth | |---|---|---| | OpenAI | GPT-4o, GPT-5.x, o-series | OPENAI_API_KEY | | Google Gemini | Gemini 2.5 Pro, 2.0 Flash | GEMINI_API_KEY | | Ollama | Llama, Qwen, DeepSeek, Codestral (local) | None | | Mistral | Devstral, Codestral, Mistral Large | MISTRAL_API_KEY | | NVIDIA NIM | Nemotron, Llama, DeepSeek | NVIDIA_API_KEY | | MiniMax | MiniMax M2.5, M1 | MINIMAX_API_KEY | | GitHub Copilot | GPT-4o, Claude, o3-mini | GITHUB_TOKEN | | OpenAI Codex | GPT-5.x reasoning models | OPENAI_API_KEY |

Quick Start

1. Install

npm i -g claude-gateway

2. Set up a provider

# Set your OpenAI key
claude-gateway key openai sk-your-key-here

# Or use Ollama (no key needed, just have Ollama running)
claude-gateway switch ollama

3. Start the gateway

claude-gateway start

4. Configure Claude Code

Add to your ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:4747"
  },
  "mcpServers": {
    "gateway": {
      "command": "claude-gateway",
      "args": ["mcp"]
    }
  }
}

Now Claude Code routes through your chosen provider, and you can switch providers from within Claude Code using the MCP tools!

CLI Commands

claude-gateway              # Start the proxy server
claude-gateway start        # Start the proxy server
claude-gateway mcp          # Start MCP server (for Claude Code integration)
claude-gateway status       # Show current status
claude-gateway providers    # List all providers
claude-gateway switch <id>  # Switch active provider
claude-gateway key <id> <k> # Set provider API key
claude-gateway help         # Show help

MCP Tools (inside Claude Code)

Once configured as an MCP server, these tools are available inside Claude Code:

  • list_providers — Show all providers and their status
  • switch_provider — Switch to a different provider
  • list_models — List models for a provider
  • switch_model — Change the active model
  • set_api_key — Configure a provider's API key
  • gateway_status — Check gateway status

Configuration

Config is stored at ~/.claude-gateway/config.json:

{
  "activeProvider": "openai",
  "activeModel": "gpt-4o",
  "port": 4747,
  "providers": {
    "openai": {
      "apiKey": "sk-...",
      "defaultModel": "gpt-4o"
    },
    "gemini": {
      "apiKey": "AIza..."
    }
  }
}

You can also use environment variables (OPENAI_API_KEY, GEMINI_API_KEY, etc.) instead of storing keys in config.

How it works

  1. Claude Code sends a POST /v1/messages request (Anthropic format)
  2. The gateway translates the request to the active provider's API format
  3. The provider processes the request and returns a response
  4. The gateway translates the response back to Anthropic format
  5. Claude Code receives a response it understands

For streaming requests, the gateway converts provider-specific SSE events into Anthropic's message_start → content_block_delta → message_stop event sequence.

License

MIT