Agent Setup

Codex Desktop & CLI

Quick answer
Prism registers itself as a Codex model provider and generates a catalog JSON that Codex reads, so your Prism models appear in Codex's own model picker with real context windows, truncation policy and reasoning levels. It configures the provider and catalog only — which model Codex runs stays your choice.

Last updated Reviewed against Prism v0.3.26

One-click setup

1

Open the Agents tab

In the Admin UI, select Agents. Codex appears when ~/.codex/config.toml exists.
2

Click Setup

Prism writes two managed blocks into the config file and generates the catalog JSON beside Prism's own config.
3

Restart Codex

Codex reads its provider and catalog at startup. Restart Codex Desktop or the CLI.
4

Pick a model

Your Prism models now appear in Codex's model list, marked as running through Prism.

What Prism writes

Two managed blocks go into ~/.codex/config.toml, tagged with begin and end markers so they can be replaced cleanly on re-sync:

# >>> prism-managed >>>
[model_providers.prism]
name = "Prism"
base_url = "http://127.0.0.1:11434/v1"
wire_api = "responses"
experimental_bearer_token = "prism"
request_max_retries = 3
stream_max_retries = 3
stream_idle_timeout_ms = 600000
# <<< prism-managed <<<
# >>> prism-managed >>>
model_provider = "prism"
model_catalog_json = "C:\\Users\\you\\AppData\\Roaming\\prism\\codex_catalog.json"
# <<< prism-managed <<<
Codex always speaks Responses
Codex uses wire_api = "responses", so Prism receives Responses events and translates them to whichever protocol your chosen model needs. You do not need a Codex OAuth account for this — any Prism model works.

The generated catalog

For every model in your catalog Prism emits a full Codex model entry. Codex uses these fields to drive its UI and its own context management, so a wrong context window shows up as premature compaction.

Derived fieldValue
slug and display_nameFrom your model's route key and display name.
context_window / max_context_windowThe model's configured context length, defaulting to 128000.
auto_compact_token_limit80% of the context window, floored at 8000.
truncation_policyToken mode at 32% of the context window, capped at 64000.
supported_reasoning_levelslow, medium, high, xhigh — default medium.
input_modalitiestext, plus image when the model reports vision support.
apply_patch_tool_typefreeform, so Codex emits V4A-format patches.
base_instructionsA prompt describing Prism and the V4A patch format.

Where the catalog lives

PlatformCatalog path
Windows%APPDATA%\prism\codex_catalog.json
macOS~/Library/Application Support/prism/codex_catalog.json
Linux$XDG_CONFIG_HOME/prism/codex_catalog.json

The catalog is regenerated whenever your models change. Deleting it and re-syncing from the Agents tab rebuilds it from scratch.

Re-syncing after adding a model

Add or remove a model in the Models tab and Prism rewrites both the config blocks and the catalog automatically when auto-sync is on. With auto-sync off, click re-sync in the Agents tab, then restart Codex.

Your top-level model key is preserved
Prism deliberately does not write the top-level model key. If an older Prism version removed it, the current writer puts it back in the body of the file so you can see and change it.

Add MCP servers

Codex is one of the two agents (along with Grok Build) whose MCP entries live in a TOML file, so Prism uses a dedicated writer for it. Enabling Codex in the MCP tab's Agent access panel adds the gateway to ~/.codex/config.toml. See MCP Gateway.