Skip to main content
Codex is a powerful command-line interface (CLI) tool that provides AI-powered coding assistance directly from your terminal. It offers intelligent code suggestions, explanations, and debugging help to enhance your development workflow. By integrating Codex with Unbound Security AI Gateway, you can leverage these AI capabilities while maintaining enterprise-grade security, cost control, and compliance.

Integration Options

Unbound provides two ways to integrate Codex depending on your needs:
  1. Using API Key: Use Codex through Unbound Gateway without needing your own OpenAI subscription
  2. With OpenAI Account: Keep your existing OpenAI subscription and add Unbound for tracking and analytics

Prerequisites

Before setting up the integration, ensure you have:
  • Unbound CLI: Installed and logged in — see the CLI guide
  • Node.js: Version 20 or higher
  • Codex CLI: Install with npm install -g @openai/codex

Setup with Unbound CLI

You’ll be prompted to choose a mode:
  1. Gateway — Use Unbound as the AI provider (no OpenAI subscription needed)
  2. Subscription — Keep your OpenAI subscription, add Unbound for policy enforcement and analytics
You can also skip the prompt:
To remove the Unbound configuration:
After setup, restart your terminal. When you open Codex for the first time, select “Provide your own API Key” and press Enter — the key is already configured.

Usage

Basic Usage

Once configured, you can start using Codex in your terminal:
This launches the interactive Codex interface where you can:
  • Ask coding questions
  • Get code suggestions
  • Request explanations for existing code
  • Debug issues with AI assistance

Example Commands

Troubleshooting

Common Issues

Codex not found after installation:
API key not recognized:
Connection issues:
  • Ensure your Unbound API key is valid
  • Check that the base URL is correct
  • Verify your internet connection

Security Benefits

Using Codex with Unbound Security AI Gateway provides:
  • Request Monitoring: All AI requests are logged and monitored
  • Cost Control: Set spending limits and track usage
  • Compliance: Ensure AI interactions meet your organization’s standards
  • Guardrails: Apply security policies to AI responses
  • Audit Trail: Complete visibility into AI usage patterns

Unbound CLI

Install the CLI to set up and manage tools

Tool Policies

Configure security guardrails for AI tools