Codex Desktop & CLI
Last updated Reviewed against Prism v0.3.26
One-click setup
Open the Agents tab
Click Setup
Restart Codex
Pick a model
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 <<<
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 field | Value |
|---|---|
| slug and display_name | From your model's route key and display name. |
| context_window / max_context_window | The model's configured context length, defaulting to 128000. |
| auto_compact_token_limit | 80% of the context window, floored at 8000. |
| truncation_policy | Token mode at 32% of the context window, capped at 64000. |
| supported_reasoning_levels | low, medium, high, xhigh — default medium. |
| input_modalities | text, plus image when the model reports vision support. |
| apply_patch_tool_type | freeform, so Codex emits V4A-format patches. |
| base_instructions | A prompt describing Prism and the V4A patch format. |
Where the catalog lives
| Platform | Catalog 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.
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.
Related
MCP Gateway
Wire Codex up to every MCP server at once.
Agent Integrations
Detection, backups and auto-sync for every supported agent.
Model Remapping
Control what appears in Codex's picker.
Claude Code
The other agent Prism configures in depth.
Troubleshooting
Models missing from the picker.
Guide: Codex custom models
Step-by-step setup with the exact managed blocks Prism writes.