Skip to main content

Codex

This guide explains how to configure OpenAI Codex CLI to work with the PwC AI-CoE Coding Agents Gateway.

Prerequisites

Model Compatibility

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:

FilePurpose
~/.codex/config.tomlModel and provider settings
~/.codex/auth.jsonAuthentication 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

SettingDescription
model_providerProvider name to use (must match the key in model_providers)
modelModel ID from the GenAI Shared Service (see Models)
base_urlGateway endpoint URL
wire_apiAPI format - must be "responses" for Codex

Available Models

Use any model with Responses API support from the Models page:

Modelmodel value
GPT-5.2 Codex (Recommended)GENAI_SHARED_OPENAI_GPT_52_CODEX
GPT-5.1 CodexGENAI_SHARED_OPENAI_GPT_51_CODEX
GPT-5 CodexGENAI_SHARED_OPENAI_GPT_5_CODEX
GPT-5.1 Codex MiniGENAI_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.

Credential Format

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

EndpointNetworkRecommendation
https://idi-coding-agents.pwc.itPwC VPN (Italy / Italy On-Premise)Recommended
https://doc-interact-backend.pwc.itPublic internet⚠️ Not recommended
warning

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.