Skip to main content
Codex talks to OpenAI’s API, so it uses Nemu’s OpenAI-compatible surface. You add Nemu as a custom provider in Codex’s config and select a model by its gateway name.

1. Create a gateway key

In the console, open API keys and create one. It belongs to the workspace you are in, and can reach the providers and models enabled there.

2. Add Nemu as a provider

Edit ~/.codex/config.toml:
model takes a gateway name exactly as GET /v1/models reports it. Run this to see yours:

3. Run it

Choosing a wire API

Nemu implements the Responses API for every model, including ones whose upstream provider only speaks chat completions, so responses is safe even when the target is not an OpenAI model.

Notes

  • Nemu accepts the key as Authorization: Bearer or x-api-key; Codex sends the bearer header, which is what env_key wires up.
  • The base URL must include /v1. Codex appends /responses itself.
  • If you want a short name in config, create a mapping in the console and use the mapped name as model.
  • Reasoning effort passes through. Nemu translates it into whatever the target model supports rather than rejecting the request.

Silencing the model metadata warning

Codex prints this on every turn when it does not recognise the model slug:
It is not an error from Nemu. Codex resolves context window, reasoning levels and compaction thresholds from a catalog compiled into the binary, which only contains OpenAI’s own models, so any gateway model falls back to a generic 272k context window and no reasoning levels. Codex does not read this from GET /v1/models for a normal env_key provider, so the gateway cannot supply it over the wire. Set the context window yourself, at the top level of ~/.codex/config.toml:
That fixes the numbers Codex actually uses. To also stop the warning, point Codex at your own catalog file:
The catalog replaces Codex’s built-in one, so it must list every model you use, and its schema is internal to Codex and can change between releases. Copy an entry out of codex-rs/models-manager/models.json in the Codex repository and change slug, display_name, context_window, max_context_window and supported_reasoning_levels. Set visibility to "list" for it to appear in /models.
model_max_output_tokens and model_supports_reasoning_summaries were removed from Codex. Setting them today does nothing.