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

posit-codex-gateway

v0.1.0

Published

Unofficial local gateway from RStudio Posit Assistant to ChatGPT/Codex OAuth

Readme

posit-codex-gateway

Love Codex models, hate API prices? ☀️ 🌍 🌙 Use your existing ChatGPT/Codex subscription sign-in with RStudio Posit Assistant.

posit-codex-gateway is a small local bridge between RStudio and the published @carl-stone/openai-oauth runtime. It signs in with your ChatGPT account and adjusts Posit Assistant requests so they work with the Codex Responses service.

Unofficial community project. This project is not affiliated with, endorsed by, or supported by Posit or OpenAI.

Before you start

You need:

  • Node.js 20 or newer;
  • RStudio with Posit Assistant 0.9.8 (RStudio protocol 11.0); and
  • a ChatGPT/Codex Plus or Pro subscription.

This gateway uses your ChatGPT/Codex sign-in. You do not need an OpenAI API key.

Quick start

With Node.js installed, run these commands in a Terminal window:

npm install --global posit-codex-gateway
posit-codex-gateway login
posit-codex-gateway

The last command keeps the gateway running in the foreground. Leave that Terminal window open while you use Posit Assistant.

Or, to run it in the background instead, use:

posit-codex-gateway --detach

Connect Posit Assistant

In the Posit Assistant pane in RStudio, select the gear > Configure LLM providers > OpenAI. Change the Base URL and API key to:

| Setting | Value | | --- | --- | | Base URL | http://127.0.0.1:10532/v1 | | API key | Leave empty |

The gateway supplies all models available through your ChatGPT/Codex account.

Start, check, and stop the gateway

These commands are useful when the gateway is running in the background:

posit-codex-gateway status
posit-codex-gateway logs --follow
posit-codex-gateway stop

Run posit-codex-gateway again to start it in the foreground after stopping it. The default port is 10532, which matches the Posit Assistant URL above. You can choose another port with, for example, --port 10533; if you do, change the provider's base URL to match.

What you need to know

The gateway connects Posit Assistant to your ChatGPT/Codex session and handles the request-format differences automatically. There is nothing special to configure in Posit Assistant beyond the local base URL shown above.

Messages, images, reasoning, tools, tool calls and results, and streaming responses are supported. The gateway keeps a temporary, in-memory record of recent Responses items so Posit Assistant can continue after a tool call. This record is not written to disk and disappears when the gateway stops.

Sign-in, model discovery, chat and image requests, OAuth refresh, and the connection to ChatGPT/Codex are provided by the published OAuth runtime.

Supported versions

| Gateway | Posit Assistant | RStudio protocol | OAuth runtime | Responses adapter | | --- | --- | --- | --- | --- | | 0.1.x | 0.9.8 | 11.0 | @carl-stone/openai-oauth 2.0.0-memory.2 | v1 |

The project checks that its requests still match Codex automatically in CI.

Troubleshooting

Run the read-only diagnostic report with:

posit-codex-gateway doctor

It reports the installed gateway, Posit Assistant, and openai-oauth versions and whether the local gateway is healthy. It does not read conversations or credentials.

Common fixes:

  • RStudio cannot connect: make sure the gateway is running and the base URL is exactly http://127.0.0.1:10532/v1.
  • The port is busy: stop the other process, or start with posit-codex-gateway --port <number> and update the base URL.
  • Sign-in fails: run posit-codex-gateway login again, then restart the gateway.
  • A conversation fails after restarting the gateway: start a new Posit Assistant conversation. Temporary tool-continuation state is cleared when the gateway stops.
  • The background gateway isn't working: run status, inspect logs, then use stop before starting it again.

Privacy and network behavior

By default, the gateway listens only on your computer at 127.0.0.1. It uses the same host behavior as openai-oauth; an explicit --host can make it reachable from other interfaces, so use that option only when you intend to.

OAuth credentials and upstream transport are handled by the published OAuth runtime. Recent Responses items are held only in the running process, with default limits of 256 response-history entries and 2,000 items. They are never persisted by the gateway and are discarded when it stops or restarts. Diagnostics are off by default. If enabled with --diagnostics, they contain metadata only: request ID, model, schema-only removed-field patterns, cache breakpoint count, status, duration, and safely available token counts. Prompts, conversation content, tool arguments/results, credentials, headers, auth material, and reasoning content are not logged.

Advanced CLI options

The gateway accepts the same public commands and options as its openai-oauth runtime, including login, --host, --port, --models, --codex-version, --base-url, OAuth overrides, --no-open, login timeout, --detach, status, logs, stop, --responses-state, --responses-max-responses, and --responses-max-items.

There are two intentional defaults for Posit Assistant: port 10532 and process-local Responses memory. You can explicitly override either default, although --responses-state stateless will prevent Posit tool-call continuations from working. doctor and --diagnostics are gateway-specific additions.

Development

npm install
npm run verify
npm run check:contract
npm pack --dry-run

CI runs tests, typechecking, linting, and the TypeScript build. A separate scheduled/manual workflow checks for Codex contract drift. Dependabot watches the npm and GitHub Actions dependencies.

Credits and license

This project uses @carl-stone/openai-oauth, a published fork of Evan Zhou's openai-oauth. The dependency ships its own Apache-2.0 license and notice; this repository's required attribution is included in NOTICE.

The original gateway code in this repository is copyright Carl Stone and is licensed under Apache-2.0. See LICENSE.