Skip to content

ACP usage_update mislabels non-USD costs as USD #38667

Description

@DinahK-2SO

Description

OpenCode's custom provider model configuration accepts numeric token cost rates but does not accept
their currency. The internal assistant-message cost is also stored as a bare number. When OpenCode
projects that number into ACP, it unconditionally emits currency: "USD".

As a result, a custom provider priced in EUR can have the correct numeric amount reported with the
wrong currency. In the deterministic reproduction below, a provider cost of 30 EUR is emitted
as 30 USD.

cost: { amount: totalSessionCost(messages), currency: "USD" },

Plugins

No response

OpenCode version

OpenCode 1.18.3

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

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