Skip to main content
Point Codex CLI at the Modellix LLM gateway so chat and coding requests use your Modellix API key and openai/... models over OpenAI-compatible Chat Completions.

Set Up Codex

1

Get a Modellix API Key

Create a key in the Modellix console. It is not an OpenAI platform key.
2

Set the API Key

Export your Modellix key as OPENAI_API_KEY:
3

Configure Base URL and Model

In ~/.codex/config.toml, set the base URL and model. Newer Codex builds deprecate OPENAI_BASE_URL as an environment variable—prefer openai_base_url in config:
4

Verify

After saving the config, run Codex as usual. Traffic should hit https://llm.modellix.ai/v1 (typically Chat Completions). For protocol details, see Chat Completions and the LLM API guide.
  • OpenAI SDK — same /v1 base URL for application code
  • OpenCode — another OpenAI-compatible client config
  • Cursor — IDE OpenAI-compatible provider setup