Codex

Configure Codex with Imole as an OpenAI-compatible provider.

Integration

Codex uses one Imole API key, one base URL, and the model id that fits the task.

Before you start

Create an Imole API key from the dashboard API page. Keep the key in an environment variable or a local secret store, not in project files.

Use gpt-5.6-sol with high reasoning for repository work. For general reasoning, choose gpt-5.6-luna, gpt-5.6-terra, or gpt-5.6-sol with medium effort.

Base URL
IMOLE_API_KEY
Provider config
Model id

macOS and Linux

Add the key to your shell profile, then create or edit the Codex config file in your home directory.

  1. 1

    Export IMOLE_API_KEY in the shell.

  2. 2

    Create the Codex config directory if it does not exist.

  3. 3

    Paste the provider block into config.toml.

  4. 4

    Restart Codex or open a new terminal.

Shell setup
export IMOLE_API_KEY="imole_live_..."
mkdir -p ~/.codex
${EDITOR:-nano} ~/.codex/config.toml
config.toml
model = "gpt-5.6-sol"
model_provider = "imole"
model_reasoning_effort = "high"

[model_providers.imole]
name = "Imole"
base_url = "https://api.imole.app/v1"
env_key = "IMOLE_API_KEY"
wire_api = "responses"

Windows

Use PowerShell for Codex on Windows. Store the key as a user environment variable, then edit the Codex config under your user profile.

  1. 1

    Set IMOLE_API_KEY for the current user.

  2. 2

    Create %USERPROFILE%\.codex.

  3. 3

    Open config.toml in Notepad.

  4. 4

    Paste the provider block.

PowerShell setup
[Environment]::SetEnvironmentVariable("IMOLE_API_KEY", "imole_live_...", "User")
New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex"
notepad "$env:USERPROFILE\.codex\config.toml"
config.toml
model = "gpt-5.6-sol"
model_provider = "imole"
model_reasoning_effort = "high"

[model_providers.imole]
name = "Imole"
base_url = "https://api.imole.app/v1"
env_key = "IMOLE_API_KEY"
wire_api = "responses"

WSL

For WSL, configure Codex inside the Linux distribution. Windows user environment variables do not automatically become stable Linux shell secrets.

WSL setup
echo 'export IMOLE_API_KEY="imole_live_..."' >> ~/.bashrc
mkdir -p ~/.codex
nano ~/.codex/config.toml

Verify

Start Codex and ask a small coding task. If authentication fails, verify the environment variable is visible in the same terminal session that starts Codex.

For media work, use Imole Agent or the direct media API routes. Text providers are for text, planning, coding, and tool orchestration.

Explain the current folder structure.Write a tiny unit test for this function.Use gpt-5.6-luna for a quick connection test.
Next

Related docs