Codex

Codex can be used with the GWDG commercial model offering via Azure OpenAI.

Choose a setup:

What You Need

  • a commercial endpoint and API key from support@gwdg.de
  • the deployment name that should be used with your resource
  • Visual Studio Code with the OpenAI extension

Codex For Visual Studio Code

1. Install the VS Code extension

2. Azure OpenAI configuration

During onboarding, you may receive ready-to-use config.toml and .env files from GWDG. If not, create the files manually with the same structure shown below.

Save both files in the Codex config directory:

  • Windows: %USERPROFILE%\.codex\
  • macOS: ~/.codex/
  • Linux: ~/.codex/

Target paths:

  • Windows: %USERPROFILE%\.codex\config.toml and %USERPROFILE%\.codex\.env
  • macOS: ~/.codex/config.toml and ~/.codex/.env
  • Linux: ~/.codex/config.toml and ~/.codex/.env

Use the exact base URL, API key, and deployment name that you received from GWDG. The default configuration should point to your provisioned Azure deployment.

After saving the files:

  • Restart VS Code.
  • Open the Codex sidebar.

3. Example config.toml

model = "<your-gwdg-deployment-name>"
model_provider = "azure"
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[model_providers.azure]
name = "Azure"
base_url = "https://<your-resource>.openai.azure.com/openai"
wire_api = "responses"
query_params = { api-version = "2025-04-01-preview" }
env_key = "AZURE_OPENAI_API_KEY"
env_key_instructions = "Set AZURE_OPENAI_API_KEY in ~/.codex/.env"

4. Example .env

AZURE_OPENAI_API_KEY=<your-api-key>

Replace the placeholders with the values from your GWDG onboarding.

5. Sandboxing

For local work, the recommended setup is workspace-write with approvals enabled. Codex uses local sandbox controls to restrict filesystem and network access.

Note

AI models can hallucinate and generate incorrect information. Always verify generated results critically before using or processing them.

Documentation

What You Need

  • a commercial endpoint and API key from support@gwdg.de
  • the deployment name that should be used with your resource
  • a local terminal
  • npm for Codex CLI installation

Codex CLI

1. Install the CLI

Install the Codex CLI with npm:

npm i -g @openai/codex

Official documentation:

2. Azure OpenAI configuration

Codex CLI uses the .codex configuration directory in your home folder. Create config.toml and .env in the following location:

  • Windows: %USERPROFILE%\.codex\
  • macOS: ~/.codex/
  • Linux: ~/.codex/

Target paths:

  • Windows: %USERPROFILE%\.codex\config.toml and %USERPROFILE%\.codex\.env
  • macOS: ~/.codex/config.toml and ~/.codex/.env
  • Linux: ~/.codex/config.toml and ~/.codex/.env

Use the exact base URL, API key, and deployment name that you received from GWDG.

3. Example config.toml

model = "<your-gwdg-deployment-name>"
model_provider = "azure"
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[model_providers.azure]
name = "Azure"
base_url = "https://<your-resource>.openai.azure.com/openai"
wire_api = "responses"
query_params = { api-version = "2025-04-01-preview" }
env_key = "AZURE_OPENAI_API_KEY"
env_key_instructions = "Set AZURE_OPENAI_API_KEY in ~/.codex/.env"

4. Example .env

AZURE_OPENAI_API_KEY=<your-api-key>

Replace the placeholders with the values from your GWDG onboarding.

5. Start the CLI

Open a terminal in your project directory and run:

codex

Codex can inspect your repository, edit files, and run commands in the current directory. If no provider is configured yet, Codex prompts for sign-in on first launch. For the GWDG commercial setup, configure the Azure provider first and then start the CLI.

6. Update the CLI

To update Codex CLI:

npm i -g @openai/codex@latest

7. Sandboxing

Use workspace-write with approvals enabled unless you have a specific reason to allow more.

Note

AI models can hallucinate and generate incorrect information. Always verify generated results critically before using or processing them.

Documentation

Notes

  • Codex CLI is available on macOS, Windows, and Linux.
  • On Windows, OpenAI documents both native PowerShell usage and WSL2.

More AI Services

In addition to Azure OpenAI, we offer other AI services. An overview of all available AI services can be found here: