OpenAI Codex on Mingles Router

Run OpenAI Codex on Mingles Router

Codex is OpenAI's own coding agent — it reads your repo, runs commands and edits files from the terminal. It also accepts a custom provider, so the model behind it can be ours. One block in config.toml and it runs on DeepSeek-V4-Flash or Kimi-K2.6 instead of GPT.

Pick your model and paste your key — every command and value on this page updates live.

Endpoint: https://router.mingles.ai/v1 · key stays in your browser · no key entered? commands show <your-key>.

Install + configure

1. Install Codex

shell
npm i -g @openai/codex

Verified against codex-cli 0.147.0.

2. Add the provider block

Create or edit ~/.codex/config.toml. The two fields people get wrong are wire_api and requires_openai_auth — see below.

~/.codex/config.toml
model = "deepseek-ai/DeepSeek-V4-Flash-0731"
model_provider = "mingles"

[model_providers.mingles]
name = "Mingles Router"
base_url = "https://router.mingles.ai/v1"
env_key = "MINGLES_API_KEY"
wire_api = "responses"
requires_openai_auth = false

3. Export your key and run it

shell
export MINGLES_API_KEY=<your-key>
codex

Check the wiring first with `codex doctor` — it prints the resolved provider, the model, and whether it found your key.

Exact values

Config file ~/.codex/config.toml
base_url https://router.mingles.ai/v1
wire_api responses
env_key MINGLES_API_KEY
model deepseek-ai/DeepSeek-V4-Flash-0731

Switch model

Already using Codex on an OpenAI account? Nothing is overwritten — model_provider selects which block is live, so you can keep both and switch by editing that one line.

Before you file a bug: read the limits

Reasoning models spend the output budget on internal thinking, output is capped at 8192 tokens, there is no KV cache, and there are no built-in web tools. Most “it broke on Mingles Router” reports are one of these. See Model limits & behavior →

Frequently asked

Why wire_api = "responses" and not "chat"? +

Because "chat" no longer exists. Codex removed it — set it and you get `wire_api = "chat" is no longer supported`. Codex now speaks only the Responses API, so we implemented /v1/responses on top of our chat-completions pipeline. That is what this config talks to; the rest of our API is unchanged.

Does the agent part work, or just chat? +

The agent part. We tested codex-cli 0.147.0 against production with `--sandbox workspace-write`: it called a shell tool, created a file, ran it, read the output and reported back. Tool calls, streaming and multi-turn tool results all round-trip.

“Model metadata for … not found. Defaulting to fallback metadata”? +

Harmless. Codex ships a table of known OpenAI models and warns for anything outside it. It affects Codex’s own context-window bookkeeping, not the request. Everything works with the warning present.

I see raw JSON with "reasoning" and "tool_calls" in the transcript +

A known rough edge on our side, not a Codex bug. Where a model’s tool calls are emulated, the streaming path currently emits the emulation JSON as visible text as well as a proper tool call. The tool still runs correctly. It is on our list.

Do I need an OpenAI account or API key? +

No. `requires_openai_auth = false` tells Codex to use your provider’s key instead of ChatGPT sign-in. Only MINGLES_API_KEY is needed.

Codex or DeepSeek Harness? +

Codex is the mature one and runs in your terminal; DeepSeek Harness is MIT-licensed, runs as a local web UI and is in developer preview. Both take our endpoint, so it is a question of which interface you want.