GLM PPT 是面向职场人与创作者的新一代智能工具。基于 GLM 大模型深度驱动,区别于传统工程化拼接方案,实现从自然语言指令到可交互幻灯片的一键生成。深度融合内容生成与设计规范,可快速交付专业级作品,降低设计门槛,提升内容生产效率。

价格

  • 按 Tokens 消耗后付费,5 元/百万 Tokens
  • 计量范围:智能体全任务流节点产生的 Tokens 总数

用户并发权益

API 调用会受到速率限制,当前我们限制的维度是请求并发数量(在途请求任务数量)。不同等级的用户并发保障如下。
V0V1V2V3
10152030

GLM PPT

接口请求

传输方式https
请求地址https://open.bigmodel.cn/api/v1/agents
调用方式同步调用,等待模型完成执行并返回最终结果或使用SSE调用
字符编码UTF-8
接口请求格式JSON
响应格式JSON 或标准 Stream Event
接口请求类型POST
开发语言支持任意可发起 http 请求的开发语言

请求参数

参数名称类型是否必填参数说明
agent_idString智能体 ID:slides_glm_agent
messagesList<Object>会话消息体
conversation_idString会话id
streamString目前只支持流式,必须传 true
└─ roleString用户的输入 role = user
└─ contentList<Object>会话内容
    └─ typeString目前支持内容类型,目前仅支持 text
    └─ textString具体内容,例如:“帮我生成一个关于人工智能技术发展的市场调研”

响应参数

字段名称字段类型备注
idString请求唯一ID
agent_idString当前 agent id
conversation_idString当前对话的唯一ID
choicesList<Object>智能体响应选项
└─ indexNumber事件编号,单调递增
└─ messagesList<Object>智能体响应消息体
    └─ roleString智能体的角色 role = assistant
    └─ phaseString当前角色的状态:思考-thinking
使用工具-tool、回答-answer
    └─ contentList<Object>智能体响应内容
        └─ typeString响应内容类型:文本-text、对象-object
        └─ tag_cnString标签(中文),例如:插入幻灯片
        └─ tag_enString标签(英文),例如:Insert Page
        └─ textString如果 type = text,则这个字段以
字符串格式给出具体内容
        └─ objectObject如果 type = object,则这个字段
以对象格式给出具体内容
            └─ tool_nameString工具唯一标识,例如:searchinsert_page
            └─ inputString调用工具的输入。
例如,搜索时,此字段给出了具体的搜索词
            └─ outputString工具执行后的输出。
例如,生成幻灯片时,HTML 内容通过此字段输出
            └─ positionList<Number>如果工具涉及到 PPT 的操作,position 字段指明具体操作哪几页 slides;
例如:
• 当用户输入「在第二页之后插入一张幻灯片」,则 position = [3]output 是第三页幻灯片的 HTML 内容
• 当用户输入「请删除第四、五、六页幻灯片」,则 position = [4, 5, 6]

请求示例

curl --location --request POST 'https://open.bigmodel.cn/api/v1/agents' \
--header 'Authorization: {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "agent_id": "slides_glm_agent",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "帮我生成一个游戏主机市场发展调研"
                }
            ]
        }
    ]
}'

响应示例

// 第一次 event
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 0,
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "text",
                            "text": "我需要为"
                        }
                    ],
                    "phase": "thinking" 
                }
            ]
        }
    ]
}

// 第二次 event
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 1,
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "text",
                            "text": "用户生成一个"
                        }
                    ],
                    "phase": "thinking"
                }
            ]
        }
    ]
}

// 命中工具
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 2,
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "object",
                            "object": {
                                "tool_name" : "search",
                                "input" : "搜索词"
                            },
                            "tag_cn": "搜索",
                            "tag_en": "Search"
                        }
                    ]
                    "phase": "tool"
                }
            ]
        }
    ]
}

// 命中工具
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 3,
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "object",
                            "object": {
                                "tool_name" : "search",
                                "output" : "搜索结果"
                            },
                            "tag_cn": "搜索",
                            "tag_en": "Search"
                        }
                    ],
                    "phase": "tool"
                }
            ]
        }
    ],
}

// 命中工具
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 4,
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "object",
                            "object": {
                                "tool_name" : "insert_page",
                                "input": "创建中国游戏主机市场现状与机遇页,详细介绍中..."
                            },
                            "tag_cn": "插入幻灯片",
                            "tag_en": "Insert Page"
                        }
                    ],
                    "phase": "tool"
                }
            ]
        }
    ]
}

// 命中工具
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 5,
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "object",
                            "object": {
                                "tool_name" : "insert_page",
                                "output" : "html doc",
                                "position": [1],
                                "title":"标题"
                            },
                            "tag_cn": "添加幻灯片",
                            "tag_en": "Insert Page"
                        }
                    ],
                    "phase": "tool"
                }
            ]
        }
    ],
}

// 命中工具
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 5,
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "object",
                            "object": {
                                "tool_name" : "remove_slides",
                                "position": [1,2,3]
                            },
                            "tag_cn": "删除幻灯片",
                            "tag_en": "Remove Pages"
                        }
                    ],
                    "phase": "tool"
                }
            ]
        }
    ],
}

// assistant answer
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 6,
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "text",
                            "text": "文案"
                        }
                    ],
                    "phase": "answer"
                }
            ]
        }
    ]
}

// 最后一次 event
{
    "id": "202507221412023db1a56fc77943d8",
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 123,
            "finish_reason": "stop"
            "messages": [
                ...
            ],
        }
    ],
    "usage": {
        "prompt_tokens": 100,
        "completion_tokens": 200,
        "total_tokens": 300
    },
    // 如果 finish_reason != stop,出现 error 字段;
    "error": {
        "code": "1301",
        "message": "系统检测到输入或生成内容可能包含不安全或敏感内容"
    }
}

导出PDF

接口请求

传输方式https
请求地址https://open.bigmodel.cn/api/v1/agents/conversation/
调用方式同步调用,等待模型完成执行并返回最终结果或使用SSE调用
字符编码UTF-8
接口请求格式JSON
响应格式JSON
接口请求类型POST
开发语言支持任意可发起 http 请求的开发语言

请求参数

字段名称字段类型是否必填备注
agent_idString智能体 ID,ID值:slides_glm_agent
conversation_idString当前对话的唯一ID
custom_variablesObject自定义参数
└─ include_pdfBoolean是否导出 PDF 文件
└─ include_htmlBoolean是否导出 HTML 文件

响应参数

字段名称字段类型备注
agent_idString固定值:slides_glm_agent
conversation_idString当前对话的唯一ID
choicesList<Object>智能体响应选项
└─ messagesList<Object>智能体响应消息体
    └─ roleString智能体的角色 role = assistant
    └─ contentList<Object>智能体响应内容
        └─ typeString响应内容类型:文件下载链接-file_url
图片下载链接-image_url
        └─ tag_cnString标签(中文),例如:市场调研.pdf
        └─ tag_enString标签(英文),例如:market research.pdf
        └─ file_urlString如果 type = file_url
则这个字段给出文件的具体下载链接
        └─ image_urlString如果 type = image_url
则这个字段给出图片的具体下载链接

请求示例

{
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "custom_variables": {
        "include_pdf": true
    }
}

响应示例

{
    "agent_id": "slides_glm_agent",
    "conversation_id": "1750756263-a0e8bc1e2ee14879810025009e2ff693",
    "choices": [
        {
            "index": 0,
            "finish_reason": "stop",
            "messages": [
                {
                    "role": "assistant",
                    "content": [
                        {
                            "type": "file_url",
                            "file_url": "https://xxx.cn",
                            "tag_cn": "市场调研.pdf",
                            "tag_en": "market research.pdf"
                        }                        
                    ],
                    "phase": "answer"
                }
            ]
        }
    ]
}