Skip to content

Codex

This guide covers OpenAI Codex on both the IDE/desktop surface and the Codex CLI. Both read provider routing from Codex configuration. Prefer a dedicated [model_providers.*] block for LootVM rather than relying on a deprecated OPENAI_BASE_URL environment variable alone.

Current Codex builds speak the OpenAI Responses API (wire_api = "responses"). LootVM exposes POST /v1/responses. Confirm the model you pick is enabled for your key.

Create a key in the Console and keep it out of git. See Authentication.

model = "your-enabled-model"
model_provider = "lootvm"
[model_providers.lootvm]
name = "LootVM"
base_url = "https://api.lootvm.com/v1"
env_key = "LOOTVM_API_KEY"
wire_api = "responses"
  • base_url ends with /v1. Codex appends /responses.
  • env_key is the name of an environment variable, not the secret itself.
  • model must match an id from GET /v1/models for your key.
Terminal window
export LOOTVM_API_KEY='your-lootvm-api-key'
codex

For a one-off session without changing the default provider:

Terminal window
export LOOTVM_API_KEY='your-lootvm-api-key'
codex -c model_provider=lootvm -m your-enabled-model

Launch the Codex IDE/desktop app from an environment that has LOOTVM_API_KEY set (or configure the same variable in the environment your desktop session inherits). Exporting the variable in one terminal does not help an app started from the Dock or a different shell.

Terminal window
curl --fail-with-body https://api.lootvm.com/v1/models \
-H "Authorization: Bearer ${LOOTVM_API_KEY}"
Symptom Check
Traffic still goes to api.openai.com Define [model_providers.lootvm] and set model_provider; do not rely on OPENAI_BASE_URL alone on recent Codex versions
401 on every call LOOTVM_API_KEY (or whatever you set in env_key) is unset in the process that started Codex
404 on every call base_url missing /v1, or trailing slash / path mismatch
Provider errors mid-session Model not enabled, or Responses fields your selected model path does not accept—confirm with /v1/models and a small curl to /v1/responses
Config edits ignored Restart Codex after changing config.toml

Do not document or depend on VS Code custom-model wiring for Codex. Use Codex’s own provider config as above.