Prerequisites
- Codex CLI is installed (
codex --versionprints a version), for example vianpm 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.2
Edit config.toml
Open Top-level keys such as
~/.codex/config.toml (%USERPROFILE%\.codex\config.toml on Windows; create it if missing) and add:~/.codex/config.toml
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:- Codex 0.134.0 and later
- Earlier versions
Each profile is a separate file Starting with this version,
~/.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
[profiles.xxx] tables and the top-level profile = "..." in config.toml are no longer read. Move them to separate files.FAQ
401 / Missing environment variable
401 / Missing environment variable
- Make sure the variable name in
env_keymatches the one youexport, and that you started Codex in a new terminal. - Check that the key has no extra leading or trailing spaces or quotes.
404 / model not found
404 / model not found
base_urlmust behttps://api.dreamto.ai/v1. Without/v1, requests go to/responses; writing/v1/responsesgives/v1/responses/responses.- Set
modelto a model ID from the Model Marketplace and make sure it supports the Responses protocol (GPT family).
Config in the project directory has no effect
Config in the project directory has no effect
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.Streaming breaks or hangs
Streaming breaks or hangs
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.
