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

@readtt/claude-max-api-proxy

v1.5.0

Published

Use your Claude Max subscription with any OpenAI-compatible client. Wraps Claude Code CLI as an OpenAI-compatible API server.

Downloads

167

Readme

Claude Max API Proxy

Use your Claude Max subscription as an OpenAI-compatible API. Any OpenAI client (Continue.dev, Cursor, OpenClaw, the OpenAI SDKs, curl) talks to this proxy on localhost, and the proxy runs your prompts through the Claude Code CLI you're already paying for — no per-token API bill.

Subject to Anthropic's fair use policy. This wraps the official claude CLI; it does not extract tokens or bypass auth.

Requirements

  • A Claude Max subscription
  • Node.js 20+
  • Claude Code CLI, installed and logged in:
    npm install -g @anthropic-ai/claude-code
    claude          # log in once, interactively

Run it

Install from npm (quickest):

npm install -g @readtt/claude-max-api-proxy
claude-max-api            # starts on http://localhost:3456

To use a different port: claude-max-api 8080.

Or run from source:

git clone https://github.com/Readtt/claude-max-api-proxy.git
cd claude-max-api-proxy
npm install
npm run serve     # builds, then starts on http://localhost:3456

Either way, quick check:

curl http://localhost:3456/v1/models

Use it

Point any OpenAI client at http://localhost:3456/v1.

curl -X POST http://localhost:3456/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-opus-4-8","messages":[{"role":"user","content":"Hello!"}]}'

Add "stream": true for SSE token streaming.

Python (OpenAI SDK):

from openai import OpenAI
client = OpenAI(base_url="http://localhost:3456/v1", api_key="not-needed")
client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Hello!"}],
)

Continue.dev / Cursor: add a model with provider: openai, apiBase: http://localhost:3456/v1, any apiKey.

Models

Two ways to choose a model, so you never have to update the proxy for new releases:

  • Latest in a family — use a bare alias: opus, sonnet, or haiku (also matched in any name, e.g. claude-opus-4 → latest Opus).
  • Pin a specific version — use the full ID and it's passed straight to the CLI: claude-opus-4-7, claude-sonnet-4-5-20250929, etc. Availability depends on your subscription.

Provider prefixes are fine too: anthropic/..., claude-max/..., claude-code-cli/.... Unknown names default to the latest Opus.

GET /v1/models lists the three family aliases (always the latest), so it never goes stale. To also advertise specific pinned IDs (e.g. for a UI model picker), set CLAUDE_PROXY_MODELS=claude-opus-4-8,claude-sonnet-4-6.

OpenAI compatibility

Use it as a drop-in OpenAI endpoint: chat, streaming, function/tool calling, JSON mode (response_format), image input/vision (image_url), and reasoning_effort all work. Sampling params like temperature and max_tokens are accepted but ignored (the CLI can't honor them), and embeddings/image-generation/audio aren't available. Full matrix: COMPATIBILITY.md.

Endpoints

| Endpoint | Description | |----------|-------------| | POST /v1/chat/completions | Chat (streaming + non-streaming) | | GET /v1/models | List models | | GET /v1/models/{id} | Retrieve a single model | | GET /v1/usage, GET /v1/usage/recent | Token usage + estimated savings | | GET /health | Health check |

Optional: API key auth

For shared/team use, require a Bearer token:

API_KEYS=sk-team-abc,sk-team-def npm run serve

Clients then send Authorization: Bearer sk-team-abc. Unset = no auth.

Configuration

All optional, set as environment variables:

| Variable | Default | Purpose | |----------|---------|---------| | API_KEYS | (unset) | Comma-separated Bearer tokens to require (see above). | | CLAUDE_PROXY_MODELS | (unset) | Extra pinned model IDs to list in /v1/models. | | SYSTEM_PROMPT_MODE | replace | replace = your system prompt fully defines the persona (neutral, OpenAI-like). append = add it on top of Claude Code's default prompt. | | LOG_LEVEL | info | error, warn, info, or debug. info logs each request/response (model, duration, tokens); debug adds per-chunk subprocess detail. | | DEBUG | (unset) | Legacy alias — any value forces LOG_LEVEL=debug. |

Notes

  • Prompts go to the CLI via stdin, and the system prompt via a temp file — neither touches the command line, so large requests (e.g. code-review diffs + tool definitions) don't hit the OS argument-length limit (~32 KB on Windows / E2BIG elsewhere).
  • See ARCHITECTURE.md for how it works and PROTOCOL.md for the request/response mapping.

License

MIT