summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-06-05 15:06:42 -0400
committerDax Raad <[email protected]>2025-06-05 15:06:42 -0400
commit4a6e36a4041a5b7c8e24e5b02970aa70c47cd3a5 (patch)
tree829242e4ed5d5951026e6f8532933d66093df689
parentdb2bb32bcf0c3fdc8ede5530946e85a852448679 (diff)
downloadopencode-4a6e36a4041a5b7c8e24e5b02970aa70c47cd3a5.tar.gz
opencode-4a6e36a4041a5b7c8e24e5b02970aa70c47cd3a5.zip
fix cost
-rw-r--r--packages/opencode/src/session/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts
index 0d3990814..e35c4ac4c 100644
--- a/packages/opencode/src/session/index.ts
+++ b/packages/opencode/src/session/index.ts
@@ -633,8 +633,8 @@ export namespace Session {
}
return {
cost: new Decimal(0)
- .add(new Decimal(tokens.input).mul(model.cost.input))
- .add(new Decimal(tokens.output).mul(model.cost.output))
+ .add(new Decimal(tokens.input).mul(model.cost.input).div(1_000_000))
+ .add(new Decimal(tokens.output).mul(model.cost.output).div(1_000_000))
.toNumber(),
tokens,
}