Skip to main content
Use this when you want Codex to call models through Vectoree instead of a ChatGPT account or another provider. This is separate from app backend setup (login / link). You need a Vectoree account. The setup script signs you in with the same device-code flow as npx @vectoree/cli login --use-device-code, then lets you pick:
  1. Project key (sk-ve-v1-...) — pick a project and mint a scoped gateway key
  2. Employee key (ek-ve-v1-...) — pick an org where you have an active Employee AI seat (rotates that seat’s key)
  3. Paste an existing key (or set VECTOREE_API_KEY / reuse .vectoree/config.json from vectoree link)
Do not use the instance master key (ik_). Copy one of these into your terminal. The script backs up ~/.codex, writes a model catalog, and only touches the provider keys Codex needs.

macOS / Linux

Windows (PowerShell)

Paste this prompt to an agent

If you would rather have Cursor, Claude Code, or another agent run the switch for you:

Prerequisites

  1. Install Codex CLI (npm install -g @openai/codex) or the ChatGPT desktop app.
  2. Launch it once so ~/.codex exists.
  3. Have a Vectoree account ready. Prefer menu 1 (project key) or 2 (employee key) so the script opens a browser and mints the key. Optional: set VECTOREE_API_KEY to skip login.

What the menu does

Menu 1 is vectoree/auto. Then: deepseek/deepseek-v4-pro, qwen/qwen3-max, qwen/qwen-plus, z-ai/glm-5.2, qwen/qwen3.5-plus-02-15, qwen/qwen3-coder-flash. Video Hot SKUs are not in this list. Type y on first install. Optional env: VECTOREE_API_KEY, VECTOREE_BASE_URL (default https://vectoree.ai/api/v1/), CODEX_HOME.

Desktop vs CLI

Local sessions under ~/.codex/sessions are not deleted. To restore ChatGPT defaults, re-run the script, choose r (newest backup-vectoree* folder), then fully quit and reopen ChatGPT / Codex. Each install writes a new timestamped backup (backup-vectoree-YYYYMMDD-HHMMSS). A leftover older backup no longer blocks reinstall.

Verify

  • Codex CLI: startup banner shows model: <your-slug>
  • ChatGPT desktop: model picker shows Custom
If Codex returns BILLING_PRICE_NOT_CONFIGURED, the slug is wrong or unpriced. Check Admin → Models, or ask an agent to run npx @vectoree/cli ai models search. OpenRouter *-latest aliases often need the ~ prefix.

Tools (web search / apply_patch)

Vectoree’s /api/v1/responses path keeps Codex custom tools (freeform apply_patch, etc.) and re-renders them as custom_tool_call so the client can execute them. Hosted web_search is fulfilled by Vectoree’s Tool Hub search when the instance has a search provider API key configured; otherwise that tool is dropped and surfaced in X-Vectoree-Degraded-Fields. If search is unavailable on your instance, disable it in ~/.codex/config.toml:

Manual configuration

If you prefer not to use the one-click script — for example inside a locked-down CI runner or a remote server with no browser — you can edit the two Codex config files directly. You will need a Vectoree API key (sk-ve-v1-...) from Dashboard → Projects → API Keys, or an employee key (ek-ve-v1-...) from your org admin.

Step 1 — Edit ~/.codex/config.toml

Open (or create) ~/.codex/config.toml and set the following top-level keys:
Then add the provider section:

Step 2 — Create ~/.codex/models.json

Codex needs a model catalog so it can resolve the model slug. Create ~/.codex/models.json with at least one entry matching the slug you chose:
Add one entry per model slug you plan to use. The slug must exactly match what your Vectoree gateway is configured to route.

Config field reference

~/.codex/config.toml — top-level keys

~/.codex/config.toml — [model_providers.vectoree]

~/.codex/models.json — entry fields

Restore

To undo manual configuration, delete the [model_providers.vectoree] section and the top-level keys you added. If you had a previous config.toml, restore it from the backup the one-click script created (look under ~/.codex/backup-vectoree-*). Fully quit and reopen ChatGPT / Codex afterward so the desktop UI reloads account mode.