帮助与文档 > 产品文档 > 大模型 > API文档 > GLM-5
GLM-5

GLM-5

模型代码:glm-5

技术规格

项目 规格
模型参数 7440 亿(MoE 架构,激活约 400 亿参数)
训练数据 28.5 万亿 Tokens
上下文长度 200K
最大输出 Token 128K
支持语言 中文, 英文, 多语言
多模态能力 ✗ 不支持

核心能力

  • 面向 Agentic Engineering 的通用智能体基座
  • 复杂系统工程
  • 长程 Agent 任务
  • 代码生成
  • 逻辑推理
  • 多种思考模式

API 示例

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://openapi.youdao.com/llmgateway/api/v1",
    api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="glm-5",
    messages=[
        {"role": "user", "content": "你好,请介绍一下你自己"}
    ],
    stream=False
)

print(response.choices[0].message.content)

JavaScript

import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://openapi.youdao.com/llmgateway/api/v1',
  apiKey: 'YOUR_API_KEY',
});

async function chat() {
  const response = await client.chat.completions.create({
    model: 'glm-5',
    messages: [{ role: 'user', content: '你好,请介绍一下你自己' }],
  });
  console.log(response.choices[0].message.content);
}

chat();

cURL

curl https://openapi.youdao.com/llmgateway/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "glm-5",
    "messages": [
      {"role": "system", "content": "你是人工智能助手"},
      {"role": "user", "content": "你是谁?"}
    ],
    "stream": false
  }'