Codex CLI · Gatelum
OpenAI Responses is the only API Codex CLI understands: a wire_api = "chat" configuration has not started it since February 2026. No shim is involved — Gatelum handles POST /v1/responses on its own, and all you do is add a provider entry to config.toml, along with a profile file kept separate. Everything else in your Codex setup carries on unchanged.
Example setup
- Base URL
https://api.gatelum.com/v1- Your API key
glt_YOUR_KEY
Install with one command
One command writes the gateway address, your key and the default models into the tool config. Existing files are backed up first.
curl -fsSL https://gatelum.com/install.sh | sh -s -- --key glt_YOUR_KEYPrefer to set it up yourself? The manual steps are right below.
Connection steps
Take the [model_providers.gatelum] table shown in the first tab and put it into ~/.codex/config.toml. Set
base_urlto the gateway address including/v1, point env_key at the variable with your key, keep wire_api = "responses", and do not touch the other lines.From the second tab take the values for ~/.codex/gatelum.config.toml and place that file alongside: model_provider = "gatelum", multi_agent = false, and model takes a catalog ID. Profiles have lived in separate files since 0.134, so a [profiles.gatelum] table left inside config.toml stops --profile from starting.
Enable Web search for the key in the dashboard before using the built-in tool: the flag is off by default, and without it the gateway answers 400 with a hint. Each executed search is billed at the catalog price on top of tokens; failed searches are free, and a request runs at most 5. Sub-agent tools disappear from each request when multi_agent = false, saving roughly 1,700 tokens; switch it to true only if you genuinely use sub-agents.
GATELUM_API_KEY, an environment variable, holds the key (third tab): on macOS and Linux use export, while PowerShell takes $env: or setx. The cabinet reveals the value at issue time and only then; afterwards it exists solely for you, so never put it in settings files.
Launch it as codex --profile gatelum. Everything in agent mode is available: files get read and modified, terminal commands run, a conversation spans many turns and the answer streams. Drop --profile and Codex keeps using the provider it had before.
[model_providers.gatelum]
name = "Gatelum"
base_url = "https://api.gatelum.com/v1"
env_key = "GATELUM_API_KEY"
wire_api = "responses"Connection check
Send one short request: it checks the key, the address and the chosen model.
curl https://api.gatelum.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer glt_YOUR_KEY" \
-d '{"model":"openai/gpt-6-sol","messages":[{"role":"user","content":"ping"}]}'A normal answer means the setup is correct. 401 points to the key, 404 to the address or model, 400 to the request format.
parameter_not_supported, and fetching or deleting a response by id is impossible — 404.
Web search is the one service-side tool the gateway runs: when the key has Web search enabled in the dashboard and a search provider is configured, the built-in web_search call is executed on the gateway, a fixed price is charged per executed search on top of tokens, and sources come back in the response. A request runs at most 5 searches, failed searches are free, and the query goes to an external search provider. The flag is off by default: without it the gateway answers 400 with an enable hint. file_search, code_interpreter and tool_search stay unsupported and get 400 naming their type. A custom (free-form) tool is accepted in text format (grammar format returns 400): the gateway turns it into a function with a single string argument input, and the model call comes back as a custom_tool_call carrying that input. Functions that run inside Codex itself are passed through as is.
Some fields are taken in and go no further than the gateway: metadata, store, include, text.verbosity, parallel_tool_calls. All of them are OpenAI hints and telemetry. The reasoning.effort field is forwarded to models and routes that support it, and prompt_cache_key is forwarded on routes with cache markers. The text.format parameter accepts text, json_object, and json_schema (on OpenAI-compatible routes, requiring name and a JSON object schema; direct Anthropic and Google routes return unsupported_capability), while other text.format types and input_file return 400 parameter_not_supported.
Pictures sit in the request body: a part of type input_image with its URL set to data:image/png;base64,… (PNG, WebP or JPEG; 5 MB per file and no more than 50 per request). A tool-produced frame reaches the model through a user turn of its own. detail: original is treated as high, links from outside are never downloaded, and bad_request is what a vision-less model returns.
A warning from Codex that the model is unknown and parameters are default is expected: its catalog simply does not list our IDs.
Codex does not impose an output ceiling, so a request holds its input plus 32,000 answer tokens, capped by whatever remains on the balance (roughly $0.03 with gpt-6-sol). If the hold is too small, the balance terminates the answer (response.incomplete); Codex then repeats the turn as many as five times and runs into 402. Keep enough for several such holds, and note that they stack only when sub-agents run in parallel (multi_agent = true).
On Windows, codex exec run non-interactively and without a sandbox has no way to write files. The desktop app adds a [windows] section to config.toml; inside it, the mode that elevates through UAC fails while launching the helper in a screenless session. For codex exec, pick the non-elevated mode and pass --sandbox workspace-write. Interactive codex relies on action approvals instead, which cover the same tasks. When PowerShell's patch helper edits files containing Cyrillic, retries sometimes occur, and those cost extra tokens.functions. JSON output (response_format) is accepted on OpenAI-compatible routes, while a model reachable only through a direct Anthropic or Google connection answers unsupported_capability. The retired functions format behaves differently: it returns parameter_not_supported, so no parameter disappears without an explanation. Only models the catalog tags "Understands images" may accept pictures — they travel as an image_url part holding a data:image/png;base64,… address (PNG, JPEG and WebP are allowed, a file may weigh up to 5 MB, and a request carries at most 50). Remote addresses are never downloaded, while a model lacking the tag answers bad_request. Each error, bad_request as well as parameter_not_supported, states the reason plainly.