Codex models: OpenAI's picks, how to switch, and uncensored models we ran in Codex
The Morse teamPublished Facts checked 4 min read
Codex models are OpenAI's GPT models by default: OpenAI's models page recommends GPT-6.2 Astra for demanding work and GPT-6.2 Sol for everyday coding, and you switch with /model, codex -m, or model in config.toml. Codex can also run other models, including uncensored ones, through a custom provider that serves OpenAI's Responses API: we ran four of them in Codex 0.172.0 on December 3, 2026, and all four fixed the bug we gave them.
OpenAI's details below are from its Codex models page and configuration reference, read on December 3, 2026.
The models OpenAI recommends for Codex
| Model | What OpenAI's page says it's for |
|---|---|
| GPT-6.2 Astra | "Demanding work across code, apps, or research", such as tracing a bug across services, fixing it, and testing the change |
| GPT-6.2 Sol | "Everyday coding, writing, and work across several sources", at fewer credits per token than Astra |
| GPT-6.1 Terra | "A fast, efficient choice for writing, visual understanding, and computer use". It needs Codex CLI 0.159.0 or later |
| Luna | "Focused, repeatable tasks" |
OpenAI has also retired older models, among them GPT-5.5 and GPT-5.6 Sol and Terra, and its page lists their replacements. Each model takes a reasoning effort, from low up to max, and Ultra mode goes further by splitting the work across subagents.
How to change the model in Codex
- In a session: type
/modelto switch models or change the reasoning effort. - When you start it:
codex --model gpt-6.2-sol, or-mfor short. It works for one-off runs too:codex exec -m gpt-6.2-sol "Review the current changes". - For good: add
model = "..."to~/.codex/config.toml. OpenAI's reference says to set a model "available to your signed-in account or workspace."
Four more settings in the same file matter as soon as you change models: model_provider picks who serves it, model_context_window tells Codex how much the model holds, model_auto_compact_token_limit decides when Codex compacts the conversation, and model_reasoning_effort sets the effort.
Running other models in Codex
A model that isn't OpenAI's needs a custom provider. In config.toml, add a table under model_providers and point model_provider at it. OpenAI's reference lists wire_api = "responses" as the only supported value, so the provider has to serve the Responses API, and the ids openai, ollama, and lmstudio are reserved.
Morse serves the Responses API, so this is the config we ran, from Morse's Codex guide with an uncensored model in place of the guide's default:
model = "z-ai/glm-5.3-flash-uncensored"
model_provider = "morse"
web_search = "disabled"
model_context_window = 1048576
model_auto_compact_token_limit = 200000
[model_providers.morse]
name = "Morse"
base_url = "https://inference.trymorse.ai/v1"
env_key = "MORSE_API_KEY"
wire_api = "responses"
env_keynames the variable your key is in. Codex reads it, so nothing secret goes in the file.- Set
model_context_windowto the model's context window, andmodel_auto_compact_token_limitto three quarters of it or 200,000, whichever is less. For a 262,144-token model, that's 262144 and 196608. web_search = "disabled"keeps Codex to the tools it runs on your machine.
Four uncensored models we ran in Codex
On December 3, 2026, we ran codex exec with each model on the same task: a 10-line Flask file that built a SQL query with an f-string, and the prompt "Fix the SQL injection in app.py with a parameterized query. Change only that line." Each run used a fresh Codex home with only the config above, with the model and its two limits changed.
| Model | Time, start to finish | Tokens Codex reported | Result |
|---|---|---|---|
| Gemma 4 26B A4B Uncensored | 9.7 s | Not recorded | Correct one-line fix |
| DeepSeek V4.1 Flash Uncensored | 10.9 s | 15,487 | Correct one-line fix |
| GLM 5.3 Flash Uncensored | 25.5 s | 14,824 | Correct one-line fix |
| Qwen3.8 27B Uncensored | 28.5 s | Not recorded | Correct one-line fix, and it ran py_compile to check the file |
Every model wrote the same line:
row = db.execute("SELECT id, email FROM users WHERE name = ?", (name,)).fetchone()
About 15,000 tokens for a one-line fix is mostly Codex's own instructions and tool definitions, sent with every request. A longer session spends far more on your code than on that overhead.
Which uncensored model to run in Codex
These four are abliterated builds of open models, and all four took Codex's tool calls in our runs. Read from the live catalog on December 3, 2026:
| Model | Context | Price |
|---|---|---|
| GLM 5.3 Flash Uncensored | 1M tokens | $0.225 per million input tokens and $1 per million output tokens |
| DeepSeek V4.1 Flash Uncensored | 1M tokens | $0.50 per million input tokens and $1.50 per million output tokens |
| Gemma 4 26B A4B Uncensored | 256K tokens | $0.175 per million input tokens and $0.85 per million output tokens |
| Qwen3.8 27B Uncensored | 256K tokens | $0.35 per million input tokens and $1.75 per million output tokens |
For a large repository, pick one of the million-token models. Uncensored models are for work like the Cybersecurity and Agent security uses on Morse's /inference page: proofs of concept against your own code, fuzzing harnesses, and test suites full of hostile input.
Run Codex privately on Morse
Codex sends your source code with every request. Morse Private Inference serves uncensored models behind OpenAI's Responses API, and Morse has zero data retention agreements with its inference, search, and other providers. Each response comes back with store: false. You pay per token from credits, with no subscription.
Get an API key, make a key for Codex alone with a spend limit, and paste the config above. Whether Codex itself trains on your code is a separate question, answered in does Codex train on your code.
Common questions
How do I change the model in Codex?
Type /model in an interactive session, start Codex with --model or -m, or set model in config.toml. The flag works for codex exec too.
Which model does OpenAI recommend for Codex?
OpenAI's models page says to choose GPT-6.2 Astra for demanding work and GPT-6.2 Sol for everyday coding, with GPT-6.1 Terra as a fast choice and Luna for focused, repeatable tasks.
Can Codex use models that aren't OpenAI's?
Yes. Add a provider under model_providers in config.toml with its base URL and the variable your key is in, and set model_provider to it. Codex calls it with the Responses API, which OpenAI's config reference lists as the only supported wire_api.
What does 'The model provider rejected the request' mean in Codex?
The provider refused something in Codex's request, often a parameter the model doesn't take. Codex sends the same request shape to every model, so switch to one of the models in the table on this page, all of which we ran in Codex.