Skip to main content

Codex Integration Guide

Codex is an AI coding tool from OpenAI that includes Codex CLI and other ways to use it. If you want a more intuitive experience, we recommend starting with Codex; OPEAI Platform is fully compatible with the OpenAI protocol and can also be integrated seamlessly with Codex CLI.

Get Codex

Configuring OPEAI Platform

Edit ~/.codex/config.toml

Add the following content to ~/.codex/config.toml:

model_provider = "opeai"
model = "gpt-5.4"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"
personality = "pragmatic"

[model_providers.opeai]
name = "opeai"
base_url = "https://api-platform.ope.ai/v1"
wire_api = "responses"

Edit ~/.codex/auth.json

Add the following content to ~/.codex/auth.json:

{
"OPENAI_API_KEY": "sk-xxxx"
}

Verify Configuration

codex "Write a Hello World script in Python"
Recommended ModelUse CaseFeatures
GPT-5.3-CodexCode GenerationOptimized for code generation and editing, ideal for daily coding, completion, and small to medium refactors
GPT-5.4Complex TasksStronger overall capability for complex reasoning, multi-file workflows, and larger-scale code understanding

For the complete model list, please check Model Pricing.

Common Codex CLI Commands

Code Generation

codex "Implement quicksort algorithm in Python"

Specify Model

Specify the model to use via command line parameter:

codex --model GPT-5.3-Codex "Refactor this function"
codex --model GPT-5.4 "What's wrong with this code?"

Code Explanation

codex "Explain what this code does" < script.py

Bug Fixing

codex "Fix the bug in this file" < buggy_code.py

Code Review

codex "Review this code and point out potential issues" < code.js