mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:40:49 +00:00
feat: add tiered model pricing support (#67605)
Adds tiered model pricing support for cost tracking, keeps configured pricing ahead of cached catalog values, and includes latest Moonshot Kimi K2.6/K2.5 cost estimates.\n\nThanks @sliverp.
This commit is contained in:
@@ -19,6 +19,18 @@ describe("moonshot provider catalog", () => {
|
||||
"kimi-k2-thinking-turbo",
|
||||
"kimi-k2-turbo",
|
||||
]);
|
||||
expect(provider.models.find((model) => model.id === "kimi-k2.6")?.cost).toEqual({
|
||||
input: 0.95,
|
||||
output: 4,
|
||||
cacheRead: 0.16,
|
||||
cacheWrite: 0,
|
||||
});
|
||||
expect(provider.models.find((model) => model.id === "kimi-k2.5")?.cost).toEqual({
|
||||
input: 0.6,
|
||||
output: 3,
|
||||
cacheRead: 0.1,
|
||||
cacheWrite: 0,
|
||||
});
|
||||
});
|
||||
|
||||
it("opts native Moonshot baseUrls into streaming usage only inside the extension", () => {
|
||||
|
||||
@@ -15,6 +15,18 @@ const MOONSHOT_DEFAULT_COST = {
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
};
|
||||
const MOONSHOT_K2_6_COST = {
|
||||
input: 0.95,
|
||||
output: 4,
|
||||
cacheRead: 0.16,
|
||||
cacheWrite: 0,
|
||||
};
|
||||
const MOONSHOT_K2_5_COST = {
|
||||
input: 0.6,
|
||||
output: 3,
|
||||
cacheRead: 0.1,
|
||||
cacheWrite: 0,
|
||||
};
|
||||
|
||||
const MOONSHOT_MODEL_CATALOG = [
|
||||
{
|
||||
@@ -22,7 +34,7 @@ const MOONSHOT_MODEL_CATALOG = [
|
||||
name: "Kimi K2.6",
|
||||
reasoning: false,
|
||||
input: ["text", "image"],
|
||||
cost: MOONSHOT_DEFAULT_COST,
|
||||
cost: MOONSHOT_K2_6_COST,
|
||||
contextWindow: MOONSHOT_DEFAULT_CONTEXT_WINDOW,
|
||||
maxTokens: MOONSHOT_DEFAULT_MAX_TOKENS,
|
||||
},
|
||||
@@ -31,7 +43,7 @@ const MOONSHOT_MODEL_CATALOG = [
|
||||
name: "Kimi K2.5",
|
||||
reasoning: false,
|
||||
input: ["text", "image"],
|
||||
cost: MOONSHOT_DEFAULT_COST,
|
||||
cost: MOONSHOT_K2_5_COST,
|
||||
contextWindow: MOONSHOT_DEFAULT_CONTEXT_WINDOW,
|
||||
maxTokens: MOONSHOT_DEFAULT_MAX_TOKENS,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user