Skip to content

Configuration Reference

opencodex is configured by ~/.opencodex/config.json. It’s written by ocx init and the dashboard, but you can edit it directly; the proxy reloads it on start. Missing or invalid files fall back to a default (a single openai forward provider).

FieldTypeDefaultMeaning
portnumber10100Port the proxy listens on.
providersRecord<string, OcxProviderConfig>Map of provider name → config.
defaultProviderstring"openai"Provider used when routing finds no better match.
subagentModels?string[]Up to 5 provider/model ids featured first in Codex’s subagent picker.
disabledModels?string[]Routed provider/model ids hidden from Codex (excluded from the catalog and /v1/models).
websockets?booleanfalseAdvertise supports_websockets so Codex uses the Responses WebSocket path. Omit or set false to keep HTTP/SSE.
modelCacheTtlMs?number300000Freshness window for the per-provider /models cache (5 min).
webSearchSidecar?OcxWebSearchSidecarConfigonWeb-search sidecar options (see below).
visionSidecar?OcxVisionSidecarConfigonVision sidecar options (see below).
FieldTypeMeaning
adapterstringOne of openai-chat, openai-responses, anthropic, google, azure.
baseUrlstringUpstream API base URL.
apiKey?stringAPI key, or an ${ENV_VAR} / $ENV_VAR reference resolved at request time.
defaultModel?stringModel used when this provider is selected without an explicit model.
models?string[]Seed/fallback model list (live /models is preferred when reachable).
headers?Record<string,string>Extra HTTP headers sent upstream.
authMode?"key" | "forward" | "oauth"How to authenticate (default key). See Providers.
noReasoningModels?string[]Models that reject a reasoning/thinking param — the adapter drops reasoning_effort for them.
noVisionModels?string[]Text-only models — the vision sidecar describes images for them. Matching tolerates an Ollama :size tag.

webSearchSidecar (OcxWebSearchSidecarConfig)

Section titled “webSearchSidecar (OcxWebSearchSidecarConfig)”
FieldTypeDefaultMeaning
enabled?booleanon when a forward provider + login existMaster switch.
model?stringgpt-5.4-miniThe sidecar model running real web_search (must be a native ChatGPT model).
reasoning?stringlowReasoning effort for the sidecar (minimal is rejected with web search).
maxSearchesPerTurn?number3Total real searches per main-model turn (loop guard).
timeoutMs?number30000Sidecar fetch timeout.
FieldTypeDefaultMeaning
enabled?booleanon when a forward provider + login existMaster switch.
model?stringgpt-5.4-miniVision model that describes images (must accept image input).
timeoutMs?number45000Sidecar fetch timeout.
{
"port": 10100,
"defaultProvider": "openai",
"providers": {
"openai": {
"adapter": "openai-responses",
"baseUrl": "https://chatgpt.com/backend-api/codex",
"authMode": "forward"
},
"anthropic": {
"adapter": "anthropic",
"baseUrl": "https://api.anthropic.com",
"authMode": "oauth",
"defaultModel": "claude-sonnet-4-6"
},
"ollama-cloud": {
"adapter": "openai-chat",
"baseUrl": "https://ollama.com/v1",
"apiKey": "${OLLAMA_API_KEY}",
"defaultModel": "glm-5.2",
"noVisionModels": ["glm-5.2", "gpt-oss", "qwen3-coder", "deepseek-v4-pro"]
}
},
"subagentModels": ["anthropic/claude-opus-4-8", "ollama-cloud/glm-5.2"],
"disabledModels": [],
"websockets": false,
"webSearchSidecar": { "maxSearchesPerTurn": 3 },
"visionSidecar": { "enabled": true }
}