Skip to main content
Codex CLI is OpenAI’s open-source terminal coding agent for reading files, editing code, and running commands in local projects. A custom provider connects it to Step Plan models.

Prerequisites

Connection requirements

  • Codex CLI 0.154.0 supports the Responses API with wire_api = "responses". Step Plan exposes /step_plan/v1/responses, so no protocol-conversion proxy is needed. Chat Completions is not supported by this Codex version.
  • User configuration belongs in $CODEX_HOME/config.toml. CODEX_HOME defaults to ~/.codex. Supply the API key through an environment variable or .env in that directory, not in config.toml.
  • Codex’s built-in catalog primarily supplies metadata for OpenAI models. The model_catalog_json configuration below defines Step model names, context windows, and input capabilities so the models appear in /model. A dedicated Step profile limits the catalog override to Step sessions.

Install Codex CLI

Install Codex CLI 0.154.0:
Check the installed version:
Expected output: codex-cli 0.154.0.

Configure Step Plan

Set the configuration directory

Preserve an existing CODEX_HOME value, or use the default directory if it is unset:
To keep the setup separate from your existing configuration, use a dedicated directory before continuing:
Complete the remaining steps in the same terminal. When using the dedicated directory in a later session, set CODEX_HOME again before starting Codex.

Add the provider

Merge this configuration into $CODEX_HOME/config.toml, preserving existing settings. If [model_providers.stepfun] already exists, update that table instead of adding a duplicate.
Define the provider in user-level configuration. Codex ignores model_provider and model_providers in a project’s .codex/config.toml. The built-in identifiers openai, ollama, and lmstudio are reserved.

Set the API key

Replace YOUR_STEP_API_KEY with your key and use either method below. Set an environment variable in the terminal that starts Codex:
Alternatively, add or update the following entry in $CODEX_HOME/.env, which Codex loads at startup:
Restrict access to the file:
.env stores the API key in plain text. Do not commit or share the file.

Create the model catalog

  1. Download the default agent instructions for Codex CLI 0.154.0. The catalog uses this content as base_instructions:
  1. Confirm that the file is not empty:
  1. Generate $CODEX_HOME/step-catalog.json:
The output should list step-5-preview, step-3.7-flash, and step-3.5-flash. Add or remove entry(...) items to match your account’s access. Catalog fields depend on the Codex version; check compatibility when upgrading.

Create a Step profile

Create $CODEX_HOME/step.config.toml. Use this command for a new file; if the file already exists, merge the settings instead of overwriting it.
Check that model_catalog_json contains an absolute path:
--profile step layers step.config.toml over the base config.toml and uses the provider defined there. Because model_catalog_json replaces the startup model catalog, keep it in the dedicated profile. Starting Codex without --profile step leaves this profile unloaded.

Start Codex CLI

  1. Confirm that the required files exist:
  1. Start Codex from your project directory:
  1. Confirm that the model is step-5-preview and the provider is stepfun. Open /model to check that the Step models from the catalog are available.
When resuming a Step session, select the same profile. Replace YOUR_SESSION_ID with the session ID:
/model switches models within the current provider. To use another provider, start a separate session with its profile.

Connect StepSearch MCP

StepSearch provides web_search and web_fetch for web searches and page retrieval. Add it through the Step Plan endpoint when you need these tools.
  1. Confirm that STEP_API_KEY is configured, then register the server:
  1. Check the registered server:
  1. Restart codex --profile step. Use /mcp to check the connection and tools, then run a search or page-retrieval task and inspect the tool call and returned result.
codex mcp add uses the current CODEX_HOME; the resulting configuration is not limited to the step profile. Use a dedicated configuration directory to keep MCP settings separate. The Step profile disables built-in web search with web_search = "disabled" and uses StepSearch MCP for search tools.

Verify the integration

Test a conversation

Enter Reply only with OK. in an interactive session. Expected output: OK. For a read-only check from your project directory, run:

Test tool calls

Create a separate test directory with a README.md containing Codex Step Plan test. Start Codex there and enter:
Approve the required operations and inspect the file and command records. Confirm that hello.py exists, prints Hello, world!, and that README.md is unchanged.

Common questions

Check CODEX_HOME, the model_provider = "stepfun" setting in step.config.toml, and the --profile step startup argument. Confirm that the provider is defined in the user-level config.toml and that the API key is available through the environment or .env. Set CODEX_HOME again before starting Codex if you use a dedicated directory.
Check that the selected profile’s model_catalog_json points to a valid absolute path and that the catalog contains the correct model IDs. Restart after changes. If the old list remains, exit Codex, remove models_cache.json from the active CODEX_HOME, and try again.
Regenerate step-catalog.json using the structure required by your Codex version. Confirm that default.md downloaded successfully and is not empty. A reduced catalog from another version may omit required fields.
Inspect the full error, network connection, API key status, and model permissions. Use https://api.stepfun.ai/step_plan/v1 for base_url and responses for wire_api. Confirm that env_key matches the environment variable and that the key belongs to the account for this endpoint.
If it stops at Reading additional input from stdin... and you do not need to supply input through stdin, append < /dev/null to the command.
Inspect the response status, error details, and token usage. Reasoning can consume the available output budget before visible text is produced. Identify the cause before adjusting parameters supported by your client version and the service.
Check that registration and startup use the same CODEX_HOME, and verify STEP_API_KEY. Inspect codex mcp list, restart an interactive session, and check /mcp. If you use codex exec, verify tool loading and invocation in that mode separately.