Skip to content

Commit fc5adcf

Browse files
add open ai cache pricing & check to ui (RooCodeInc#3268)
* base * changeset * Update src/core/controller/index.ts Co-authored-by: Ara <[email protected]> --------- Co-authored-by: Ara <[email protected]>
1 parent 9eaf023 commit fc5adcf

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.changeset/chatty-planets-love.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
add open ai cache to ui

src/core/controller/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,16 @@ Here is the project's README to help you get started:\n\n${mcpDetails.readmeCont
14151415
modelInfo.cacheWritesPrice = parsePrice(rawModel.pricing?.input_cache_write)
14161416
modelInfo.cacheReadsPrice = parsePrice(rawModel.pricing?.input_cache_read)
14171417
break
1418+
default:
1419+
if (rawModel.id.startsWith("openai/")) {
1420+
modelInfo.cacheReadsPrice = parsePrice(rawModel.pricing?.input_cache_read)
1421+
if (modelInfo.cacheReadsPrice) {
1422+
modelInfo.supportsPromptCache = true
1423+
modelInfo.cacheWritesPrice = parsePrice(rawModel.pricing?.input_cache_write)
1424+
// openrouter charges no cache write pricing for openAI models
1425+
}
1426+
}
1427+
break
14181428
}
14191429

14201430
models[rawModel.id] = modelInfo

0 commit comments

Comments
 (0)