Codex is a powerful coding Agent tool that can read, modify, and run project code directly from the terminal (CLI) or within VS Code.This guide will walk you through switching Codex's underlying model to DataEyes using a custom Provider configuration with the OpenAI Responses wire API.
Open a terminal and run the following command to install globally:
Step 2: Create the Configuration File (config.toml)#
Codex officially recommends defining custom Providers via a config.toml file.
1.
Find or create the configuration directory:
Windows: C:\Users\YourUsername\.codex
macOS / Linux: ~/.codex
2.
Create a new file named config.toml in that directory.
3.
Paste the following content into the file and save:
# Basic configuration
model_provider = "dataeyes"
model = "Replace with the actual model name supported by DataEyesAI"
preferred_auth_method = "apikey"
disable_response_storage = true
# DataEyesAI custom Provider configuration
[model_providers.dataeyes]
name = "DataEyes"
base_url = "https://platform.dataeyes.ai/v1"
env_key = "DATAEYES_API_KEY"
wire_api = "responses"
Parameter notes: This configuration directly specifies the API endpoint (base_url) and instructs Codex to retrieve the API key from the DATAEYES_API_KEY environment variable.
For security, do not write your API Key directly into the configuration file. Run the following commands in your terminal based on your operating system:Windows PowerShell (temporary — current session only):
$env:DATAEYES_API_KEY="sk-your-dataeyes-key"
Windows PowerShell (permanent — write to user variables, requires terminal restart):
After completing the configuration, navigate to any project code directory in your terminal and run:
Once launched, try a simple read-only analysis command, for example: Summarize the main module structure of the current repository. If Codex responds normally with output, congratulations — DataEyesAI is fully connected!
The Codex CLI and the VS Code extension share the same underlying configuration.Once you have completed the config.toml and environment variable setup above, simply search for and install the Codex extension from the VS Code Extension Marketplace — it will work out of the box with no additional configuration needed inside VS Code.
Verify that the DATAEYES_API_KEY environment variable is actually set in your terminal. If you used the Windows permanent write command, you must fully close and reopen the terminal for the change to take effect.
Check that the key you entered does not accidentally include a Bearer prefix.
Q2: Model not found after launching?
The model field in config.toml must be filled in precisely. Cross-reference the available model list in the DataEyesAI console and enter the exact full name, character for character.
Q3: The connection works, but it is unstable and errors occur intermittently?
Codex depends heavily on the responses wire API format. If instability occurs under high concurrency or unusual network conditions, ensure that wire_api = "responses" in config.toml has no typos, and verify that the selected model is fully compatible with the OpenAI Responses specification.