Credits, Usage Limits, and Cost Optimization
Codex cost management covers pricing tiers, the token-based credit system, and strategies for reducing spend without losing productivity. Credits scale with the mix of input, cached input, and output tokens across the Sol, Terra, and Luna model tiers, so right-sizing tasks, trimming AGENTS.md, limiting MCP servers, routing to a cheaper tier, and using cloud deliberately all reduce consumption. Usage dashboards and the Analytics API make that spend visible and alertable.
You are three days into a sprint and your team’s Codex usage dashboard shows you have burned through 80% of the available credits. Two developers are running broad exploratory tasks with far more context than they need. One automation is running hourly when daily would suffice. Without visibility and discipline, Codex costs can surprise you. This article gives you the controls and strategies to keep spending predictable.
What you’ll walk away with on Codex cost management
Section titled “What you’ll walk away with on Codex cost management”- A clear understanding of Codex pricing tiers, credit costs, and usage limits
- Concrete strategies that reduce unnecessary credit consumption without sacrificing productivity
- Monitoring and alerting patterns using the usage dashboard and Analytics API
- Decision frameworks for when to use local vs cloud and GPT-5.6 Sol vs Terra vs Luna
Access and Metering at a Glance
Section titled “Access and Metering at a Glance”| Access route | GPT-5.6 in Codex | How usage is metered |
|---|---|---|
| Free / Go | Terra | Included plan limits; users are prompted to upgrade rather than buy extra Codex credits |
| Plus / Pro | Sol, Terra, and Luna | Included usage first; eligible users can buy credits after reaching it |
| Business / Enterprise | Sol, Terra, and Luna when enabled for the workspace and role | Included usage and/or a managed credit pool, depending on workspace configuration |
| OpenAI API key | Sol, Terra, and Luna through the API | API token billing, separate from ChatGPT plan credits |
Model availability and usage allowances depend on the plan, rollout, workspace policy, and role. Do not hard-code message counts in budgeting documentation: OpenAI can adjust included limits, while the usage dashboard shows the current account-specific allowance.
How Credits Work
Section titled “How Credits Work”Most new and existing customers now use the token-based Codex rate card. Credits depend on the actual mix of input, cached input, and output tokens rather than a fixed cost per message:
| Model | Input / 1M tokens | Cached input / 1M | Output / 1M |
|---|---|---|---|
| GPT-5.6 Sol | 125 credits | 12.50 credits | 750 credits |
| GPT-5.6 Terra | 62.50 credits | 6.25 credits | 375 credits |
| GPT-5.6 Luna | 25 credits | 2.50 credits | 150 credits |
For the same token mix, Terra consumes half as many credits as Sol and Luna one fifth as many. Real tasks can use different amounts of context and output, so those ratios are not guaranteed per-task savings. A small subset of Enterprise workspaces still uses the legacy per-message card; verify which card applies before forecasting. Under the current token-based card, code review uses GPT-5.3-Codex rather than one of the GPT-5.6 tiers.
Cost Optimization Strategies
Section titled “Cost Optimization Strategies”Strategy 1: Right-Size Your Tasks
Section titled “Strategy 1: Right-Size Your Tasks”The biggest cost driver is task complexity. Every message Codex processes includes your prompt, AGENTS.md, MCP tool definitions, and accumulated context.
Strategy 2: Minimize AGENTS.md Size
Section titled “Strategy 2: Minimize AGENTS.md Size”Every Codex message includes your AGENTS.md content. For large projects, use nested AGENTS.md files:
# Root AGENTS.md (100 lines - loaded for all tasks)AGENTS.md
# Service-specific (50 lines - loaded only when working in payments/)services/payments/AGENTS.md
# Frontend-specific (50 lines - loaded only when working in frontend/)packages/frontend/AGENTS.mdThis way, a task in services/payments/ loads 150 lines of guidance instead of a monolithic 500-line file.
Strategy 3: Limit MCP Servers
Section titled “Strategy 3: Limit MCP Servers”Every configured MCP server adds tool definitions to your context. Disable MCP servers you are not actively using:
[mcp_servers.sentry]enabled = false # Re-enable when debugging production issues
[mcp_servers.linear]enabled = true # Always useful for issue contextStrategy 4: Route by GPT-5.6 tier
Section titled “Strategy 4: Route by GPT-5.6 tier”Reserve GPT-5.6 Sol for complex reasoning. Use Terra for balanced everyday work and Luna for:
- Simple refactors and renames
- Straightforward test writing
- Documentation updates
- Linting and formatting fixes
In the CLI: codex --model gpt-5.6-luna "add docstrings to all public functions in src/utils/"
GPT-5.6 API pricing: Sol $5 / $30, Terra $2.50 / $15, and Luna $1 / $6 per MTok input/output. Codex subscription usage follows the credit rate card above. Model and reasoning-effort choices shown in Codex depend on the plan and workspace role.
In the App: switch models in the thread composer dropdown.
Strategy 5: Use Cloud Deliberately
Section titled “Strategy 5: Use Cloud Deliberately”The current rate card is token-based, so local and cloud tasks do not have one durable per-message price ratio. Cloud runs can still consume more when they load broader environments, run longer, or produce more output. Use cloud when you need:
- Remote execution (delegating from Slack, mobile, or another timezone)
- Complete environment isolation
- Best-of-N parallel attempts
- Work on a branch you have not pushed yet (use
codex cloudto delegate from CLI)
Monitoring and Alerting
Section titled “Monitoring and Alerting”Usage Dashboard
Section titled “Usage Dashboard”The Codex usage dashboard shows:
- Current usage against your limits
- Credit consumption over time
- Breakdown by surface (local, cloud, code review)
Analytics API for Teams
Section titled “Analytics API for Teams”For enterprise teams, build automated alerts. Look up the exact route and auth for daily metrics in the Analytics API reference — the endpoint below is illustrative:
// Check daily credit burn rate// Illustrative endpoint — see the Analytics API reference for the real pathconst response = await fetch(ANALYTICS_DAILY_ENDPOINT, { headers: { Authorization: `Bearer ${adminToken}` }});
const data = await response.json();const dailyCredits = data.total_credits_used;
if (dailyCredits > DAILY_BUDGET * 0.8) { await sendSlackAlert(`Codex credit usage at ${dailyCredits}/${DAILY_BUDGET} (80% of daily budget)`);}Automation Cost Control
Section titled “Automation Cost Control”Automations are a hidden cost driver because they run unattended:
- Review cadence: Does your automation need to run hourly? Daily is often sufficient.
- Scope prompts tightly: A broad “scan the entire codebase” automation costs much more than “scan files changed in the last 24 hours.”
- Use read-only mode: Reporting automations do not need write access, and read-only mode prevents unnecessary tool calls.
- Archive completed runs: Old automation worktrees consume disk space, and their creation consumed credits. Archive what you have reviewed.
When Codex cost controls break down
Section titled “When Codex cost controls break down”- Hitting limits mid-sprint: Free and Go users are prompted to upgrade. Eligible Plus and Pro users can buy credits; managed-workspace options depend on role and admin policy. For the same token mix, moving from Sol to Terra halves the credit rate, while Luna uses one fifth of Sol’s rate.
- Unexpected cloud task costs: Review which integrations (Slack, Linear) are creating cloud tasks. Consider restricting cloud access to specific user groups via RBAC.
- Automation credit drain: Check the Automations section in the sidebar for runs that are firing too frequently or producing low-value results. Adjust cadence or disable.
- API key usage surprises: API key usage is billed at standard API rates per token. Set spending limits in the OpenAI platform dashboard.
Where to go next on cost management
Section titled “Where to go next on cost management”- Enterprise Governance — RBAC and admin controls for team-wide cost management
- Automations — Optimize automation schedules and prompts for cost efficiency
- Non-Interactive Mode — Budget
codex execusage in CI pipelines