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.
1. Create a LootVM key
Section titled “1. Create a LootVM key”Create a key in the Console and keep it out of git. See Authentication.
2. Configure ~/.codex/config.toml
Section titled “2. Configure ~/.codex/config.toml”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_urlends with/v1. Codex appends/responses.env_keyis the name of an environment variable, not the secret itself.modelmust match an id fromGET /v1/modelsfor your key.
3. Export the key and start Codex
Section titled “3. Export the key and start Codex”export LOOTVM_API_KEY='your-lootvm-api-key'codexFor a one-off session without changing the default provider:
export LOOTVM_API_KEY='your-lootvm-api-key'codex -c model_provider=lootvm -m your-enabled-modelLaunch 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.
4. Verify the endpoint
Section titled “4. Verify the endpoint”curl --fail-with-body https://api.lootvm.com/v1/models \ -H "Authorization: Bearer ${LOOTVM_API_KEY}"Troubleshooting
Section titled “Troubleshooting”| 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.