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

claude-search-proxy

v1.0.1

Published

OpenAI-compatible HTTP proxy that turns any Claude subscription's built-in WebSearch into a search API. Zero-cost web search for OpenClaw and any OpenAI-compatible client.

Readme

claude-search-proxy 🔍

CI License: MIT Node.js

You don't need to pay for a search API to give your OpenClaw agent web search. Your Claude subscription already includes it — this proxy lets you actually use it.

npm install -g claude-search-proxy
claude-search-proxy
# → Search API running on localhost:52480
curl -X POST http://localhost:52480/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"latest AI news"}]}'

That's it. OpenAI-compatible search endpoint, zero extra cost, zero dependencies.


The Problem

If you're building with AI, you're probably paying for search separately — Perplexity, Brave, SerpAPI, or OpenRouter credits. But any Claude subscription (Pro, Max, Teams, or Enterprise) already includes web search through Claude Code. There's just no API for it.

This proxy creates that API. It wraps claude -p --allowedTools WebSearch in an OpenAI-compatible HTTP endpoint. Your tools don't know the difference — they see a standard /v1/chat/completions endpoint that returns search results with citations.

Quick Start

# Install Claude CLI and authenticate
npm install -g @anthropic-ai/claude-code
claude auth login

# Install and run
npm install -g claude-search-proxy
claude-search-proxy

OpenClaw Integration

Ships with a managed extension — the proxy starts and stops with your gateway automatically.

# Install the extension
openclaw plugins install --link $(npm root -g)/claude-search-proxy

Add to your openclaw.json:

{
  tools: {
    web: {
      search: {
        provider: "perplexity",
        perplexity: {
          baseUrl: "http://127.0.0.1:52480",
          apiKey: "not-needed"
        }
      }
    }
  }
}

Restart the gateway. web_search now routes through your Claude subscription.

Why provider: "perplexity"? The proxy speaks the same OpenAI-compatible protocol. No native provider exists yet, so we reuse the Perplexity config path. Works seamlessly.

General Usage

Works with anything that speaks OpenAI's chat completions format — LangChain, LlamaIndex, custom agents, or plain curl.

Point your client at http://localhost:52480 with apiKey: "not-needed":

{
  "choices": [{ "message": { "role": "assistant", "content": "..." } }],
  "citations": ["https://...", "https://..."]
}

How It Works

Your app → POST /v1/chat/completions → claude-search-proxy
  → claude -p "query" --allowedTools WebSearch
  → extracts citations
  → returns OpenAI-shaped JSON

Sessions are reused for prompt caching, then rotated after N queries to keep context bounded. Zero runtime dependencies — just Node.js built-ins.

Options

| Flag | Default | Description | |------|---------|-------------| | --port | 52480 | Port to listen on | | --host | 127.0.0.1 | Host to bind to | | --model | claude-sonnet-4-20250514 | Claude model for searches | | --max-session-searches | 20 | Searches per session before rotation | | --timeout | 60000 | CLI timeout (ms) | | --verbose | off | Debug logging |

Endpoints

| Method | Path | Description | |--------|------|-------------| | POST | /v1/chat/completions | Search (OpenAI format) | | POST | /chat/completions | Same, without /v1 prefix | | GET | /health | Status + session info |

Security

Localhost-only by default. No authentication — designed to run on your machine, not the internet.

Protected against: shell injection (spawn, not exec), CLI flag injection (model name validation), DNS rebinding (Host header checks), oversized requests (body + query limits), CORS (localhost origins only).

Be aware: searches consume your plan's token allowance. Monitor usage on your Claude dashboard. Never bind to 0.0.0.0 without understanding the implications.

Requirements

  • Node.js ≥ 18
  • Claude CLI installed and authenticated with any paid Claude plan
  • Zero runtime dependencies

Development

git clone https://github.com/LePetitPince/claude-search-proxy.git
cd claude-search-proxy
npm install
npm run build
npm test             # 49 tests, no network calls

License

MIT


Built by LePetitPince 🌹