Codex
Codex is a coding agent developed by OpenAI that you can run locally from your terminal and that can read, modify, and run code on your machine, in the chosen directory. It’s open-source, and built in Rust for speed and efficiency.
Prerequisites
In order to use the AI Gateway with Codex you will need to complete these steps first:
-
Create a new provider in the AI Gateway for the provider you want to use with Codex
-
Create a new app to use specifically with Codex and assign it to the team you created
-
Copy the API Key for the app you created, as well as the Gateway URL
Configure Codex CLI
There are two approaches you can take to using Codex with Zuplo's AI Gateway.
-
Route OpenAI through AI Gateway - This would configure your OpenAI provider in Codex to route requests through the AI Gateway rather than directly to OpenAI
-
Create a Zuplo specific provider - Use Zuplo as a provider that be selected in the Codex configuration and work with any OpenAI compatible models
Configuration steps for both options are below:
Route OpenAI through AI Gateway
Open the Codex configuration
~/.codex/config.toml
and modify the model_providers.openai-chat-completions
entry so that the base_url
points to your AI Gateway URL, and your env_key
is set to the API Key of the app you created to use with Codex.
Code
Save the file and reload Codex. Your OpenAI requests will now be routed through the Zuplo AI Gateway.
Zuplo AI Gateway provider
To add a specific provider for the AI Gateway you can add an additional entry to
the Codex config.toml
file.
Code
Save the file and reload Codex. Your Zuplo AI Gateway provider will now be available and you can switch Codex over to use it at any time by running:
Code