Skip to main content
Codex CLI is OpenAI’s open-source command-line coding assistant. It calls models over the OpenAI Responses protocol, which DreamTo supports natively, so you only need to add a custom provider to its config file.

Prerequisites

  • Codex CLI is installed (codex --version prints a version), for example via npm i -g @openai/codex.
  • You have created an API Key on the API Keys page of the DreamTo console.
  • You have a GPT model ID that supports the Responses protocol, such as gpt-6.2-sol. See OpenAI Responses and the Model Marketplace for available models.

Setup

1

Set the API Key environment variable

Codex reads the key from the environment variable named by env_key, so the config file doesn’t need a plaintext key.
For the Codex desktop app or IDE extensions, the environment variable must be persistent (in your shell config or system environment variables). The desktop app can’t see a variable you only export in the current terminal.
2

Edit config.toml

Open ~/.codex/config.toml (%USERPROFILE%\.codex\config.toml on Windows; create it if missing) and add:
~/.codex/config.toml
Top-level keys such as model and model_provider must come before any [...] table; otherwise TOML assigns them to the preceding table.
3

Launch and verify

Reopen your terminal and run in your project directory:
Type /status in the interactive UI to see the current provider and model.

Multiple configurations (profiles)

Use profiles to switch between models. The syntax depends on your version:
Each profile is a separate file ~/.codex/<name>.config.toml containing only top-level keys. Pass --profile at launch to layer it on top of the main config:
~/.codex/dreamto-fast.config.toml
Starting with this version, [profiles.xxx] tables and the top-level profile = "..." in config.toml are no longer read. Move them to separate files.

FAQ

  • Make sure the variable name in env_key matches the one you export, and that you started Codex in a new terminal.
  • Check that the key has no extra leading or trailing spaces or quotes.
  • base_url must be https://api.dreamto.ai/v1. Without /v1, requests go to /responses; writing /v1/responses gives /v1/responses/responses.
  • Set model to a model ID from the Model Marketplace and make sure it supports the Responses protocol (GPT family).
A project’s .codex/config.toml ignores model_provider, model_providers and openai_base_url. These can only be set in ~/.codex/config.toml in your home directory.
Raise stream_max_retries, or set stream_idle_timeout_ms (milliseconds) on the provider. If you’re behind a corporate proxy, make sure it doesn’t buffer SSE.
To just change the address without adding a provider, you can set openai_base_url = "https://api.dreamto.ai/v1" in config.toml to override the built-in openai provider’s address. A custom provider is clearer, though, and doesn’t get mixed up with your OpenAI account sign-in.