Skip to content

Commit 1e25df2

Browse files
committed
zen: minimax m2.5 & glm5
1 parent ffc000d commit 1e25df2

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export async function handler(
110110
providerInfo.modifyBody({
111111
...createBodyConverter(opts.format, providerInfo.format)(body),
112112
model: providerInfo.model,
113+
...(providerInfo.payloadModifier ?? {}),
113114
}),
114115
)
115116
logger.debug("REQUEST URL: " + reqUrl)
@@ -274,8 +275,8 @@ export async function handler(
274275
part = part.trim()
275276
usageParser.parse(part)
276277

277-
if (providerInfo.bodyModifier) {
278-
for (const [k, v] of Object.entries(providerInfo.bodyModifier)) {
278+
if (providerInfo.responseModifier) {
279+
for (const [k, v] of Object.entries(providerInfo.responseModifier)) {
279280
part = part.replace(k, v)
280281
}
281282
c.enqueue(encoder.encode(part + "\n\n"))
@@ -285,7 +286,7 @@ export async function handler(
285286
}
286287
}
287288

288-
if (!providerInfo.bodyModifier && providerInfo.format === opts.format) {
289+
if (!providerInfo.responseModifier && providerInfo.format === opts.format) {
289290
c.enqueue(value)
290291
}
291292

packages/console/core/src/model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ export namespace ZenData {
6262
apiKey: z.string(),
6363
format: FormatSchema.optional(),
6464
headerMappings: z.record(z.string(), z.string()).optional(),
65+
payloadModifier: z.record(z.string(), z.any()).optional(),
6566
family: z.string().optional(),
6667
})
6768

6869
const ProviderFamilySchema = z.object({
6970
headers: z.record(z.string(), z.string()).optional(),
70-
bodyModifier: z.record(z.string(), z.string()).optional(),
71+
responseModifier: z.record(z.string(), z.string()).optional(),
7172
})
7273

7374
const ModelsSchema = z.object({

packages/web/src/content/docs/zen.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ You can also access our models through the following API endpoints.
8282
| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
8383
| Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` |
8484
| Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` |
85-
| MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
85+
| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
8686
| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
87+
| MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
88+
| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
8789
| GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
8890
| GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
8991
| Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
@@ -117,7 +119,9 @@ We support a pay-as-you-go model. Below are the prices **per 1M tokens**.
117119
| --------------------------------- | ------ | ------ | ----------- | ------------ |
118120
| Big Pickle | Free | Free | Free | - |
119121
| MiniMax M2.5 Free | Free | Free | Free | - |
122+
| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - |
120123
| MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - |
124+
| GLM 5 | $1.00 | $3.20 | $0.20 | - |
121125
| GLM 4.7 | $0.60 | $2.20 | $0.10 | - |
122126
| GLM 4.6 | $0.60 | $2.20 | $0.10 | - |
123127
| Kimi K2.5 Free | Free | Free | Free | - |

0 commit comments

Comments
 (0)