2026-06-13 21:08:37 +07:00
|
|
|
import { CLAUDE_API_HEADERS } from "../shared.js";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
id: "glm",
|
2026-06-14 18:49:38 +07:00
|
|
|
priority: 140,
|
2026-06-13 21:08:37 +07:00
|
|
|
alias: "glm",
|
2026-06-14 13:15:48 +07:00
|
|
|
display: {
|
2026-06-14 14:32:59 +07:00
|
|
|
name: "GLM Coding",
|
|
|
|
|
icon: "code",
|
|
|
|
|
color: "#2563EB",
|
|
|
|
|
textIcon: "GL",
|
|
|
|
|
website: "https://open.bigmodel.cn",
|
|
|
|
|
notice: {
|
|
|
|
|
apiKeyUrl: "https://open.bigmodel.cn/usercenter/apikeys",
|
|
|
|
|
},
|
2026-06-14 13:15:48 +07:00
|
|
|
},
|
|
|
|
|
category: "apikey",
|
2026-06-13 21:08:37 +07:00
|
|
|
transport: {
|
|
|
|
|
baseUrl: "https://api.z.ai/api/anthropic/v1/messages",
|
|
|
|
|
format: "claude",
|
2026-06-13 22:00:57 +07:00
|
|
|
urlSuffix: "?beta=true",
|
2026-06-20 10:09:50 +07:00
|
|
|
headers: { ...CLAUDE_API_HEADERS },
|
2026-06-14 14:32:59 +07:00
|
|
|
auth: {
|
|
|
|
|
combined: true,
|
|
|
|
|
header: "x-api-key",
|
|
|
|
|
scheme: "raw",
|
|
|
|
|
},
|
|
|
|
|
usage: {
|
|
|
|
|
url: "https://api.z.ai/api/monitor/usage/quota/limit",
|
|
|
|
|
},
|
2026-06-13 21:08:37 +07:00
|
|
|
},
|
2026-06-20 10:09:50 +07:00
|
|
|
// Multi-endpoint: pick the transport matching client sourceFormat to skip translation.
|
|
|
|
|
transports: [
|
|
|
|
|
{
|
|
|
|
|
format: "openai",
|
|
|
|
|
baseUrl: "https://api.z.ai/api/coding/paas/v4/chat/completions",
|
|
|
|
|
auth: { combined: true, header: "Authorization", scheme: "bearer" },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
format: "claude",
|
|
|
|
|
baseUrl: "https://api.z.ai/api/anthropic/v1/messages",
|
|
|
|
|
urlSuffix: "?beta=true",
|
|
|
|
|
headers: { ...CLAUDE_API_HEADERS },
|
|
|
|
|
auth: { combined: true, header: "x-api-key", scheme: "raw" },
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-06-13 21:08:37 +07:00
|
|
|
models: [
|
2026-06-16 23:32:28 +07:00
|
|
|
{ id: "glm-5.2", name: "GLM 5.2" },
|
2026-06-13 21:08:37 +07:00
|
|
|
{ id: "glm-5.1", name: "GLM 5.1" },
|
|
|
|
|
{ id: "glm-5", name: "GLM 5" },
|
|
|
|
|
{ id: "glm-4.7", name: "GLM 4.7" },
|
2026-06-14 14:32:59 +07:00
|
|
|
{ id: "glm-4.6v", name: "GLM 4.6V (Vision)" },
|
2026-06-14 13:15:48 +07:00
|
|
|
],
|
2026-06-14 14:32:59 +07:00
|
|
|
features: {
|
|
|
|
|
usage: true,
|
|
|
|
|
usageApikey: true,
|
|
|
|
|
},
|
2026-06-13 21:08:37 +07:00
|
|
|
};
|