Skip to main content
Get stock Codex CLI driving open-weight models against Tensormesh in 5 minutes. Every Tensormesh serverless model supports the full Codex flow today (chat + tool use); MiniMaxAI/MiniMax-M2.5 is the recommended default.

Sign up / Log in

Create your Tensormesh account with Google or GitHub.

Get an API key

Generate an ak-... key under Profile → API keys.

Install Codex CLI

npm install -g @openai/codex — verified against Codex 0.128+.

Supported models

Full matrix of Codex-ready models on Tensormesh serverless.

Get support

TL;DR

Three steps — install the CLI, configure the provider, set the API key — then run codex. Step 2 has an ordering constraint (top-level keys must precede any [section] header); see Setup below if you have an existing ~/.codex/config.toml.
That’s the full setup — no third-party tooling installed, no PATH addition. Setup below walks through the same three steps in detail (and the merge-into-existing-config case).

Prerequisites

  • Codex CLI installed via npm install -g @openai/codex. Verified against 0.128.0 through 0.131.0 (chat + tool use end-to-end); forward-compatible with later versions barring upstream Codex breaking changes.
  • A Tensormesh account with an API key (ak-...). Sign up, then visit Profile → API keys.
  • macOS or Linux, bash or zsh. Windows binaries ship in Codex 0.131+ but aren’t currently tested by Tensormesh.
You do not need to run codex login. The provider’s env_key field tells Codex to read your API key from the environment variable directly; the OAuth login flow is for OpenAI-hosted models only.
You do not need to run any local infrastructure. Tensormesh handles Codex compatibility server-side, so stock codex pointed at serverless.tensormesh.ai (per the TL;DR above) is the complete setup.

Supported models

GET /v1/models reflects what’s currently available — Tensormesh hides any model that’s temporarily cold. If you see fewer models than the table lists, retry after 30–60 seconds; the first request to a cold model warms it up.
For non-Codex clients (Python SDK, curl, custom apps), every model in the table works fine via /v1/chat/completions as well. Codex CLI specifically cannot fall back to that wire (see openai/codex#7782 for OpenAI’s rationale), which is why the matrix above is Codex-CLI specific.

Switching models

The Codex TUI’s /model picker only shows OpenAI’s built-in lineup (gpt-5.5, gpt-5.4, …) — Tensormesh model slugs aren’t in it. Likewise, the “GPT-5.5 is now available” tip on launch refers to models you can’t use here. Press Esc to dismiss the picker and switch models via one of the methods below. This is a Codex CLI limitation that affects every third-party provider; it’s not specific to Tensormesh.

Per-invocation (no config edit)

-m is a per-invocation override; your config.toml default is unchanged. Equivalent long form: codex -c 'model="..."'.

Change the default

Edit ~/.codex/config.toml and update the model = line, or use sed:
(Drop the empty-string argument from -i on Linux: sed -i 's|...|' ~/.codex/config.toml.)

Optional: shell aliases for frequent switching

If you switch models often, add aliases to your ~/.zshrc (zsh) or ~/.bashrc (bash):
Reload your shell, then run tm-coder from any directory to start a Codex session against that model. Exit codex (/exit or Ctrl-D twice) and run a different alias to switch.

Setup

The three steps from the TL;DR, with explanation.
1

Install Codex CLI

This installs the codex command to your global node_modules/bin. Verify with codex --version.
2

Configure the Tensormesh provider

Codex reads provider configuration from ~/.codex/config.toml. Add this content:
The first three keys make Tensormesh + MiniMax + medium reasoning the default for every codex invocation. The [model_providers.tensormesh] block defines the provider those defaults reference. You can override per-invocation with -c.
TOML ordering matters. The model_provider, model, and model_reasoning_effort keys are top-level — they must appear in the file before any [section] header (TOML doesn’t reset table context on blank lines, so anything below a [header] belongs to that section).
Just paste the block as-is — the TL;DR’s cat > ~/.codex/config.toml does this.
3

Set your API key

Add this to ~/.zshrc (zsh) or ~/.bashrc (bash) to persist across sessions. The API key prefix selects environment: ak-dev-... for dev, ak-staging-... for staging, ak-live-... for production.Don’t have a key yet? Generate one in your profile.

Usage

Slash commands in TUI

Inside an interactive codex session, type / to bring up the command picker (autocomplete). /help is not a valid command — typing it gives Unrecognized command '/help'. A few that customers reach for most often: For the full list of slash commands available in your installed version, type / and arrow through the picker.

Sandbox / approval modes

Codex defaults to a strict sandbox: read-only, no network, prompts before each shell command. Three modes are available: For codex exec (non-interactive), the -a never flag is implicit, so just codex exec -s workspace-write is sufficient. The -s workspace-write and --dangerously-bypass-approvals-and-sandbox configurations are mutually exclusive in effect — workspace-write sandboxes filesystem writes and disables network. If you need network access for a tool, use the bypass flag.
Codex CLI 0.128.0 removed the older --full-auto shortcut. Use -s workspace-write (+ -a never for interactive) instead. If you copy a snippet that uses --full-auto, Codex will error with unexpected argument '--full-auto' found.

Resume gotcha — --last orders by file mtime

codex exec resume --last picks the session whose JSONL file was most recently modified, not the one most recently created. So if you just touched an older session (even by reading or resuming it once), that session — not your latest one — wins --last. To target a specific session, pass its UUID explicitly:
Session UUIDs are listed in ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl filenames.
  • model_reasoning_effort = "medium" is the empirical sweet spot for MiniMax-M2.5. The full set Codex accepts is none / minimal / low / medium / high / xhigh. Against MiniMax-M2.5, high does not consistently improve output quality, costs more latency, and occasionally produces self-contradicting reasoning chains in long generations. Use none or minimal only when you specifically want to skip the model’s reasoning step. This recommendation is calibrated only for MiniMax-M2.5. For the other supported models, medium is a reasonable starting point but not validated; experiment if you’re optimizing for a specific workload.
  • Stay in -s workspace-write for most coding work. Switch to the bypass flag only for tasks that need network access (e.g., fetching docs, hitting an API).

Known cosmetic issues

”Model metadata not found” warning in TUI

When you run interactive codex (TUI), you’ll see this between every user message and the model’s response:
This is cosmetic. Functionality is unaffected. Codex CLI ships a built-in registry of OpenAI’s own models (gpt-5.5, gpt-5.4, …); when it sees a slug that isn’t in the registry it falls back to default metadata and emits this warning. Tensormesh model slugs (MiniMax, Qwen3, etc.) are not in OpenAI’s registry, so the warning fires for every supported model here. The warning does not appear in codex exec (non-interactive) runs — only in TUI. It’s a Codex CLI behavior, not a Tensormesh behavior; the same applies to every other third-party provider.

Auto-compact threshold

Codex automatically compacts conversation history when it approaches the model’s context window. The exact trigger varies per model, and the threshold is configurable via Codex’s auto_compact_token_limit setting: If you’re using a 40K-window model, expect compaction to fire much earlier in long sessions than on a 192K MiniMax run. What you’ll see when it fires:
  • In TUI mode: a visible “compacting…” event between turns.
  • In exec mode: silent — the compact-trigger turn just takes longer (around 30–60 seconds extra) and the next turn proceeds with the compressed context. No explicit message is printed.
What’s preserved vs lost when compaction fires:
  • ✓ Preserved: the topical context of the conversation (documents you’ve fed to Codex, the high-level task you’re working on).
  • ✗ Lost: specific conversational facts you told Codex (“remember the codeword BLUEFISH42”). After compaction, Codex sees a summary of earlier turns, not the verbatim history. If specific recall matters for your workflow, plan for compaction or split into fresh sessions.
To trigger compaction manually before reaching the threshold, type /compact in the TUI. Otherwise, start a fresh session.

Troubleshooting

When a request fails, Codex retries five times before surfacing the cause:
The five Reconnecting... lines are noise. The meaningful error is the line immediately after 5/5.
Still stuck? Email saas-support@tensormesh.ai with the meaningful error line (the one after 5/5) and the output of codex --version.

Rollback / uninstall

To remove Tensormesh from your Codex setup:
  1. Delete the [model_providers.tensormesh] block (and the three top-level model_provider / model / model_reasoning_effort lines if you added them) from ~/.codex/config.toml.
  2. Unset TENSORMESH_INFERENCE_API_KEY and remove from ~/.zshrc / ~/.bashrc.
All actions reverse the setup steps above.