curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"name": "support-agent",
"model": "glm-5.3",
"system": "你是一个专业的客户支持助手。",
"tools": [
{
"type": "agent_toolset_20260601"
}
]
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents"
payload = {
"name": "support-agent",
"model": "glm-5.3",
"system": "你是一个专业的客户支持助手。",
"tools": [{ "type": "agent_toolset_20260601" }]
}
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'support-agent',
model: 'glm-5.3',
system: '你是一个专业的客户支持助手。',
tools: [{type: 'agent_toolset_20260601'}]
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://agent-api.bigmodel.cn/api/agent/managed/v1/agents")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"support-agent\",\n \"model\": \"glm-5.3\",\n \"system\": \"你是一个专业的客户支持助手。\",\n \"tools\": [\n {\n \"type\": \"agent_toolset_20260601\"\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents"
payload := strings.NewReader("{\n \"name\": \"support-agent\",\n \"model\": \"glm-5.3\",\n \"system\": \"你是一个专业的客户支持助手。\",\n \"tools\": [\n {\n \"type\": \"agent_toolset_20260601\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("zai-version", "<zai-version>")
req.Header.Add("zai-beta", "<zai-beta>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'support-agent',
'model' => 'glm-5.3',
'system' => '你是一个专业的客户支持助手。',
'tools' => [
[
'type' => 'agent_toolset_20260601'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"zai-beta: <zai-beta>",
"zai-version: <zai-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "agent_01911111-1111-7111-8111-111111111111",
"type": "agent",
"name": "support-agent",
"description": null,
"model": {
"id": "glm-5.3",
"effort": "max",
"speed": "standard"
},
"system": null,
"tools": [
{
"type": "agent_toolset_20260601"
}
],
"skills": [],
"mcp_servers": [],
"metadata": {},
"multiagent": null,
"version": 1,
"created_at": "2026-08-31T08:00:00.000Z",
"updated_at": "2026-08-31T08:00:00.000Z",
"archived_at": null
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}创建 Agent
创建 Agent 及其首个不可变版本。可配置模型、系统提示词、内置或自定义工具、Skill 和 MCP Server;配置 MCP Server 时必须同时提供引用同名服务器的 mcp_toolset,不使用 MCP 时请省略这两个字段。点击 Try it 按钮可快速试用。
curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"name": "support-agent",
"model": "glm-5.3",
"system": "你是一个专业的客户支持助手。",
"tools": [
{
"type": "agent_toolset_20260601"
}
]
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents"
payload = {
"name": "support-agent",
"model": "glm-5.3",
"system": "你是一个专业的客户支持助手。",
"tools": [{ "type": "agent_toolset_20260601" }]
}
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'support-agent',
model: 'glm-5.3',
system: '你是一个专业的客户支持助手。',
tools: [{type: 'agent_toolset_20260601'}]
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://agent-api.bigmodel.cn/api/agent/managed/v1/agents")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"support-agent\",\n \"model\": \"glm-5.3\",\n \"system\": \"你是一个专业的客户支持助手。\",\n \"tools\": [\n {\n \"type\": \"agent_toolset_20260601\"\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents"
payload := strings.NewReader("{\n \"name\": \"support-agent\",\n \"model\": \"glm-5.3\",\n \"system\": \"你是一个专业的客户支持助手。\",\n \"tools\": [\n {\n \"type\": \"agent_toolset_20260601\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("zai-version", "<zai-version>")
req.Header.Add("zai-beta", "<zai-beta>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'support-agent',
'model' => 'glm-5.3',
'system' => '你是一个专业的客户支持助手。',
'tools' => [
[
'type' => 'agent_toolset_20260601'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"zai-beta: <zai-beta>",
"zai-version: <zai-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "agent_01911111-1111-7111-8111-111111111111",
"type": "agent",
"name": "support-agent",
"description": null,
"model": {
"id": "glm-5.3",
"effort": "max",
"speed": "standard"
},
"system": null,
"tools": [
{
"type": "agent_toolset_20260601"
}
],
"skills": [],
"mcp_servers": [],
"metadata": {},
"multiagent": null,
"version": 1,
"created_at": "2026-08-31T08:00:00.000Z",
"updated_at": "2026-08-31T08:00:00.000Z",
"archived_at": null
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}Headers
Managed Agents API 协议版本,固定为 2026-05-26。
2026-05-26 "2026-05-26"
必须包含 managed-agents-2026-05-26;可与其他 beta 标识用逗号分隔。
"managed-agents-2026-05-26"
Body
Agent 名称,长度 1–256 个字符。
1 - 256模型 ID,或包含推理强度与速度的模型配置。当前仅支持 glm-5.3 与 glm-5.3-flash。使用字符串简写时,服务端按模型补齐默认 effort,并将 speed 补为 standard。
glm-5.3, glm-5.3-flash "glm-5.3"
系统提示词;省略或传 null 时不设置。
100000Agent 用途说明;省略或传 null 时不设置。
2048工具集列表;省略时为空。MCP Server 必须与 mcp_toolset 按名称一一对应;配置 Skill 时必须包含 agent_toolset_20260601。
128- agent_toolset_20260601
- mcp_toolset
- custom
Show child attributes
Show child attributes
固定版本的 Skill 引用;省略时为空,同一 skill_id 与 version 组合不得重复。配置 Skill 时必须同时配置 agent_toolset_20260601。
20Show child attributes
Show child attributes
MCP Server 列表;省略时为空。名称必须唯一,并且每个 Server 必须恰好对应一个同名 mcp_toolset。
20Show child attributes
Show child attributes
客户端自定义元数据;省略时默认为空对象。最多 16 个键,键名长度不超过 64 字符,值必须是长度不超过 512 字符的字符串。
Show child attributes
Show child attributes
Response
请求成功。
Agent ID。
"agent_01911111-1111-7111-8111-111111111111"
agent 用途说明。
Show child attributes
Show child attributes
系统提示词。
- agent_toolset_20260601
- mcp_toolset
- custom
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
客户端自定义元数据;省略时默认为空对象。最多 16 个键,键名长度不超过 64 字符,值必须是长度不超过 512 字符的字符串。
Show child attributes
Show child attributes
x >= 0创建时间。
更新时间。
归档时间;未归档时为 null。
当前暂未支持,默认为 null。
Was this page helpful?