Skip to main content

Connecting in Codex CLI

Codex in alpha testing

What this means:

  • A separate API key is required: a regular Explyt Enterprise Platform key will not work; ask your organization's administrator to request a Codex key from Explyt support
  • A limited set of models is available
  • DLP does not work: the data you send is not checked
  • The connection works only inside Explyt VPC

If the task can be solved with another tool, it is better to choose it: the other connections work without these restrictions — see the list of tools.

  1. Open or create the file ~/.codex/config.toml, where ~ is your home directory

    • If the file already contains settings (the ChatGPT app creates them), do not delete them
  2. Add three lines to the very beginning of the file:

    model = "auto"
    model_provider = "explyt"
    model_catalog_json = "./model-catalog-full.json"
  3. Add the block below to the very end of the same file:

    [model_providers.explyt]
    name = "explyt"
    base_url = "<YOUR_URL>"
    wire_api = "responses"
    requires_openai_auth = true
    • Replace <YOUR_URL> with the OpenAI-compatible URL issued to you
      • If you see these instructions but do not have an OpenAI-compatible URL, contact your organization's administrator
  4. Next to config.toml, create the file model-catalog-full.json with the list of Explyt models

    Download the ready-made model-catalog-full.json file — or copy its contents manually:

    Contents of model-catalog-full.json
    {
    "models": [
    {
    "slug": "auto",
    "id": "auto",
    "display_name": "Explyt Auto",
    "description": "Automatic model selection: high quality with maximum availability",
    "context_window": 372000,
    "max_output_tokens": 32768,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 1,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "low",
    "description": "low"
    },
    {
    "effort": "medium",
    "description": "medium"
    },
    {
    "effort": "high",
    "description": "high"
    },
    {
    "effort": "xhigh",
    "description": "xhigh"
    }
    ]
    },
    {
    "slug": "OpenAI/gpt-5.6-sol",
    "id": "OpenAI/gpt-5.6-sol",
    "display_name": "OpenAI GPT-5.6 Sol",
    "description": "The highest quality among OpenAI models",
    "context_window": 372000,
    "max_output_tokens": 32768,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 2,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "low",
    "description": "low"
    },
    {
    "effort": "medium",
    "description": "medium"
    },
    {
    "effort": "high",
    "description": "high"
    },
    {
    "effort": "xhigh",
    "description": "xhigh"
    }
    ]
    },
    {
    "slug": "OpenAI/gpt-5.6-terra",
    "id": "OpenAI/gpt-5.6-terra",
    "display_name": "OpenAI GPT-5.6 Terra",
    "description": "Balance of quality and speed among OpenAI models",
    "context_window": 372000,
    "max_output_tokens": 32768,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 3,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "low",
    "description": "low"
    },
    {
    "effort": "medium",
    "description": "medium"
    },
    {
    "effort": "high",
    "description": "high"
    },
    {
    "effort": "xhigh",
    "description": "xhigh"
    }
    ]
    },
    {
    "slug": "OpenAI/gpt-5.6-luna",
    "id": "OpenAI/gpt-5.6-luna",
    "display_name": "OpenAI GPT-5.6 Luna",
    "description": "The fastest and cheapest among OpenAI models",
    "context_window": 372000,
    "max_output_tokens": 32768,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 4,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "low",
    "description": "low"
    },
    {
    "effort": "medium",
    "description": "medium"
    },
    {
    "effort": "high",
    "description": "high"
    },
    {
    "effort": "xhigh",
    "description": "xhigh"
    }
    ]
    },
    {
    "slug": "OpenAI/gpt-5.5",
    "id": "OpenAI/gpt-5.5",
    "display_name": "OpenAI GPT-5.5",
    "description": "Previous-generation OpenAI model",
    "context_window": 272000,
    "max_output_tokens": 16384,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 5,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "low",
    "description": "low"
    },
    {
    "effort": "medium",
    "description": "medium"
    },
    {
    "effort": "high",
    "description": "high"
    },
    {
    "effort": "xhigh",
    "description": "xhigh"
    }
    ]
    },
    {
    "slug": "Anthropic/fable-5",
    "id": "Anthropic/fable-5",
    "display_name": "Anthropic Fable 5",
    "description": "The most powerful Anthropic model",
    "context_window": 1000000,
    "max_output_tokens": 128000,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 6,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "low",
    "description": "low"
    },
    {
    "effort": "medium",
    "description": "medium"
    },
    {
    "effort": "high",
    "description": "high"
    },
    {
    "effort": "xhigh",
    "description": "xhigh"
    }
    ]
    },
    {
    "slug": "Anthropic/opus-5",
    "id": "Anthropic/opus-5",
    "display_name": "Anthropic Opus 5",
    "description": "High quality, cheaper than Fable 5",
    "context_window": 1000000,
    "max_output_tokens": 65536,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 7,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "low",
    "description": "low"
    },
    {
    "effort": "medium",
    "description": "medium"
    },
    {
    "effort": "high",
    "description": "high"
    },
    {
    "effort": "xhigh",
    "description": "xhigh"
    }
    ]
    },
    {
    "slug": "Anthropic/sonnet-5",
    "id": "Anthropic/sonnet-5",
    "display_name": "Anthropic Sonnet 5",
    "description": "Balance of quality and speed among Anthropic models",
    "context_window": 1000000,
    "max_output_tokens": 65536,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 8,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "low",
    "description": "low"
    },
    {
    "effort": "medium",
    "description": "medium"
    },
    {
    "effort": "high",
    "description": "high"
    },
    {
    "effort": "xhigh",
    "description": "xhigh"
    }
    ]
    },
    {
    "slug": "Anthropic/haiku-4.5",
    "id": "Anthropic/haiku-4.5",
    "display_name": "Anthropic Haiku 4.5",
    "description": "The fastest and cheapest among Anthropic models",
    "context_window": 264000,
    "max_output_tokens": 64000,
    "base_instructions": "default",
    "shell_type": "default",
    "visibility": "list",
    "supported_in_api": true,
    "priority": 9,
    "support_verbosity": false,
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    },
    "experimental_supported_tools": [],
    "supported_reasoning_levels": [
    {
    "effort": "none",
    "description": "none"
    },
    {
    "effort": "low",
    "description": "low"
    }
    ]
    }
    ]
    }

    To add a model, copy any block and put your own slug value in it.

    • The priority field sets the order in the model picker: the lower the number, the higher the model in the list
    • To get the full list of models, contact your organization's administrator or open <YOUR_URL>/models
    • If the error failed to parse model_catalog_json appears after a Codex update, add the field named in the error message to every model
  5. Open or create the file ~/.codex/auth.json and fill it with the contents below:

    {
    "auth_mode": "apikey",
    "OPENAI_API_KEY": "<YOUR_API_KEY>"
    }
    • Replace <YOUR_API_KEY> with the API key issued to you
      • If you see these instructions but do not have an API key, contact your organization's administrator
    • No OpenAI account is needed: the key is used only for requests to your gateway
    • If you previously signed in through a ChatGPT account, run codex logout and create the file again
  6. Start Codex:

    codex
  7. To choose a model, use /model

    • auto – automatic model selection: high quality with maximum availability
    • OpenAI/gpt-5.6-sol – the highest quality among OpenAI models
    • OpenAI/gpt-5.6-terra – balance of quality and speed among OpenAI models
    • OpenAI/gpt-5.6-luna – the fastest and cheapest among OpenAI models
    • OpenAI/gpt-5.5 – previous-generation OpenAI model
    • Anthropic/fable-5 – the most powerful Anthropic model
    • Anthropic/opus-5 – high quality, cheaper than Fable 5
    • Anthropic/sonnet-5 – balance of quality and speed among Anthropic models
    • Anthropic/haiku-4.5 – the fastest and cheapest among Anthropic models
    • The list shows eight models at a time; scroll down to see the rest
  8. Send any message and make sure the model responds

    • If the error 404 Not Found appears, the key is wrong or revoked: check the contents of ~/.codex/auth.json or contact your organization's administrator to reissue the key
If you use both Codex CLI and the ChatGPT app

They share the config.toml file, and the app can work only with OpenAI models. To keep only the working models in the app while all models stay available in Codex CLI, split the catalogs:

  1. In config.toml, point to the catalog for the app: model_catalog_json = "./model-catalog.json" — and put the model-catalog.json file from the Codex in ChatGPT guide next to it

  2. Keep the full catalog model-catalog-full.json in place as well

  3. Create the file ~/.codex/full.config.toml with a single line:

    model_catalog_json = "./model-catalog-full.json"
  4. Start Codex CLI with this profile:

    codex --profile full

For errors, see Error messages.