diff --git a/packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap b/packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap index ab023ddc00..08850c3f44 100644 --- a/packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap +++ b/packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap @@ -298,6 +298,54 @@ exports[`Registry Snapshots endpoint configurations snapshot 1`] = ` "*", ], }, + "qwen3.6-35b-a3b:engy": { + "context": 208192, + "crossRegion": false, + "maxTokens": 16384, + "modelId": "qwen3.6-35b-a3b", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, + "qwen3.8-27b:engy": { + "context": 1001536, + "crossRegion": false, + "maxTokens": 16384, + "modelId": "qwen3.8-27b", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, }, "anthropic/claude-3-haiku-20240307": { "claude-3-haiku-20240307:anthropic": { @@ -2127,6 +2175,56 @@ exports[`Registry Snapshots endpoint configurations snapshot 1`] = ` ], }, }, + "deepseek/deepseek-v4": { + "deepseek-v4-flash-0731:engy": { + "context": 1048576, + "crossRegion": false, + "maxTokens": 65536, + "modelId": "deepseek-v4-flash-0731", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, + "deepseek-v4.1-flash:engy": { + "context": 1048576, + "crossRegion": false, + "maxTokens": 65536, + "modelId": "deepseek-v4.1-flash", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, + }, "deepseek/r1-distill": { "deepseek-r1-distill-llama-70b:chutes": { "context": 128000, @@ -4049,6 +4147,56 @@ exports[`Registry Snapshots endpoint configurations snapshot 1`] = ` ], }, }, + "moonshotai/kimi-k3": { + "kimi-k3.1-pro:engy": { + "context": 1113088, + "crossRegion": false, + "maxTokens": 16384, + "modelId": "kimi-k3.1-pro", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, + "kimi-k3:engy": { + "context": 1113088, + "crossRegion": false, + "maxTokens": 16384, + "modelId": "kimi-k3", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, + }, "openai/gpt-4.1": { "gpt-4.1-mini:azure": { "context": 1047576, @@ -7292,6 +7440,80 @@ exports[`Registry Snapshots endpoint configurations snapshot 1`] = ` ], }, }, + "zai/glm-5": { + "glm-5.2:engy": { + "context": 262144, + "crossRegion": false, + "maxTokens": 131072, + "modelId": "glm-5.2", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, + "glm-5.3-flash:engy": { + "context": 327680, + "crossRegion": false, + "maxTokens": 131072, + "modelId": "glm-5.3-flash", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, + "glm-5.3:engy": { + "context": 327680, + "crossRegion": false, + "maxTokens": 131072, + "modelId": "glm-5.3", + "parameters": [ + "frequency_penalty", + "max_tokens", + "presence_penalty", + "response_format", + "seed", + "stop", + "stream", + "temperature", + "tool_choice", + "tools", + "top_p", + ], + "provider": "engy", + "ptbEnabled": false, + "regions": [ + "*", + ], + }, + }, } `; @@ -7306,6 +7528,8 @@ exports[`Registry Snapshots model coverage snapshot 1`] = ` "deepinfra", "deepinfra", "deepinfra", + "engy", + "engy", "groq", "nebius", "novita", @@ -7433,6 +7657,10 @@ exports[`Registry Snapshots model coverage snapshot 1`] = ` "novita", "openrouter", ], + "deepseek/deepseek-v4": [ + "engy", + "engy", + ], "deepseek/r1-distill": [ "chutes", "deepinfra", @@ -7550,6 +7778,10 @@ exports[`Registry Snapshots model coverage snapshot 1`] = ` "novita", "openrouter", ], + "moonshotai/kimi-k3": [ + "engy", + "engy", + ], "openai/gpt-4.1": [ "azure", "azure", @@ -7732,6 +7964,11 @@ exports[`Registry Snapshots model coverage snapshot 1`] = ` "novita", "novita", ], + "zai/glm-5": [ + "engy", + "engy", + "engy", + ], } `; @@ -7761,6 +7998,16 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` "threshold": 0, }, ], + "engy": [ + { + "cacheMultipliers": { + "cachedInput": 0.333, + }, + "input": 4.5e-8, + "output": 3e-7, + "threshold": 0, + }, + ], "groq": [ { "input": 2.9e-7, @@ -8798,6 +9045,18 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` }, ], }, + "deepseek/deepseek-v4": { + "engy": [ + { + "cacheMultipliers": { + "cachedInput": 0.2, + }, + "input": 4.5e-8, + "output": 9e-8, + "threshold": 0, + }, + ], + }, "deepseek/r1-distill": { "chutes": [ { @@ -9428,6 +9687,18 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` }, ], }, + "moonshotai/kimi-k3": { + "engy": [ + { + "cacheMultipliers": { + "cachedInput": 0.1, + }, + "input": 0.0000014, + "output": 0.000007, + "threshold": 0, + }, + ], + }, "openai/gpt-4.1": { "azure": [ { @@ -9953,6 +10224,18 @@ exports[`Registry Snapshots pricing snapshot 1`] = ` }, ], }, + "zai/glm-5": { + "engy": [ + { + "cacheMultipliers": { + "cachedInput": 0.265, + }, + "input": 6.8e-7, + "output": 0.0000015, + "threshold": 0, + }, + ], + }, } `; @@ -10165,6 +10448,18 @@ exports[`Registry Snapshots verify registry state 1`] = ` "novita", ], }, + { + "model": "deepseek-v4-flash-0731", + "providers": [ + "engy", + ], + }, + { + "model": "deepseek-v4.1-flash", + "providers": [ + "engy", + ], + }, { "model": "ernie-4.5-21b-a3b-thinking", "providers": [ @@ -10278,6 +10573,24 @@ exports[`Registry Snapshots verify registry state 1`] = ` "novita", ], }, + { + "model": "glm-5.2", + "providers": [ + "engy", + ], + }, + { + "model": "glm-5.3", + "providers": [ + "engy", + ], + }, + { + "model": "glm-5.3-flash", + "providers": [ + "engy", + ], + }, { "model": "gpt-4.1", "providers": [ @@ -10626,6 +10939,18 @@ exports[`Registry Snapshots verify registry state 1`] = ` "openrouter", ], }, + { + "model": "kimi-k3", + "providers": [ + "engy", + ], + }, + { + "model": "kimi-k3.1-pro", + "providers": [ + "engy", + ], + }, { "model": "llama-3.1-8b-instant", "providers": [ @@ -10813,6 +11138,18 @@ exports[`Registry Snapshots verify registry state 1`] = ` "novita", ], }, + { + "model": "qwen3.6-35b-a3b", + "providers": [ + "engy", + ], + }, + { + "model": "qwen3.8-27b", + "providers": [ + "engy", + ], + }, { "model": "sonar", "providers": [ @@ -10881,6 +11218,10 @@ exports[`Registry Snapshots verify registry state 1`] = ` "modelCount": 2, "provider": "deepseek", }, + { + "modelCount": 9, + "provider": "engy", + }, { "modelCount": 4, "provider": "fireworks", @@ -11049,9 +11390,9 @@ exports[`Registry Snapshots verify registry state 1`] = ` "claude-3.5-haiku:anthropic:*", ], "totalArchivedConfigs": 0, - "totalEndpoints": 329, - "totalModelProviderConfigs": 329, + "totalEndpoints": 338, + "totalModelProviderConfigs": 338, "totalModelsWithPtb": 108, - "totalProviders": 21, + "totalProviders": 22, } `; diff --git a/packages/cost/models/authors/alibaba/qwen3/endpoints.ts b/packages/cost/models/authors/alibaba/qwen3/endpoints.ts index 955201011a..0c74e3de34 100644 --- a/packages/cost/models/authors/alibaba/qwen3/endpoints.ts +++ b/packages/cost/models/authors/alibaba/qwen3/endpoints.ts @@ -367,6 +367,74 @@ export const endpoints = { "*": {}, }, }, + "qwen3.8-27b:engy": { + providerModelId: "qwen3.8-27b", + provider: "engy", + author: "qwen", + pricing: [ + { + threshold: 0, + input: 0.000000045, // $0.045/1M + output: 0.00000032, // $0.32/1M + cacheMultipliers: { + cachedInput: 0.333, // $0.015/1M cache read vs $0.045/1M input + }, + }, + ], + contextLength: 1_001_536, + maxCompletionTokens: 16_384, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, + "qwen3.6-35b-a3b:engy": { + providerModelId: "qwen3.6-35b-a3b", + provider: "engy", + author: "qwen", + pricing: [ + { + threshold: 0, + input: 0.000000045, // $0.045/1M + output: 0.0000003, // $0.30/1M + cacheMultipliers: { + cachedInput: 0.333, // $0.015/1M cache read vs $0.045/1M input + }, + }, + ], + contextLength: 208_192, + maxCompletionTokens: 16_384, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, } satisfies Partial< Record<`${Qwen3ModelName}:${ModelProviderName}`, ModelProviderConfig> >; diff --git a/packages/cost/models/authors/alibaba/qwen3/models.ts b/packages/cost/models/authors/alibaba/qwen3/models.ts index be8f0811d9..6de961c03b 100644 --- a/packages/cost/models/authors/alibaba/qwen3/models.ts +++ b/packages/cost/models/authors/alibaba/qwen3/models.ts @@ -81,6 +81,28 @@ export const models = { modality: { inputs: ["text"], outputs: ["text"] }, tokenizer: "Qwen", }, + "qwen3.8-27b": { + name: "Qwen3.8 27B", + author: "qwen", + description: + "Qwen3.8 27B is a 27 billion parameter multimodal model in the Qwen series, supporting text and image inputs with a 1M token context window for reasoning, coding, and agentic workloads.", + contextLength: 1_001_536, + maxOutputTokens: 16_384, + created: "2026-08-01T00:00:00.000Z", + modality: { inputs: ["text", "image"], outputs: ["text"] }, + tokenizer: "Qwen", + }, + "qwen3.6-35b-a3b": { + name: "Qwen3.6 35B A3B", + author: "qwen", + description: + "Qwen3.6 35B A3B is a Mixture-of-Experts model in the Qwen series with 35B total and 3B active parameters, offering strong efficiency for general dialogue and reasoning with a 208K token context window.", + contextLength: 208_192, + maxOutputTokens: 16_384, + created: "2026-05-01T00:00:00.000Z", + modality: { inputs: ["text"], outputs: ["text"] }, + tokenizer: "Qwen", + }, } satisfies Record; export type Qwen3ModelName = keyof typeof models; diff --git a/packages/cost/models/authors/deepseek/deepseek-v4/endpoints.ts b/packages/cost/models/authors/deepseek/deepseek-v4/endpoints.ts new file mode 100644 index 0000000000..b90285c2b9 --- /dev/null +++ b/packages/cost/models/authors/deepseek/deepseek-v4/endpoints.ts @@ -0,0 +1,79 @@ +import { ModelProviderName } from "../../../providers"; +import type { ModelProviderConfig } from "../../../types"; +import { DeepSeekV4ModelName } from "./models"; + +export const endpoints = { + "deepseek-v4.1-flash:engy": { + providerModelId: "deepseek-v4.1-flash", + provider: "engy", + author: "deepseek", + pricing: [ + { + threshold: 0, + input: 0.00000003, // $0.03/1M + output: 0.00000012, // $0.12/1M + cacheMultipliers: { + cachedInput: 0.2, // $0.006/1M cache read (20% of input) + }, + }, + ], + contextLength: 1_048_576, + maxCompletionTokens: 65_536, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, + "deepseek-v4-flash-0731:engy": { + providerModelId: "deepseek-v4-flash-0731", + provider: "engy", + author: "deepseek", + pricing: [ + { + threshold: 0, + input: 0.000000045, // $0.045/1M + output: 0.00000009, // $0.09/1M + cacheMultipliers: { + cachedInput: 0.2, // $0.009/1M cache read (20% of input) + }, + }, + ], + contextLength: 1_048_576, + maxCompletionTokens: 65_536, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, +} satisfies Partial< + Record< + `${DeepSeekV4ModelName}:${ModelProviderName}` | DeepSeekV4ModelName, + ModelProviderConfig + > +>; diff --git a/packages/cost/models/authors/deepseek/deepseek-v4/models.ts b/packages/cost/models/authors/deepseek/deepseek-v4/models.ts new file mode 100644 index 0000000000..a033755348 --- /dev/null +++ b/packages/cost/models/authors/deepseek/deepseek-v4/models.ts @@ -0,0 +1,28 @@ +import type { ModelConfig } from "../../../types"; + +export const models = { + "deepseek-v4.1-flash": { + name: "DeepSeek V4.1 Flash", + author: "deepseek", + description: + "DeepSeek V4.1 Flash is the fast multimodal variant of DeepSeek V4.1, supporting text and image inputs with a 1M token context window for latency-sensitive and high-throughput workloads.", + contextLength: 1_048_576, + maxOutputTokens: 65_536, + created: "2026-09-01T00:00:00.000Z", + modality: { inputs: ["text", "image"], outputs: ["text"] }, + tokenizer: "DeepSeek", + }, + "deepseek-v4-flash-0731": { + name: "DeepSeek V4 Flash (0731)", + author: "deepseek", + description: + "DeepSeek V4 Flash (0731) is the July 31 snapshot of DeepSeek V4 Flash, a cost-efficient general-purpose chat model with a 1M token context window.", + contextLength: 1_048_576, + maxOutputTokens: 65_536, + created: "2026-07-31T00:00:00.000Z", + modality: { inputs: ["text"], outputs: ["text"] }, + tokenizer: "DeepSeek", + }, +} satisfies Record; + +export type DeepSeekV4ModelName = keyof typeof models; diff --git a/packages/cost/models/authors/deepseek/index.ts b/packages/cost/models/authors/deepseek/index.ts index 479252640d..667f58c979 100644 --- a/packages/cost/models/authors/deepseek/index.ts +++ b/packages/cost/models/authors/deepseek/index.ts @@ -8,17 +8,20 @@ import type { ModelConfig, ModelProviderConfig } from "../../types"; // Import models import { models as r1Models } from "./r1-distill/models"; import { models as v3Models } from "./deepseek-v3/model"; +import { models as v4Models } from "./deepseek-v4/models"; import { models as reasonerModels } from "./deepseek-reasoner/model"; // Import endpoints import { endpoints as r1Endpoints } from "./r1-distill/endpoints"; import { endpoints as v3Endpoints } from "./deepseek-v3/endpoints"; +import { endpoints as v4Endpoints } from "./deepseek-v4/endpoints"; import { endpoints as reasonerEndpoints } from "./deepseek-reasoner/endpoints"; // Aggregate models export const deepseekModels = { ...r1Models, ...v3Models, + ...v4Models, ...reasonerModels, } satisfies Record; @@ -26,5 +29,6 @@ export const deepseekModels = { export const deepseekEndpointConfig = { ...r1Endpoints, ...v3Endpoints, + ...v4Endpoints, ...reasonerEndpoints, } satisfies Record; diff --git a/packages/cost/models/authors/moonshotai/index.ts b/packages/cost/models/authors/moonshotai/index.ts index 582adba43d..3061283fd6 100644 --- a/packages/cost/models/authors/moonshotai/index.ts +++ b/packages/cost/models/authors/moonshotai/index.ts @@ -8,19 +8,23 @@ import type { ModelConfig, ModelProviderConfig } from "../../types"; // Import models import { models as kimiK2Models } from "./kimi-k2/models"; import { models as kimiK25Models } from "./kimi-k2.5/models"; +import { models as kimiK3Models } from "./kimi-k3/models"; // Import endpoints import { endpoints as kimiK2Endpoints } from "./kimi-k2/endpoints"; import { endpoints as kimiK25Endpoints } from "./kimi-k2.5/endpoints"; +import { endpoints as kimiK3Endpoints } from "./kimi-k3/endpoints"; // Aggregate models export const moonshotaiModels = { ...kimiK2Models, ...kimiK25Models, + ...kimiK3Models, } satisfies Record; // Aggregate endpoints export const moonshotaiEndpointConfig = { ...kimiK2Endpoints, ...kimiK25Endpoints, + ...kimiK3Endpoints, } satisfies Record; diff --git a/packages/cost/models/authors/moonshotai/kimi-k3/endpoints.ts b/packages/cost/models/authors/moonshotai/kimi-k3/endpoints.ts new file mode 100644 index 0000000000..00c2b97555 --- /dev/null +++ b/packages/cost/models/authors/moonshotai/kimi-k3/endpoints.ts @@ -0,0 +1,79 @@ +import { ModelProviderName } from "../../../providers"; +import type { ModelProviderConfig } from "../../../types"; +import { KimiK3ModelName } from "./models"; + +export const endpoints = { + "kimi-k3:engy": { + providerModelId: "kimi-k3", + provider: "engy", + author: "moonshotai", + pricing: [ + { + threshold: 0, + input: 0.00000195, // $1.95/1M + output: 0.00000975, // $9.75/1M + cacheMultipliers: { + cachedInput: 0.1, // $0.195/1M cache read (10% of input) + }, + }, + ], + contextLength: 1_113_088, + maxCompletionTokens: 16_384, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, + "kimi-k3.1-pro:engy": { + providerModelId: "kimi-k3.1-pro", + provider: "engy", + author: "moonshotai", + pricing: [ + { + threshold: 0, + input: 0.0000014, // $1.40/1M + output: 0.000007, // $7.00/1M + cacheMultipliers: { + cachedInput: 0.1, // $0.14/1M cache read (10% of input) + }, + }, + ], + contextLength: 1_113_088, + maxCompletionTokens: 16_384, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, +} satisfies Partial< + Record< + `${KimiK3ModelName}:${ModelProviderName}` | KimiK3ModelName, + ModelProviderConfig + > +>; diff --git a/packages/cost/models/authors/moonshotai/kimi-k3/models.ts b/packages/cost/models/authors/moonshotai/kimi-k3/models.ts new file mode 100644 index 0000000000..1b10dc61d4 --- /dev/null +++ b/packages/cost/models/authors/moonshotai/kimi-k3/models.ts @@ -0,0 +1,28 @@ +import { ModelConfig } from "../../../types"; + +export const models = { + "kimi-k3": { + name: "Kimi K3", + author: "moonshotai", + description: + "Kimi K3 is Moonshot AI's flagship multimodal model with a 1.1M token context window, unifying vision and text understanding with strong reasoning, coding, and agentic capabilities.", + contextLength: 1_113_088, + maxOutputTokens: 16_384, + created: "2026-09-01T00:00:00.000Z", + modality: { inputs: ["text", "image"], outputs: ["text"] }, + tokenizer: "MoonshotAI", + }, + "kimi-k3.1-pro": { + name: "Kimi K3.1 Pro", + author: "moonshotai", + description: + "Kimi K3.1 Pro (moonshotai/Kimi-K3.1-Pro) is Moonshot AI's flagship multimodal model with a 1.1M token context window, unifying text, image, and video understanding with strong reasoning, coding, and agentic capabilities.", + contextLength: 1_113_088, + maxOutputTokens: 16_384, + created: "2026-11-01T00:00:00.000Z", + modality: { inputs: ["text", "image", "video"], outputs: ["text"] }, + tokenizer: "MoonshotAI", + }, +} satisfies Record; + +export type KimiK3ModelName = keyof typeof models; diff --git a/packages/cost/models/authors/zai/glm-5/endpoints.ts b/packages/cost/models/authors/zai/glm-5/endpoints.ts new file mode 100644 index 0000000000..0f18b7eea3 --- /dev/null +++ b/packages/cost/models/authors/zai/glm-5/endpoints.ts @@ -0,0 +1,113 @@ +import { ModelProviderName } from "../../../providers"; +import type { ModelProviderConfig } from "../../../types"; +import { ZaiGlm5ModelName } from "./models"; + +export const endpoints = { + "glm-5.3:engy": { + providerModelId: "glm-5.3", + provider: "engy", + author: "zai", + pricing: [ + { + threshold: 0, + input: 0.00000098, // $0.98/1M + output: 0.00000308, // $3.08/1M + cacheMultipliers: { + cachedInput: 0.184, // $0.18/1M cache read vs $0.98/1M input + }, + }, + ], + contextLength: 327_680, + maxCompletionTokens: 131_072, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, + "glm-5.3-flash:engy": { + providerModelId: "glm-5.3-flash", + provider: "engy", + author: "zai", + pricing: [ + { + threshold: 0, + input: 0.000000135, // $0.135/1M + output: 0.00000045, // $0.45/1M + cacheMultipliers: { + cachedInput: 0.2, // $0.027/1M cache read (20% of input) + }, + }, + ], + contextLength: 327_680, + maxCompletionTokens: 131_072, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, + "glm-5.2:engy": { + providerModelId: "glm-5.2", + provider: "engy", + author: "zai", + pricing: [ + { + threshold: 0, + input: 0.00000068, // $0.68/1M + output: 0.0000015, // $1.50/1M + cacheMultipliers: { + cachedInput: 0.265, // $0.18/1M cache read vs $0.68/1M input + }, + }, + ], + contextLength: 262_144, + maxCompletionTokens: 131_072, + supportedParameters: [ + "max_tokens", + "temperature", + "top_p", + "stop", + "stream", + "frequency_penalty", + "presence_penalty", + "seed", + "tools", + "tool_choice", + "response_format", + ], + ptbEnabled: false, + endpointConfigs: { + "*": {}, + }, + }, +} satisfies Partial< + Record< + `${ZaiGlm5ModelName}:${ModelProviderName}` | ZaiGlm5ModelName, + ModelProviderConfig + > +>; diff --git a/packages/cost/models/authors/zai/glm-5/models.ts b/packages/cost/models/authors/zai/glm-5/models.ts new file mode 100644 index 0000000000..13428624ef --- /dev/null +++ b/packages/cost/models/authors/zai/glm-5/models.ts @@ -0,0 +1,39 @@ +import { ModelConfig } from "../../../types"; + +export const models = { + "glm-5.3": { + name: "Zai GLM-5.3", + author: "zai", + description: + "GLM-5.3 is Zhipu AI's flagship model in the GLM-5 series, delivering major upgrades in coding, multi-step reasoning, and agentic orchestration with a 327K token context window.", + contextLength: 327_680, + maxOutputTokens: 131_072, + created: "2026-09-15T00:00:00.000Z", + modality: { inputs: ["text"], outputs: ["text"] }, + tokenizer: "Zai", + }, + "glm-5.3-flash": { + name: "Zai GLM-5.3 Flash", + author: "zai", + description: + "GLM-5.3 Flash is the fast, cost-efficient multimodal variant of GLM-5.3, supporting text and image inputs with a 327K token context window for high-throughput workloads.", + contextLength: 327_680, + maxOutputTokens: 131_072, + created: "2026-09-15T00:00:00.000Z", + modality: { inputs: ["text", "image"], outputs: ["text"] }, + tokenizer: "Zai", + }, + "glm-5.2": { + name: "Zai GLM-5.2", + author: "zai", + description: + "GLM-5.2 is Zhipu AI's previous-generation GLM-5 series model for general-purpose chat, reasoning, and coding workloads with a 262K token context window.", + contextLength: 262_144, + maxOutputTokens: 131_072, + created: "2026-06-15T00:00:00.000Z", + modality: { inputs: ["text"], outputs: ["text"] }, + tokenizer: "Zai", + }, +} satisfies Record; + +export type ZaiGlm5ModelName = keyof typeof models; diff --git a/packages/cost/models/authors/zai/index.ts b/packages/cost/models/authors/zai/index.ts index 4957ee5f06..c74349cf70 100644 --- a/packages/cost/models/authors/zai/index.ts +++ b/packages/cost/models/authors/zai/index.ts @@ -8,13 +8,17 @@ import type { ModelConfig, ModelProviderConfig } from "../../types"; // Import models and endpoints import { models as glm4Models } from "./glm-4/models"; import { endpoints as glm4Endpoints } from "./glm-4/endpoints"; +import { models as glm5Models } from "./glm-5/models"; +import { endpoints as glm5Endpoints } from "./glm-5/endpoints"; // Aggregate models export const zaiModels = { - ...glm4Models + ...glm4Models, + ...glm5Models } satisfies Record; // Aggregate endpoints export const zaiEndpointConfig = { - ...glm4Endpoints + ...glm4Endpoints, + ...glm5Endpoints } satisfies Record; diff --git a/packages/cost/models/provider-helpers.ts b/packages/cost/models/provider-helpers.ts index ae00f70ee3..86c621d233 100644 --- a/packages/cost/models/provider-helpers.ts +++ b/packages/cost/models/provider-helpers.ts @@ -62,6 +62,8 @@ export function heliconeProviderToModelProviderName( return "fireworks"; case "CANOPYWAVE": return "canopywave"; + case "ENGY": + return "engy"; // new registry does not have case "LOCAL": case "HELICONE": @@ -156,6 +158,9 @@ export const dbProviderToProvider = ( if (provider === "chutes" || provider === "Chutes") { return "chutes"; } + if (provider === "engy" || provider === "Engy") { + return "engy"; + } if (provider === "nebius" || provider === "Nebius") { return "nebius"; } diff --git a/packages/cost/models/providers/engy.ts b/packages/cost/models/providers/engy.ts new file mode 100644 index 0000000000..77ac6b5507 --- /dev/null +++ b/packages/cost/models/providers/engy.ts @@ -0,0 +1,14 @@ +import { BaseProvider } from "./base"; +import type { Endpoint, RequestParams } from "../types"; + +export class EngyProvider extends BaseProvider { + readonly displayName = "Engy"; + readonly baseUrl = "https://api.engy.ai/"; + readonly auth = "api-key" as const; + readonly pricingPages = ["https://engy.ai/"]; + readonly modelPages = ["https://engy.ai/"]; + + buildUrl(endpoint: Endpoint, requestParams: RequestParams): string { + return `${this.baseUrl}v1/chat/completions`; + } +} diff --git a/packages/cost/models/providers/index.ts b/packages/cost/models/providers/index.ts index 963717d50d..536e597486 100644 --- a/packages/cost/models/providers/index.ts +++ b/packages/cost/models/providers/index.ts @@ -7,6 +7,7 @@ import { CerebrasProvider } from "./cerebras"; import { ChutesProvider } from "./chutes"; import { DeepInfraProvider } from "./deepinfra"; import { DeepSeekProvider } from "./deepseek"; +import { EngyProvider } from "./engy"; import { FireworksProvider } from "./fireworks"; import { GoogleProvider } from "./google"; import { GroqProvider } from "./groq"; @@ -31,6 +32,7 @@ export const providers = { chutes: new ChutesProvider(), deepinfra: new DeepInfraProvider(), deepseek: new DeepSeekProvider(), + engy: new EngyProvider(), fireworks: new FireworksProvider(), "google-ai-studio": new GoogleProvider(), groq: new GroqProvider(), diff --git a/packages/cost/models/providers/priorities.ts b/packages/cost/models/providers/priorities.ts index 38df67014c..2f5ff86461 100644 --- a/packages/cost/models/providers/priorities.ts +++ b/packages/cost/models/providers/priorities.ts @@ -29,6 +29,7 @@ export const PROVIDER_PRIORITIES: Record = { chutes: 4, deepinfra: 4, deepseek: 4, + engy: 4, fireworks: 4, groq: 4, mistral: 4, diff --git a/packages/cost/providers/mappings.ts b/packages/cost/providers/mappings.ts index 401d7a49f6..700b12fa46 100644 --- a/packages/cost/providers/mappings.ts +++ b/packages/cost/providers/mappings.ts @@ -98,6 +98,9 @@ const cerebras = /^https:\/\/api\.cerebras\.ai(\/|$)/; // https://inference.canopywave.io const canopywave = /^https:\/\/inference\.canopywave\.io(\/|$)/; +// https://api.engy.ai +const engy = /^https:\/\/api\.engy\.ai(\/|$)/; + export const providersNames = [ "OPENAI", "ANTHROPIC", @@ -136,6 +139,7 @@ export const providersNames = [ "CEREBRAS", "BASETEN", "CANOPYWAVE", + "ENGY", ] as const; export type ProviderName = (typeof providersNames)[number]; @@ -330,6 +334,11 @@ export const providers: { provider: "CANOPYWAVE", costs: [], }, + { + pattern: engy, + provider: "ENGY", + costs: [], + }, ]; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion diff --git a/packages/cost/usage/getUsageProcessor.ts b/packages/cost/usage/getUsageProcessor.ts index 3dc612abf9..53ab5f627e 100644 --- a/packages/cost/usage/getUsageProcessor.ts +++ b/packages/cost/usage/getUsageProcessor.ts @@ -20,6 +20,7 @@ export function getUsageProcessor( case "canopywave": case "chutes": case "deepinfra": + case "engy": case "helicone": case "mistral": case "nebius": diff --git a/web/data/providers.ts b/web/data/providers.ts index 8a22235279..ad11c019e6 100644 --- a/web/data/providers.ts +++ b/web/data/providers.ts @@ -274,6 +274,17 @@ export const providers: Provider[] = [ apiKeyPlaceholder: "...", relevanceScore: 3, }, + { + id: "engy", + name: "Engy", + logoUrl: "/assets/home/providers/engy.webp", + description: + "Configure your Engy API keys for OpenAI-compatible inference across Engy's chat model catalog", + docsUrl: "https://docs.helicone.ai/getting-started/integration-methods", + apiKeyLabel: "Engy API Key", + apiKeyPlaceholder: "...", + relevanceScore: 3, + }, { id: "helicone", name: "Helicone Inference", diff --git a/web/public/assets/home/providers/engy.webp b/web/public/assets/home/providers/engy.webp new file mode 100644 index 0000000000..bc875bd25f Binary files /dev/null and b/web/public/assets/home/providers/engy.webp differ diff --git a/worker/test/ai-gateway/registry-alibaba.spec.ts b/worker/test/ai-gateway/registry-alibaba.spec.ts index e02f1bbe03..9e3f2a61dd 100644 --- a/worker/test/ai-gateway/registry-alibaba.spec.ts +++ b/worker/test/ai-gateway/registry-alibaba.spec.ts @@ -35,6 +35,12 @@ const canopywaveAuthExpectations = { }, }; +const engyAuthExpectations = { + headers: { + Authorization: /^Bearer /, + }, +}; + describe("Alibaba Registry Tests", () => { beforeEach(() => { // Clear all mocks between tests @@ -5565,4 +5571,94 @@ describe("Alibaba Registry Tests", () => { }); }); + + describe("BYOK Tests - qwen3 with Engy Provider", () => { + describe("qwen3.8-27b", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "qwen3.8-27b/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "qwen3.8-27b", + data: createOpenAIMockResponse("qwen3.8-27b"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + + it("should handle tool calls with engy provider", () => + runGatewayTest({ + model: "qwen3.8-27b/engy", + request: { + body: { + messages: [{ role: "user", content: "What's the weather?" }], + tools: [ + { + type: "function", + function: { + name: "get_weather", + description: "Get current weather", + parameters: { + type: "object", + properties: { + location: { type: "string" }, + }, + required: ["location"], + }, + }, + }, + ], + tool_choice: "auto", + temperature: 0.7, + max_tokens: 1000, + }, + }, + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "qwen3.8-27b", + data: createOpenAIMockResponse("qwen3.8-27b"), + expects: { + ...engyAuthExpectations, + bodyContains: [ + "tools", + "tool_choice", + "get_weather", + "temperature", + "max_tokens", + ], + }, + }, + ], + finalStatus: 200, + }, + })); + }); + + describe("qwen3.6-35b-a3b", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "qwen3.6-35b-a3b/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "qwen3.6-35b-a3b", + data: createOpenAIMockResponse("qwen3.6-35b-a3b"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + }); + }); }); diff --git a/worker/test/ai-gateway/registry-deepseek.spec.ts b/worker/test/ai-gateway/registry-deepseek.spec.ts index 125a740e44..6b9cb9754a 100644 --- a/worker/test/ai-gateway/registry-deepseek.spec.ts +++ b/worker/test/ai-gateway/registry-deepseek.spec.ts @@ -33,6 +33,12 @@ const canopywaveAuthExpectations = { }, }; +const engyAuthExpectations = { + headers: { + Authorization: /^Bearer /, + }, +}; + const chutesAuthExpectations = { headers: { Authorization: /^Bearer /, @@ -2156,4 +2162,94 @@ describe("DeepSeek Registry Tests", () => { })); }); }); + + describe("BYOK Tests - deepseek-v4 with Engy Provider", () => { + describe("deepseek-v4.1-flash", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "deepseek-v4.1-flash/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "deepseek-v4.1-flash", + data: createOpenAIMockResponse("deepseek-v4.1-flash"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + + it("should handle tool calls with engy provider", () => + runGatewayTest({ + model: "deepseek-v4.1-flash/engy", + request: { + body: { + messages: [{ role: "user", content: "What's the weather?" }], + tools: [ + { + type: "function", + function: { + name: "get_weather", + description: "Get current weather", + parameters: { + type: "object", + properties: { + location: { type: "string" }, + }, + required: ["location"], + }, + }, + }, + ], + tool_choice: "auto", + temperature: 0.7, + max_tokens: 1000, + }, + }, + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "deepseek-v4.1-flash", + data: createOpenAIMockResponse("deepseek-v4.1-flash"), + expects: { + ...engyAuthExpectations, + bodyContains: [ + "tools", + "tool_choice", + "get_weather", + "temperature", + "max_tokens", + ], + }, + }, + ], + finalStatus: 200, + }, + })); + }); + + describe("deepseek-v4-flash-0731", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "deepseek-v4-flash-0731/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "deepseek-v4-flash-0731", + data: createOpenAIMockResponse("deepseek-v4-flash-0731"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + }); + }); }); diff --git a/worker/test/ai-gateway/registry-moonshot.spec.ts b/worker/test/ai-gateway/registry-moonshot.spec.ts index 237e160a62..6397236571 100644 --- a/worker/test/ai-gateway/registry-moonshot.spec.ts +++ b/worker/test/ai-gateway/registry-moonshot.spec.ts @@ -45,6 +45,13 @@ const canopywaveAuthExpectations = { }, }; +// Define auth expectations for Engy provider +const engyAuthExpectations = { + headers: { + Authorization: /^Bearer /, + }, +}; + describe("Moonshot AI Registry Tests", () => { beforeEach(() => { // Clear all mocks between tests @@ -3111,4 +3118,144 @@ describe("Moonshot AI Registry Tests", () => { })); }); }); + + describe("BYOK Tests - kimi-k3 with Engy Provider", () => { + describe("kimi-k3", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "kimi-k3/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "kimi-k3", + data: createOpenAIMockResponse("kimi-k3"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + + it("should handle tool calls with engy provider", () => + runGatewayTest({ + model: "kimi-k3/engy", + request: { + body: { + messages: [{ role: "user", content: "What's the weather?" }], + tools: [ + { + type: "function", + function: { + name: "get_weather", + description: "Get current weather", + parameters: { + type: "object", + properties: { + location: { type: "string" }, + }, + required: ["location"], + }, + }, + }, + ], + tool_choice: "auto", + temperature: 0.7, + max_tokens: 1000, + }, + }, + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "kimi-k3", + data: createOpenAIMockResponse("kimi-k3"), + expects: { + ...engyAuthExpectations, + bodyContains: [ + "tools", + "tool_choice", + "get_weather", + "temperature", + "max_tokens", + ], + }, + }, + ], + finalStatus: 200, + }, + })); + }); + + describe("kimi-k3.1-pro", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "kimi-k3.1-pro/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "kimi-k3.1-pro", + data: createOpenAIMockResponse("kimi-k3.1-pro"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + + it("should handle tool calls with engy provider", () => + runGatewayTest({ + model: "kimi-k3.1-pro/engy", + request: { + body: { + messages: [{ role: "user", content: "What's the weather?" }], + tools: [ + { + type: "function", + function: { + name: "get_weather", + description: "Get current weather", + parameters: { + type: "object", + properties: { + location: { type: "string" }, + }, + required: ["location"], + }, + }, + }, + ], + tool_choice: "auto", + temperature: 0.7, + max_tokens: 1000, + }, + }, + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "kimi-k3.1-pro", + data: createOpenAIMockResponse("kimi-k3.1-pro"), + expects: { + ...engyAuthExpectations, + bodyContains: [ + "tools", + "tool_choice", + "get_weather", + "temperature", + "max_tokens", + ], + }, + }, + ], + finalStatus: 200, + }, + })); + }); + }); }); diff --git a/worker/test/ai-gateway/registry-zai.spec.ts b/worker/test/ai-gateway/registry-zai.spec.ts index 0fd8930b99..38e7d2ae4d 100644 --- a/worker/test/ai-gateway/registry-zai.spec.ts +++ b/worker/test/ai-gateway/registry-zai.spec.ts @@ -17,6 +17,13 @@ const canopywaveAuthExpectations = { }, }; +// Define auth expectations for Engy provider +const engyAuthExpectations = { + headers: { + Authorization: /^Bearer /, + }, +}; + describe("Zai Registry Tests", () => { beforeEach(() => { // Clear all mocks between tests @@ -848,4 +855,113 @@ describe("Zai Registry Tests", () => { }, })); }); + + describe("BYOK Tests - glm-5 with Engy Provider", () => { + describe("glm-5.3", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "glm-5.3/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "glm-5.3", + data: createOpenAIMockResponse("glm-5.3"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + + it("should handle tool calls with engy provider", () => + runGatewayTest({ + model: "glm-5.3/engy", + request: { + body: { + messages: [{ role: "user", content: "What's the weather?" }], + tools: [ + { + type: "function", + function: { + name: "get_weather", + description: "Get current weather", + parameters: { + type: "object", + properties: { + location: { type: "string" }, + }, + required: ["location"], + }, + }, + }, + ], + tool_choice: "auto", + temperature: 0.7, + max_tokens: 1000, + }, + }, + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "glm-5.3", + data: createOpenAIMockResponse("glm-5.3"), + expects: { + ...engyAuthExpectations, + bodyContains: [ + "tools", + "tool_choice", + "get_weather", + "temperature", + "max_tokens", + ], + }, + }, + ], + finalStatus: 200, + }, + })); + }); + + describe("glm-5.3-flash", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "glm-5.3-flash/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "glm-5.3-flash", + data: createOpenAIMockResponse("glm-5.3-flash"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + }); + + describe("glm-5.2", () => { + it("should handle engy provider", () => + runGatewayTest({ + model: "glm-5.2/engy", + expected: { + providers: [ + { + url: "https://api.engy.ai/v1/chat/completions", + response: "success", + model: "glm-5.2", + data: createOpenAIMockResponse("glm-5.2"), + expects: engyAuthExpectations, + }, + ], + finalStatus: 200, + }, + })); + }); + }); }); diff --git a/worker/test/setup.ts b/worker/test/setup.ts index 5c4865510d..d18c413260 100644 --- a/worker/test/setup.ts +++ b/worker/test/setup.ts @@ -237,6 +237,15 @@ vi.mock("@supabase/supabase-js", () => ({ config: null, byok_enabled: isByokEnabled, }, + engy: { + org_id: "test-org-id", + provider_name: "engy", + decrypted_provider_key: "test-engy-api-key", + decrypted_provider_secret_key: null, + auth_type: "api_key", + config: null, + byok_enabled: isByokEnabled, + }, nebius: { org_id: "test-org-id", provider_name: "nebius", @@ -431,6 +440,15 @@ vi.mock("@supabase/supabase-js", () => ({ config: null, byok_enabled: true, }, + engy: { + org_id: "0afe3a6e-d095-4ec0-bc1e-2af6f57bd2a5", + provider_name: "engy", + decrypted_provider_key: "helicone-engy-api-key", + decrypted_provider_secret_key: null, + auth_type: "api_key", + config: null, + byok_enabled: true, + }, nebius: { org_id: "0afe3a6e-d095-4ec0-bc1e-2af6f57bd2a5", provider_name: "nebius",