Codex
This guide explains how to configure OpenAI Codex CLI to work with the PwC AI-CoE Coding Agents Gateway.
Prerequisites
- Codex CLI installed (official installation guide)
- API key and tenant ID (see Get Access)
Codex requires models that support OpenAI's Responses API format. Only certain OpenAI models are compatible. See the Models page for the full list (look for the ✅ in the Responses API column).
Configuration
Codex uses two configuration files located in your home directory:
| File | Purpose |
|---|---|
~/.codex/config.toml | Model and provider settings |
~/.codex/auth.json | Authentication credentials |
Step 1: Configure the Provider
Create or edit ~/.codex/config.toml:
model_provider = "pwc"
model = "GENAI_SHARED_OPENAI_GPT_52_CODEX"
[model_providers.pwc]
name = "PwC AI-CoE Gateway"
base_url = "https://idi-coding-agents.pwc.it"
wire_api = "responses"
Configuration Options
| Setting | Description |
|---|---|
model_provider | Provider name to use (must match the key in model_providers) |
model | Model ID from the GenAI Shared Service (see Models) |
base_url | Gateway endpoint URL |
wire_api | API format - must be "responses" for Codex |
Available Models
Use any model with Responses API support from the Models page:
| Model | model value |
|---|---|
| GPT-5.2 Codex (Recommended) | GENAI_SHARED_OPENAI_GPT_52_CODEX |
| GPT-5.1 Codex | GENAI_SHARED_OPENAI_GPT_51_CODEX |
| GPT-5 Codex | GENAI_SHARED_OPENAI_GPT_5_CODEX |
| GPT-5.1 Codex Mini | GENAI_SHARED_OPENAI_GPT_51_CODEX_MINI |
Step 2: Configure Authentication
Create or edit ~/.codex/auth.json:
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "apikey=<your-api-key>&tenantid=<your-tenant-id>"
}
Replace <your-api-key> and <your-tenant-id> with the values obtained as described in Get Access.
The OPENAI_API_KEY value uses the same format as other coding agents: apikey=<key>&tenantid=<tenant>. This is passed as-is to the gateway for authentication.
Network Requirements
| Endpoint | Network | Recommendation |
|---|---|---|
https://idi-coding-agents.pwc.it | PwC VPN (Italy / Italy On-Premise) | ✅ Recommended |
https://doc-interact-backend.pwc.it | Public internet | ⚠️ Not recommended |
The public endpoint is protected by the Imperva firewall, which typically blocks coding agent requests after some time due to their high frequency, interpreting them as potential DDoS attacks.
Verification
After configuration, verify your setup by running:
codex
Codex should start and connect to the PwC AI-CoE Gateway. Try a simple prompt to confirm everything is working.
Optional Settings
You can add additional settings to config.toml as needed:
model_provider = "pwc"
model = "GENAI_SHARED_OPENAI_GPT_52_CODEX"
# Approval policy: "suggest", "auto-edit", "full-auto"
approval_policy = "suggest"
[model_providers.pwc]
name = "PwC AI-CoE Gateway"
base_url = "https://idi-coding-agents.pwc.it"
wire_api = "responses"
For all available options, refer to the official Codex documentation.