opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: Configure usage cost display currency

Open dingskyhi opened this issue 5 months ago • 9 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Usage costs are currently formatted as USD in the app and TUI. Users with custom model pricing may want to display costs in another currency, or may already configure model prices in a local currency.

Please add config for the displayed cost currency and the source currency used by configured prices, so examples like CNY display and RMB-denominated custom prices can be represented without double conversion.

dingskyhi avatar Jun 15 '26 23:06 dingskyhi

support!

hugozhu avatar Jun 16 '26 02:06 hugozhu

+1 from a Chinese user! Would love to see costs in CNY/RMB. Excited to see this feature being tracked!

tianshan233 avatar Jul 20 '26 19:07 tianshan233

By the way, I built a small tool for automating proxy setup via Mihomo/Clash during development. Might be useful for other Chinese devs: https://github.com/tianshan233/auto-proxy

tianshan233 avatar Jul 20 '26 19:07 tianshan233

Opened a PR for this: #41208. It adds a display.currency config (with optional display.rates overrides) that converts displayed usage costs in the TUI, app, and ACP usage updates, while keeping the provider currency as the source value. The source-currency half of this issue (custom prices configured in RMB) is covered by the provider-level currency field from #39425, which this PR builds on. Happy to adjust if @StarpTech is still actively working on this.

Meinianda-L avatar Aug 08 '26 04:08 Meinianda-L

+1 — I'd really like a configurable display currency.

For anyone looking into this, the cost is hardcoded to USD in two places:

  • packages/tui/src/component/prompt/index.tsx (the prompt status line): const money = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" })
  • packages/tui/src/feature-plugins/sidebar/context.tsx (sidebar "Context" block): the same formatter.

A minimal client setting would already cover the common case, e.g. in cli.json:

{
  "cost": {
    "currency": "CNY",         // display currency
    "locale": "zh-CN",
    "source_currency": "USD",  // currency the provider/model prices are in
    "rate": 7.20               // source_currency -> currency
  }
}

Keeping source_currency + rate separate matters for users whose configured model prices are already in their local currency (e.g. DeepSeek bills in CNY), so a naive USD->CNY conversion doesn't double-convert. Defaults could stay USD / en-US / 1:1 to preserve current behavior.

Thanks!

iyhome avatar Sep 25 '26 08:09 iyhome

Thanks for the request, @dingskyhi! You're asking for a config option to choose the currency usage costs are shown in, and to declare the currency that custom model prices are set in, so that prices already in CNY/RMB aren't converted twice. Right now costs are always formatted as USD in the TUI, the app and ACP. Maintainers will consider it.

Related:

  • #38667: ACP usage_update always reports currency: "USD", even for custom providers priced in another currency, because price config has no currency field. This is the "source currency" part of your request.
  • #41208, #51429, #51631: community PRs that added display.currency / display.exchangeRates for this issue. All three were closed without being merged.

This can't be done as a plugin today. The plugin API has no way to change how the built-in views format costs.

opencodejr[bot] avatar Oct 29 '26 00:10 opencodejr[bot]

Meanwhile, all pull requests get closed without merging.

alex-mashin avatar Oct 30 '26 13:10 alex-mashin

Thanks for the suggestion. This isn't something we plan to build, so closing to keep the tracker focused.

neriousy avatar Nov 12 '26 19:11 neriousy

Thanks for the suggestion. This isn't something we plan to build, so closing to keep the tracker focused.

Any reason for that, except that there are no currencies other that US dollar?

alex-mashin avatar Nov 13 '26 13:11 alex-mashin