English
  • 中文
  • English
English
  • 中文
  • English
官网
服务状态
English
  • 中文
  • English
  1. Text Models
  • Quickstart & Conventions
  • Images
    • GPT Image 2 / 2.5 / 2.6 Generation & Editing
    • Nano Banana Image Generation
    • Gemini Native Sync Image Generation
    • Seedream 5.0 Pro / 5.5 Image Generation
    • Midjourney Image Generation
  • Videos
    • Seedance 2 Video Generation
    • Omni Video Generation
    • Seedance 2.5 Video Generation
    • MiniMax H3 Video Generation
    • WAN 3.0 Video Generation
    • Muse Video Generation
    • Seedance Asset Registration
    • Gemini Omni 1.2 Flash Video Generation
    • Seedance Volcengine Native Video Generation
    • MAGI-2 Video Generation
  • Text Models
    • Claude Desktop (CC Switch) Setup Guide
    • Codex in ChatGPT Desktop Setup Guide
    • Gemini Text Models (Native Format)
    • Text & Chat APIs (OpenAI / Claude)
  • Audio
    • Gemini Text-to-Speech (TTS)
  1. Text Models

Codex in ChatGPT Desktop Setup Guide

OpenAI has merged the standalone Codex desktop app into ChatGPT Desktop. This guide covers configuring Codex inside ChatGPT Desktop on macOS and Windows: ChatGPT Desktop retains your ChatGPT OAuth login while sending model inference requests through your Brioi API key.

Prerequisites#

Make sure you have the following ready:
ChatGPT Desktop installed with access to Codex
An active ChatGPT account
An API key created on the Brioi API Keys page (recommended groups: GPT | Pro, GPT | 特价 (discounted GPT), GPT | Official, or auto)

1. Sign In via ChatGPT OAuth#

Open ChatGPT Desktop, follow the prompt to sign in, and complete authorization in your browser. Return to the desktop app and confirm your account menu shows you as signed in.

2. Set the API Key Environment Variable#

Codex reads your Brioi API key from the BRIOI_API_KEY environment variable. Desktop GUI applications only read OS/session-level environment variables—a temporary export inside a terminal session will not take effect.
Windows: Run the command below in PowerShell, then completely quit and reopen ChatGPT Desktop.
setx BRIOI_API_KEY "YOUR_API_KEY"
macOS: Run the command below in Terminal, then completely quit and reopen ChatGPT Desktop. Note that launchctl setenv clears after rebooting macOS—re-run it after a restart, or add a LaunchAgent under ~/Library/LaunchAgents/ to apply it automatically at login.

3. Configure config.toml#

Configuration is identical on macOS and Windows. In ChatGPT Desktop, open Settings → Configuration → Open config.toml and add or merge the following:
model = "gpt-6-astra"
model_provider = "brioi"

[model_providers.brioi]
name = "Brioi"
base_url = "https://vip.brioi.com/v1"
wire_api = "responses"
env_key = "BRIOI_API_KEY"
supports_websockets = false
You can change model to any primary GPT model available to your key (such as gpt-6.2-sol, gpt-6.1-sol, gpt-6.2-astra, or gpt-6-astra, according to GET /v1/models). base_url must end with /v1 (with /v1 included only once). Save the file, then completely quit and reopen ChatGPT Desktop.

4. Verify the Integration#

1.
Confirm in the desktop app's account menu that ChatGPT OAuth remains signed in.
2.
Create a new task and send a minimal test prompt:
Reply with only BRIOI_CODEX_OK
3.
Check the request logs page in the Brioi console to verify that the request arrived.

Troubleshooting#

Desktop app returns 401 or API_KEY_REQUIRED#

Verify env_key is set to BRIOI_API_KEY.
Confirm BRIOI_API_KEY was set as a system/session environment variable per Step 2, and that ChatGPT Desktop was completely quit and reopened afterward.
Confirm base_url is exactly https://vip.brioi.com/v1.
Verify that the API key is enabled, has a positive balance, and belongs to a group that includes the target model.
Remove or disable requires_openai_auth = true under [model_providers.brioi].

OAuth sign-in succeeds, but model requests do not route through Brioi#

Check that model_provider is set to brioi and env_key is BRIOI_API_KEY. After saving config.toml, you must completely quit and reopen the desktop app.

Security Reminders#

Never share ChatGPT OAuth tokens, API keys, or auth.json in group chats, screenshots, repositories, or public logs.
If you suspect an API key has been exposed, disable and regenerate it immediately on the API key management page.
Modified at 2026-12-04 07:58:01
Previous
Claude Desktop (CC Switch) Setup Guide
Next
Gemini Text Models (Native Format)
Built with