Skip to content

OpenAI Codex

If you have a ChatGPT Plus or ChatGPT Pro subscription, you can connect it directly to Evonic. No API keys, no per-token billing — just your existing subscription.

Instead of the usual API key approach, Codex uses a secure OAuth 2.0 + PKCE flow. You’ll set up Codex as a provider just like any other model provider — the only difference is that you authorize it through your OpenAI account instead of pasting an API key.

Here’s the overall flow:

  1. Create a provider — add a new provider with API Format set to “Codex (OAuth)”
  2. Connect — click Connect on the provider card to authorize via your OpenAI account
  3. Fetch models — after connecting, fetch the list of available models from your subscription

Your data still flows through Evonic — OpenAI never sees it directly. The subscription gives you access to models like gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna with no per-token charges.

  • An active ChatGPT Plus ($20/month) or ChatGPT Pro ($200/month) subscription
  • Evonic running and accessible in your browser
  • Internet connection (authentication requires reaching auth.openai.com)

Setting up Codex is a three-step process: create the provider, authorize it, then fetch your models.

Navigate to Settings → Models and click Add Provider. Fill in the provider form:

FieldValue
Display NameOpenAI Codex (or any name you prefer)
TypeRemote
Base URLhttps://chatgpt.com/backend-api/codex
API KeyLeave empty — OAuth will fill this in
API FormatCodex (OAuth)

Click Save Provider. A new provider card appears in the models grid with Connect and Fetch Models buttons.

On the provider card, click the green Connect button. A popup window opens, redirecting you to OpenAI’s login page. Log in with your OpenAI account and approve the connection. OpenAI will ask you to confirm that Evonic can access your subscription.

Once authorized, Evonic exchanges the authorization code for secure tokens automatically. The provider card shows a green dot when connected.

After connecting, click the Fetch Models button on the provider card. Evonic queries the Codex endpoint and lists all models available under your subscription. From the results, you can quickly add any model with one click.

That’s it! Your Codex models are now ready to use — assign them to any agent like you would with any other model provider.

The models available depend on your subscription tier. After clicking Fetch Models, you’ll see a list of what’s available:

SubscriptionTypical Models
ChatGPT Plusgpt-5.6-sol, gpt-5.6-terra
ChatGPT Progpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, plus extended context windows

If the API doesn’t return a model list, Evonic falls back to these defaults so you can still add them manually.

Once connected and models are fetched, Codex models appear in the model dropdown when you create or edit an agent. Here’s how it looks in your configuration:

model:
provider: openai-codex
model_name: gpt-5.6-sol

The provider field matches the provider name you chose when creating it. The model_name is the model ID shown in the Fetch Models result.

From the CLI, you can verify the connection:

Terminal window
evonic model list

Example output:

ID Name Provider Status
--------------------------------------------------------------------------
a1b2c3d4-... GPT-5.6 Sol openai-codex enabled
e5f6g7h8-... GPT-5.6 Terra openai-codex enabled

The Codex card in Settings → Models shows a green indicator when connected. Click it to see token expiry details.

Tokens expire periodically. Evonic refreshes them automatically in the background. If the refresh fails — for example, if you changed your OpenAI password — just click Connect again to re-authorize.

To remove the connection, click Disconnect on the Codex card. This deletes all stored tokens and removes Codex models from your agent configuration. You can reconnect at any time.

FeatureStandard APICodex (Subscription)
AuthenticationAPI key (sk-...)OAuth 2.0 login
BillingPer-tokenIncluded in subscription
Endpointapi.openai.com/v1chatgpt.com/backend-api/codex
API formatChat CompletionsResponses API
StreamingSSEWebSocket (SSE fallback)
SetupPaste API keyOne-click OAuth

For most users, Codex is the simpler option — no need to manage API keys or monitor token usage.

”Connection Failed” after clicking Connect

Section titled “”Connection Failed” after clicking Connect”
  • Make sure your browser allows popups from Evonic
  • Check that auth.openai.com is reachable from your network
  • Verify your ChatGPT subscription is active at chatgpt.com/account
  • Make sure you clicked Fetch Models after connecting — models are not auto-discovered
  • Check that your subscription is active at chatgpt.com/account
  • If the API returns an empty list, try adding models manually using the fallback names (e.g., gpt-5.6-sol)
  • Tokens refresh automatically; the warning appears when the refresh window is closing
  • If the warning persists for more than a few minutes, re-authorize by clicking Connect again

Codex uses WebSocket transport with SSE fallback. If responses feel slow:

  • Ensure your network connection is stable
  • Check that WebSocket connections aren’t blocked by a firewall or proxy
  • The first request after a period of inactivity may have slightly higher latency