Skip to content

[FEATURE]: Add opt-in Codex OAuth cost estimates #46320

Closed

Description

@major
  • I have verified this feature I am about to request has not been suggested before.

Describe the enhancement you want to request

ChatGPT and Codex OAuth sessions intentionally report zero cost because subscription usage does not expose billed API charges.

Add an opt-in providers.openai.oauth_cost_estimates configuration field so users can retain the catalog price calculation when they want a local API-equivalent estimate.

The default and explicit false must keep the current zero-cost behavior.

The estimate must not be represented as a ChatGPT subscription charge or invoice.

Activity

  1. gh-ppathi commented on Oct 14, 2026

    @gh-ppathi

    +1 — would love to see this prioritized, especially for OpenAI Enterprise credit accounts.

    While flat personal subscriptions don't have per-token charges, OpenAI Enterprise accounts consume from a shared enterprise credits pool when using Codex/OpenAI OAuth. In the Codex CLI/app, an estimated cost of the credits used is displayed for each session, whereas OpenCode currently zeroes out draft.cost = [] in packages/core/src/plugin/provider/openai.ts and always displays $0.00.

    Having estimated costs (either opt-in or enabled for Enterprise/credit-backed accounts) makes it much easier to track and manage credit consumption in OpenCode.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the request, and for the earlier PR!

    You'd like an opt-in providers.openai.oauth_cost_estimates setting. When it's enabled, ChatGPT/Codex OAuth sessions would show a local, API-equivalent cost estimate based on catalog prices. By default (or with false) the cost would stay at zero, and the estimate would never be presented as a ChatGPT subscription charge.

    For context: the zero cost is deliberate right now. The OpenAI provider clears the catalog cost for Codex models when you're signed in with a ChatGPT account, because the subscription covers that usage. So this would be a new option rather than a bug fix. Maintainers will consider it.

    Related issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions