Codex Usage Optimization: GPT-5.6, Context, and Cached Tokens
A practical guide to getting more verified work while controlling context, model choice, and retries.
Codex usage is not the same as the number of prompts.
The current Codex rate card is token-based: input, cached input, and output tokens all matter. Task size, repository context, model choice, Fast mode, background work, and repeated context processing can all change consumption. Codex credits and API token prices are different accounting surfaces, so use the rate card inside the product as the source of truth.
Source: https://help.openai.com/en/articles/20001106
A practical operating model
1. Pick the cheapest model that can pass the task’s acceptance checks.
OpenAI’s current GPT-5.6 guidance describes Sol as the flagship, Terra as the balanced option, and Luna as the efficient option for high-volume work. When migrating from an earlier model, start with the same reasoning setting, then test one level lower on representative tasks. The right question is not which model is cheapest; it is which model produces the lowest cost per verified outcome.
Source: https://developers.openai.com/api/docs/guides/latest-model
2. Keep the task boundary small.
Give Codex the relevant files, the requested change, the acceptance checks, and a stop condition. Large repositories, long threads, broad tool context, and repeated pasted logs all create work that may not improve the result. One bounded task with a clear receipt is easier to verify and easier to retry.
3. Reuse stable instructions.
GPT-5.6 supports explicit prompt caching. Keep stable project instructions, schemas, and conventions at the front of the prompt, then put volatile task details after them. Caching is useful when context is genuinely reused; it is not a reason to dump an entire repository into every task.
Source: https://openai.com/index/gpt-5-6/
4. Batch independent reads when ordering is not required.
A public Codex issue reports lower weighted usage in one controlled workload after explicit batching. That is a user report, not a universal benchmark. The safe lesson is to batch independent inspections and avoid serial tool calls when one result does not depend on another.
Source: https://github.com/openai/codex/issues/35050
5. Reserve high reasoning for work that benefits from it.
Use the flagship tier for architecture, difficult debugging, security review, or ambiguous migrations. Use the balanced tier for normal implementation. Use the efficient tier for high-volume classification, summarization, and routine checks. Verify the choice on a representative eval set instead of trusting model labels or price alone.
A simple budget loop
Before the task: define the acceptance checks, maximum scope, and likely model tier.
During the task: watch context growth, avoid repeating pasted logs, and stop after the requested change is verified.
After the task: record the task type, model or tier, input and cached-input behavior, output size, result, and whether a retry came from unclear instructions.
Optimize the workflow, not just the model.
What this does not prove
Lower cost does not mean equal quality for every task. The GPT-5.6 overview cites benchmark results; treat them as evidence for testing, not a guarantee about your repository. The best optimization is a small eval loop: ten representative tasks, a clear success check, and a record of cost per verified outcome.
