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

codex-cursor

v0.0.2

Published

Local OpenAI-compatible proxy that routes Cursor IDE traffic to your ChatGPT/Codex subscription via the codex CLI tokens.

Readme

codex-cursor

Local OpenAI-compatible HTTP proxy that lets Cursor (or anything else that speaks the OpenAI Chat Completions API) consume your ChatGPT/Codex subscription instead of a metered OpenAI API key.

It reuses the access tokens that the codex CLI stores in ~/.codex/auth.json and translates Cursor's /v1/chat/completions traffic to the ChatGPT backend's Responses API.

Calls a private ChatGPT/Codex backend with the same credentials and limits as the codex CLI. Personal use only.

Prerequisites

  1. bun installed.
  2. The codex CLI installed and signed in (codex login), so ~/.codex/auth.json exists.

Run it

# one-shot, no install:
bunx codex-cursor --api-key "$(openssl rand -hex 16)"

# or from a clone:
bun install
bun run src/index.ts --api-key "$(openssl rand -hex 16)"

Flags / env vars:

| Flag | Env var | Default | | ------------------------ | ----------------------------- | --------------------- | | --host <addr> | CODEX_SUB_HOST | 127.0.0.1 | | --port <n> | CODEX_SUB_PORT | 4141 | | --api-key <secret> | CODEX_SUB_API_KEY | no auth required | | --auth-path <path> | CODEX_SUB_AUTH_PATH | ~/.codex/auth.json | | --reasoning-effort lvl | CODEX_SUB_REASONING_EFFORT | xhigh (minimal, low, medium, high, xhigh) | | --quiet / --verbose / --log-level lvl | CODEX_SUB_LOG_LEVEL | info (quiet, info, verbose) |

Always set --api-key when exposing the proxy via a tunnel — the public URL is otherwise an open Codex-subscription faucet.

Expose it to Cursor

Cursor's chat runs on Cursor's cloud backend, which calls your custom base URL. It refuses private addresses, so http://127.0.0.1:4141/v1 will fail with Access to private networks is forbidden.

Use a Cloudflare quick tunnel:

brew install cloudflared

# terminal A:
bunx codex-cursor --api-key "$(openssl rand -hex 16)"

# terminal B:
cloudflared tunnel --url http://127.0.0.1:4141

cloudflared prints a https://random-words.trycloudflare.com URL.

Point Cursor at it

  1. Cursor → Settings → Models → "OpenAI API Key" panel
  2. Toggle Override OpenAI Base URL and set:
    • Base URL: https://<your-tunnel>.trycloudflare.com/v1
    • API Key: the hex string you passed to --api-key.
  3. Click Verify.
  4. In the model picker, add a custom model. Working slugs: gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.3-codex, gpt-5.3-codex-spark. The exact list is returned by GET /v1/models.

Caveats

  • The proxy issues stateless single-turn calls; Cursor's full history is sent every time.
  • If codex logout invalidates your refresh token, the proxy fails with refresh_token_expired until you codex login again.