codex icon indicating copy to clipboard operation
codex copied to clipboard

OpenAI service tier support

Open jakvbs opened this issue 3 months ago • 5 comments

Problem

Currently, Codex CLI doesn't provide users with control over OpenAI API service tiers, limiting cost optimization options for different use cases.

Proposed Solution

Add service_tier configuration option to control API request cost and latency via OpenAI's service tier parameter:

  • auto (default): Standard processing with automatic tier selection
  • flex: 50% cheaper processing with increased latency, ideal for non-production workloads
  • priority: Faster processing for enterprise users

Implementation Details

  • Configuration via service_tier in config.toml and profiles
  • CLI flag --service-tier for per-session override
  • Model compatibility validation with fallback to auto
  • Support for both exec and TUI modes

Use Cases

  • Development/testing: Use flex tier for 50% cost savings on non-critical workloads
  • Production: Use priority tier for faster response times
  • Batch processing: Use flex for cost-effective background tasks

Configuration Examples

# Global setting
service_tier = "flex"

# Profile-specific
[profiles.cost-optimized]
model = "o3"
service_tier = "flex"
# CLI usage
codex --service-tier flex "Analyze this code"
codex exec --service-tier priority "Generate tests"

Benefits

  • Cost optimization: Up to 50% savings with flex tier
  • Performance control: Priority tier for time-sensitive work
  • Flexibility: Per-session and per-profile configuration
  • Backward compatibility: Auto tier maintains existing behavior

This feature aligns with OpenAI's service tier offerings and provides users with cost/performance control without breaking existing workflows.

jakvbs avatar Aug 29 '25 21:08 jakvbs

I'd like to see this implemented, service_tier = priority would be nice for people who want lower latency responses, even if it costs more.

hourianto avatar Sep 12 '25 09:09 hourianto

I support this. I tried codex cli for two days of work, not for production to learn and made great progress until it abruptly and rudely presented me with '🖐  You've hit your usage limit. Upgrade to Pro (https://openai.com/chatgpt/pricing) or try again in 4 days 1 hour 57 minutes." I am sure ya'll know what I mean. I am on the Plus plan, but a hobby developer. I wish we could instead 'auto switch' to a 'pay as you go' during the 'time-out' period, (happy to accept slower response) and then auto-switch back after 'time limit' resets. I know there is an option to use setx and your key, but that is a pain. make it easier to switch modes please.

brainit-consulting avatar Sep 12 '25 20:09 brainit-consulting

+1 supporting this. Question, what's the current default service_tier set for ChatGPT Plus/Pro users?

pedrobergamini avatar Oct 15 '25 20:10 pedrobergamini

Hi

Do we have any news about service_tier in Codex?

Ability to use GPT 5.1 high with priority service_tier would be awesome for our team By default, it's very slow

it-sha avatar Dec 04 '25 14:12 it-sha

@it-sha, thanks for your interest. We generally prioritize features based on community feedback. This has received some upvotes, but there are many features that are ahead of it in the priority list.

etraut-openai avatar Dec 04 '25 17:12 etraut-openai

I was going to create an issue for this if did not exist. But turns out it does, +1 for this feature.

maheshrijal avatar Dec 12 '25 05:12 maheshrijal