fix(ai): correct Kimi K3 Moonshot pricing

This commit is contained in:
Armin Ronacher
2026-07-16 20:37:48 +02:00
parent c1b7856e26
commit aba324504c
6 changed files with 30 additions and 10 deletions
+12
View File
@@ -44,6 +44,18 @@ describe("builtin providers", () => {
}
});
it("uses official Kimi K3 pricing for Moonshot providers", () => {
const models = builtinModels();
for (const provider of ["moonshotai", "moonshotai-cn"]) {
expect(models.getModel(provider, "kimi-k3")?.cost).toEqual({
input: 3,
output: 15,
cacheRead: 0.3,
cacheWrite: 0,
});
}
});
it("resolves anthropic auth from env with OAuth token precedence", async () => {
const models = createModels({
authContext: fakeAuthContext({ ANTHROPIC_API_KEY: "key", ANTHROPIC_OAUTH_TOKEN: "oauth-token" }),