◉ Pulse
Keksuccino avatar
#35 today ▲ 48

Keksuccino/Better-Codex-App-Custom-Provider-Support

Python AI #agent #agentic-ai #chatgpt #chatgpt-app

Adds support for selecting a custom model provider to use for a thread/chat, without logging out of your ChatGPT account.

Created Jul 18, 2026
Stars
22
Today
+3
Forks
4
Quality
100/100
Momentum
40

README

Fetched from GitHub on Oct 30, 2026, 10:15 PM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to Keksuccino/Better-Codex-App-Custom-Provider-Support and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

Better Codex App Custom Provider Support

An unofficial patch for the macOS ChatGPT/Codex desktop app that adds per-task model-provider selection without requiring you to sign out of your ChatGPT account.

The patch:

  • Adds a provider section to the model menu.
  • Sends the selected provider when a new task starts.
  • Maps model IDs to providers automatically.
  • Keeps tasks from all configured providers visible.
  • Keeps the normal ChatGPT login active for OpenAI models.

This project currently supports macOS only.

Caution

Changing the provider in a running conversation/thread does not work. The conversation/thread continues using the provider it started with.


Requirements

  • macOS
  • ChatGPT installed at /Applications/ChatGPT.app
  • Python 3.9 or newer
  • Node.js with npx

Install





  1. Click on the patch_chatgpt_providers.py file in the repository.
  2. Open the menu in the top-right.
  3. Click on Download.
  4. Run the downloaded script:
python3 patch_chatgpt_providers.py

The installer closes processes belonging to the target app, creates a complete backup, patches app.asar, updates Electron's ASAR integrity metadata, and applies an ad-hoc signature.

Run python3 patch_chatgpt_providers.py --help to see alternate app, config, and backup paths.

Configure a custom provider

Custom Codex providers belong in ~/.codex/config.toml. Provider IDs such as openrouter are referenced by the patch configuration later.

Example OpenRouter provider:

[model_providers.openrouter]
name = "OpenRouter"
base_url = "https://openrouter.ai/api/v1"
wire_api = "responses"

[model_providers.openrouter.auth]
command = "/usr/bin/security"
args = ["find-generic-password", "-a", "YOUR_MACOS_USERNAME", "-s", "Codex OpenRouter API Key", "-w"]
timeout_ms = 5000
refresh_interval_ms = 0

Replace YOUR_MACOS_USERNAME, then add or update the API key in macOS Keychain. The command prompts for the key instead of placing it in shell history:

security add-generic-password -U -a "$USER" -s "Codex OpenRouter API Key" -w

Codex also supports environment-variable authentication with env_key. Do not combine env_key with a [model_providers.<id>.auth] section. For all authentication methods and provider options, see the Codex custom model provider documentation.

Do not set a global model_provider if OpenAI and custom providers should coexist in the desktop app. The patch selects the provider when each new task starts.

Add custom models to Codex

Codex loads custom model metadata from the file configured by model_catalog_json.

  1. Export the bundled catalog as a starting point:

    mkdir -p ~/.codex/model-catalogs
    codex debug models --bundled > ~/.codex/model-catalogs/custom.json
  2. Add model objects to the top-level models array. Copy an existing entry with similar capabilities, then update its model ID, display name, context window, modalities, reasoning levels, and tool support.

    The model ID is the slug value. It must match the model ID expected by the provider, for example:

    {
      "slug": "moonshotai/kimi-k3",
      "display_name": "Kimi K3 (OpenRouter)",
      "description": "MoonshotAI Kimi K3 through OpenRouter."
    }

    Keep the remaining required fields from the copied entry and adjust them to the model's real capabilities. Do not advertise unsupported tools, modalities, or context-window sizes.

  3. Point Codex at the catalog in ~/.codex/config.toml:

    model_catalog_json = "/Users/your-name/.codex/model-catalogs/custom.json"
  4. Restart the app after changing model_catalog_json or the model catalog.

Use codex debug models to inspect the effective catalog Codex sees.

Configure the patched provider menu

The installer creates:

~/.codex/desktop-model-providers.json

Example:

{
  "version": 1,
  "default_provider": "openai",
  "providers": [
    {
      "id": "openai",
      "label": "ChatGPT / OpenAI",
      "description": "Uses your signed-in ChatGPT account"
    },
    {
      "id": "openrouter",
      "label": "OpenRouter",
      "description": "Uses [model_providers.openrouter] from config.toml"
    }
  ],
  "model_providers": {
    "moonshotai/kimi-k3": "openrouter",
    "x-ai/grok-4.5": "openrouter",
    "anthropic/claude-fable-5": "openrouter"
  }
}
  • providers defines the providers displayed in the app menu.
  • model_providers maps exact model slugs to provider IDs for Automatic mode.
  • default_provider handles models without an explicit mapping.
  • Every custom provider ID must match a [model_providers.<id>] section in config.toml.
  • API keys do not belong in this JSON file.

The app reloads this file when the provider menu opens and before a new task starts. Repatching is not required after editing it.

Updates and recovery

ChatGPT updates replace the patch. Run the installer again after an update.

The installer is not tied to a fixed app version or archive hash. It patches compatible source structures and stops before modifying the installed app if an update changes the relevant code.

Backups are stored by default in:

~/Applications/ChatGPT Patch Backups/

Disclaimer

Use this script entirely at your own risk. It modifies the installed ChatGPT application in an unofficial and unsupported way.

The author and contributors provide no warranty and accept no responsibility or liability for any problems, damage, or loss caused directly or indirectly by using this script. This includes, but is not limited to, lost or corrupted chat history or other data, an unusable or "bricked" application, account warnings or restrictions, account suspension or banning, security or privacy issues, and any other direct or consequential damage.

Create and verify your own backups before running the script.


This is an unofficial modification and is not affiliated with or supported by OpenAI.

Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 19, 2026

first spotted on the list

Best rank

#19

highest position reached

Appearances

3

times on the trending list

Quality score

100

out of 100

Momentum

40

trend strength indicator

Star velocity

0.21

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot
141618202224Keksuccino/Better-Codex-App-Custom-Provider-Support · Jul 19, 8 AM UTC: 16 starsKeksuccino/Better-Codex-App-Custom-Provider-Support · Jul 19, 1 PM UTC: 19 starsKeksuccino/Better-Codex-App-Custom-Provider-Support · Jul 19, 7 PM UTC: 22 stars8 AM1 PM7 PM

Rank history

position on trending · lower is better
#1#10#20#30#40#50#60Jul 19, 8 AM UTC: rank #19Jul 19, 1 PM UTC: rank #59Jul 19, 7 PM UTC: rank #358 AM1 PM7 PM

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/Keksuccino/Better-Codex-App-Custom-Provider-Support" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="Keksuccino/Better-Codex-App-Custom-Provider-Support — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

Keksuccino/Better-Codex-App-Custom-Provider-Support stars badge
Markdown
[![Keksuccino/Better-Codex-App-Custom-Provider-Support](https://www.notionpulse.cc/api/badge/Keksuccino/Better-Codex-App-Custom-Provider-Support.svg)](https://www.notionpulse.cc/repo/Keksuccino/Better-Codex-App-Custom-Provider-Support)
HTML
<a href="https://www.notionpulse.cc/repo/Keksuccino/Better-Codex-App-Custom-Provider-Support"><img src="https://www.notionpulse.cc/api/badge/Keksuccino/Better-Codex-App-Custom-Provider-Support.svg" alt="Keksuccino/Better-Codex-App-Custom-Provider-Support stars badge" /></a>

Repository of the Day

#19 Repository of the Day

Repository of the Week

#19 Repository of the Week

Repository of the Month

#19 Repository of the Month