codexfast icon indicating copy to clipboard operation
codexfast copied to clipboard

Pinned: Use OAuth Login Mode for Custom API instead of codexfast

Open Veath opened this issue 3 months ago • 0 comments

Recommendation: use OAuth Login Mode for Custom API instead of codexfast when you want ChatGPT OAuth with a custom API.

This mode does not require codexfast launch or manual edits to ~/.codex/auth.json. It is usually simpler and less sensitive to Codex build changes.

Why use OAuth Login Mode

codexfast is a macOS runtime launcher for verified Codex builds. It applies narrow in-memory patches for some custom API feature gates. It is not a backend proxy and does not provide an API.

If you only need ChatGPT OAuth sign-in, custom API routing, and the official Codex feature path, requires_openai_auth = true is usually enough.

Prerequisites

  1. Codex CLI or Codex.app is installed.
  2. You have a ChatGPT account for OAuth sign-in. A free account can be used.
  3. A custom API service compatible with the OpenAI Responses API is running. This example uses CLIProxyAPI at http://127.0.0.1:8317/v1.
  4. Your custom API service has an API key for Codex. sk-dummy below is only a placeholder.

OAuth controls the official Codex login state. Model requests are still sent to the configured custom provider.

Setup tutorial

1. Edit config.toml

Open ~/.codex/config.toml and save:

model = "gpt-5.6-sol" # Or gpt-5.6-terra, gpt-5.6-luna, or another supported model
model_provider = "custom"

# Keep these disabled unless you understand the risks.
# approval_policy = "never"
# sandbox_mode = "danger-full-access"

model_reasoning_effort = "xhigh"
plan_mode_reasoning_effort = "xhigh"

# Only needed for Codex.app voice chat. Remove if unused.
experimental_realtime_webrtc_call_base_url = "http://127.0.0.1:8317/v1"
experimental_realtime_ws_base_url = "http://127.0.0.1:8317/v1"

[model_providers.custom]
base_url = "http://127.0.0.1:8317/v1"
experimental_bearer_token = "sk-dummy" # Replace with your CLIProxyAPI Codex API key
name = "OpenAI"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = true

Change the host or port in base_url and the realtime URLs when needed. Remove realtime settings if voice chat is not used.

2. Sign in to Codex

Start Codex CLI or Codex.app and complete the official ChatGPT OAuth sign-in flow. Do not edit ~/.codex/auth.json manually.

Optional CLI check:

codex --version

Then send a simple message.

3. Verify the setup

Confirm that Codex shows your ChatGPT account, the custom API service logs the request, and the selected model such as gpt-5.6-sol is accepted.

For model not found or request-format errors, check model mapping, Responses API support, and base_url first. Reinstalling codexfast will not fix a provider-side incompatibility.

FAQ

Can I use an API key without ChatGPT OAuth?

Yes, but pure API login mode may hide or disable official Codex capabilities. This guide uses requires_openai_auth = true to keep OAuth login while routing model requests through the custom provider.

Does OAuth mode make every model and feature available?

No. It does not change the custom API service or make Codex merge arbitrary /v1/models responses into the UI catalog. The model must be recognized by the current build and supported by the provider.

When should I still use codexfast?

Only on a verified compatible build when you specifically need an extra runtime patch, such as an older build Fast, Speed, or GPT-5.x UI compatibility path:

npx codexfast launch

Keep the codexfast launch process running while using Codex. Unknown or non-whitelisted builds are blocked.

How do I roll back?

Remove or comment out model_provider = "custom", the custom model, and the [model_providers.custom] section in ~/.codex/config.toml, then restart Codex. This mode does not modify the app bundle, signature, or auth.json.

Security notes

  • Never post a real API key, OAuth token, or auth.json contents in an issue, repository, or screenshot.
  • approval_policy = "never" and sandbox_mode = "danger-full-access" reduce safety boundaries; keep them commented out by default.
  • Connect only to custom API services you trust and review their logging, retention, and forwarding policies.
  • This issue is a configuration guide, not a compatibility guarantee for third-party custom APIs, CLIProxyAPI, or future Codex builds.

For further help, open a separate issue with the Codex version, OS version, a redacted configuration snippet, and the error message. Do not include API keys, OAuth tokens, or the complete auth.json file.

Veath avatar Aug 14 '26 04:08 Veath