Skip to main content
Version: v1.0.x

Use PaletteAI Inference Launchpad with OpenAI Codex

This guide explains how to connect the OpenAI Codex CLI to a PaletteAI Inference Launchpad appliance so that a model running on the appliance serves every request instead of OpenAI's hosted API. You add a custom model provider to the Codex configuration file and confirm the connection.

Prerequisites​

  • The OpenAI Codex CLI installed and already working. For installation, refer to the OpenAI Codex website.
  • A running PaletteAI Inference Launchpad appliance with at least one model deployed and serving. To deploy a model, refer to Deploy a Model.
  • An API token for the appliance. To create one, refer to Generate an API Token, or use a token an administrator generated for you.
  • The appliance reachable at a DNS hostname with a valid, publicly trusted TLS certificate. Codex validates TLS strictly and cannot skip certificate verification, so a self-signed certificate does not work.

Configure Codex​

Codex uses the Responses API, so you add a custom model provider that points at the appliance. For a description of each field, refer to OpenAI Codex Configuration.

tip

The console can generate a starter version of this configuration for you. Select Connect coding agent and open the Codex tab to copy a config.toml snippet pre-filled with your appliance's endpoint. Review the model and provider values against the steps below before you save it.

  1. Add the following custom provider to the Codex configuration file at ~/.codex/config.toml. Replace <appliance-host> with your appliance address.

    model = "glm-5.2"            # a model the appliance serves, not "auto"
    model_provider = "lpai"

    [model_providers.lpai]
    name = "Launchpad"
    base_url = "https://<appliance-host>/v1"
    env_key = "LPAI_KEY"
    wire_api = "responses" # Codex uses the Responses API

    Set model to a model the appliance serves, such as glm-5.2. Do not use auto, because the Responses API passes the model straight to the engine. Set base_url to your appliance address with the /v1 path appended.

  2. Set the environment variable named in env_key to your API token so that Codex can authenticate. In this example, env_key is LPAI_KEY. Replace <lpai-token> with the token you copied.

    export LPAI_KEY=<lpai-token>

Verify the Connection​

Run a single prompt to confirm the appliance answers.

codex exec --skip-git-repo-check "reply with exactly CODEX_OK and nothing else"
Expected output
CODEX_OK

A reply confirms that the base URL, token, provider, and model routing all work. The --skip-git-repo-check flag lets you run the test outside a git repository.

info

Codex may print a Model metadata for glm-5.2 not found warning. This warning is cosmetic and does not affect the request.

Request Routing and Quotas​

Requests you send through the appliance are subject to the routing rule and quota configured for your client. If an operator configured a routing rule for your token, the appliance can redirect a request to a frontier model instead of a local one. Quotas apply to the client, so every API token that belongs to the client draws on the same limits. When the client exhausts a quota, the appliance returns an HTTP 429 response.

To understand what a client is and how API keys and quotas govern usage, refer to Clients and Quotas. To understand how the Tier map and the semantic router combine to pick a model for each request, refer to Routing Behavior.

Next Steps​

To look up each configuration value, refer to OpenAI Codex Configuration. To connect a different coding tool, refer to Use PaletteAI Inference Launchpad with Claude Code or Use PaletteAI Inference Launchpad with Cursor.