Codex CLI on uncensored Kimi K3.1 Pro

Codex CLI on uncensored Kimi K3.1 Pro

Codex CLI speaks only the OpenAI Responses API. MagmaRouter serves that format at /v1/responses, so Codex can drive Kimi K3.1 Pro Xploded with a provider entry and no shim.

The provider block

Add this to ~/.codex/config.toml:

model = "kimi-k3.1-pro-xploded"
model_provider = "magmarouter"

[model_providers.magmarouter]
name = "MagmaRouter"
base_url = "https://api.magmarouter.com/v1"
env_key = "MAGMAROUTER_API_KEY"
wire_api = "responses"

Then export the key and start Codex:

export MAGMAROUTER_API_KEY=sk-mr-...
codex

The base URL keeps /v1 because the Responses client appends only /responses. The same block with codex exec runs it headless.

Why this model suits Codex

Codex edits files and runs commands only through function calls, so a model that cannot make one cannot do anything. Kimi K3.1 Pro Xploded calls tools, reasons before it acts, reads 1,048,576 tokens of a repository and can write up to 943,718 in one reply. It is the strongest model on the line, so it suits the sessions where the plan matters most; GLM 5.3 Xploded is the cheaper choice for routine ones.

What is translated, and what is not

A Responses request becomes a chat-completions body on the way out and the answer becomes a Response object on the way back, with the real event sequence when streaming. Function tools you define work normally.

  • previous_response_id is refused with a clear error. Codex sends the full input every turn, so it does not need it.
  • OpenAI's hosted tools (web_search, file_search, computer_use) run inside OpenAI's own stack, so they are not available.

The general setup, for any model on the line, is in the Codex CLI quickstart.

FAQ

Can Codex CLI use Kimi K3.1 Pro?

Yes, through a model provider entry in config.toml that points at https://api.magmarouter.com/v1 with wire_api set to responses and the model set to kimi-k3.1-pro-xploded.

What wire_api should I set?

responses. Codex speaks the Responses API, and MagmaRouter translates it for the model.

Does it need a separate key?

No. The same MagmaRouter key works for the OpenAI, Anthropic and Responses formats.

Related