[The Most Powerful Coding Tool] CodeX
[The Ultimate Programming Tool] CodeX
Section titled “[The Ultimate Programming Tool] CodeX”
About Codex
Section titled “About Codex”Codex is an AI coding assistant developed by OpenAI. You can talk to it in natural language, and it can generate “runnable code” for you, while also helping you fix bugs, explain code, or execute the program.
Codex is now integrated with the latest GPT-5 model and combined with a cloud sandbox environment, making the whole interaction feel as smooth as chatting with a senior engineer.
Even better, it also open-sourced a command-line interface called Codex CLI, bringing the power of the latest reasoning models directly to your terminal. It can:
Read, modify, and execute code on your local machine
Handle text, screenshots, or charts as input
Provide three different approval modes
Run entirely in your terminal
About Codex Available Models
Section titled “About Codex Available Models”This is the model list shown by the /model command in the CLI tool

This is the model list you can see on the 4allapi official website; all of them are supported and billed per request. It is much more cost-effective than the 99% of models on the market that charge by tokens, because coding is extremely token-intensive—tens of thousands of tokens in a single run can easily cost more than 10 cents.

gpt-5 VS gpt-5-codex
Section titled “gpt-5 VS gpt-5-codex”Install and Set Up Codex CLI
Section titled “Install and Set Up Codex CLI”1. Install Codex CLI
Section titled “1. Install Codex CLI”If you want to install and use Codex CLI, here are the detailed installation steps:
- Install Node.js (version 22 or later):
Visit the official website and download the Node.js installer for your operating system. You can verify the installation with the following commands:
node -vnpm -v2. Install Git (required on Windows)
Section titled “2. Install Git (required on Windows)”Download Git from git-scm.com and install the version for your operating system, then verify it with the following command:
git --version3. Install OpenAI Codex CLI:
Section titled “3. Install OpenAI Codex CLI:”npm install -g @openai/codexcodex --version4. Edit the configuration file (create the folder and file if they do not exist)
Section titled “4. Edit the configuration file (create the folder and file if they do not exist)”On Mac, edit vi ~/.codex/config.toml
On Windows, edit C:\Users\your_username\.codex\config.toml
Remember to change the file extension
model_provider = "codex"model = "gpt-5-codex"model_reasoning_effort = "high"disable_response_storage = true
[model_providers.codex]name = "codex"base_url="https://api.4allapi.com/v1"wire_api = "responses"env_key = "K_CODEX" #Do not change this to your own key, set it below!!!5. Set environment variables
Section titled “5. Set environment variables”Windows:
Create a new system environment variable named K_CODEX with the value sk-
Mac:
echo 'export K_CODEX="sk-"' >> ~/.zshrcsource ~/.zshrcLinux:
echo 'export K_CODEX="sk-"' >> ~/.bashrcsource ~/.bashrc6. Launch
Section titled “6. Launch”codex# The command below lets codex run automatically; it is dangerous, so back up your code and environment firstcodex --ask-for-approval never --sandbox danger-full-accessIf you get an error saying the environment is not set, restart the terminal
You do not need to be a “technical expert” — just follow the steps and you can connect Codex CLI to a relay API, achieving “switchable multi-model access, more stable connectivity, and more cost-friendly usage.”
Using Codex in the IDE
Section titled “Using Codex in the IDE”Codex CLI mode is easy to configure. Install the Codex plugin in VS Code, and be sure to choose the one with the highest download count to avoid counterfeit plugins!!!
You can use Codex’s visual chat interface without any extra configuration, and the conversation history from Codex CLI is also visible in the plugin panel.


Building Fun Projects with OpenAI Codex
Section titled “Building Fun Projects with OpenAI Codex”1. Building a Personal Portfolio Website
Section titled “1. Building a Personal Portfolio Website”In this project, we will create a personal portfolio website based on an existing design. First, take a screenshot of the portfolio website you want to recreate (for example, https://tdhopper.com) and provide it to the Codex CLI tool.

Use the following command to pass the image path to Codex CLI:
codex --image "C:\Users\abida\Pictures\Screenshots\Screenshot 2025-04-26 194831.png"Codex will analyze the image and explain its contents in detail. By default, it uses the "o4-mini" model and the "suggest" approval mode.

Next, enter the following prompt to guide Codex in building the website based on the screenshot and your personal information:
> Use the image to build a portfolio website for Abid Ali Awan, a professional data scientist who writes about AI and machine learning.
Because it is in "suggest" mode, Codex will ask for your confirmation before creating files or running commands. You just need to approve them one by one.

After the website is generated:
- Replace placeholder links, such as the avatar and blog links, with your real information and blog address.
- Double-click the
index.htmlfile to preview the website in your browser.
The final website will be highly similar to the original design (about 90%) and will include your personalized information, making it fast, efficient, professional, and visually appealing.

Note: The "suggest" mode keeps you in full control of file creation and command execution, making it easy to review and approve changes step by step.

2. Data Analysis Project
Section titled “2. Data Analysis Project”In this project, we will analyze a dataset and use Codex CLI to automatically generate a detailed data analysis report. This example demonstrates Codex’s ability to automate data analysis and generate professional reports.
We will use --auto-edit mode, a semi-automatic mode in which Codex automatically handles most tasks, such as file creation and editing, but still requires your confirmation before executing shell commands.
Run the following command to analyze the dataset:
codex --auto-edit "The dataset placementdata.csv is available in the root directory. Please perform detailed data analysis and generate an analysis report."Within seconds, Codex will analyze the placementdata.csv dataset and generate a well-structured markdown report.

Open the report, and you will see the following structure:
Dataset Overview
: Describes the data structure and key characteristics
Analysis Details
: Includes statistical summaries and technical analysis
Insights
: Highlights the main findings in the data
Conclusion
: Summarizes the results and provides actionable recommendations

3. Developing an Image Classification App
Section titled “3. Developing an Image Classification App”In this project, we will build an image classification application based on a pre-trained ResNet18 model, using FastAPI to create a custom user interface. We will enable Codex CLI’s fully automatic mode so it can handle the entire workflow, from file generation to documentation writing.
Use the following command to instruct Codex to build the app:
codex --full-auto "Build an image classification application using ResNet18 and FastAPI with Custom UI"Within a minute, Codex will generate all the necessary files, including Python scripts, configuration files, and documentation, along with instructions for running it locally.

The steps are as follows:
- Install the required Python packages:
pip install -r requirements.txt- Run the app locally:
uvicorn main:app --reloadOpen 127.0.0.1:8000 in your browser, upload an image, and you will see the model’s top 5 prediction results and their probabilities.
The app responds quickly and makes accurate predictions, even for images it was not specifically trained on, such as Studio Ghibli-style images.

4All API - A one-stop API aggregation platform for leading AI models
Official website: https://4allapi.com
API Base: https://api.4allapi.com
