创建 Agent
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": {
"type": "max"
},
"speed": "standard"
},
"system": null,
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": []
}
],
"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
}{
"id": "agent_01911111-1111-7111-8111-111111111111",
"type": "agent",
"name": "support-agent",
"description": null,
"model": {
"id": "glm-5.3",
"effort": {
"type": "max"
},
"speed": "standard"
},
"system": null,
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": []
}
],
"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
创建 Agent 及其首个不可变版本,配置模型、系统提示词、工具、Skills 与 MCP。
使用说明
使用说明
创建 Agent 及其首个不可变版本。可配置模型、系统提示词、内置或自定义工具、Skill 和 MCP Server;配置 MCP Server 时必须同时提供引用同名服务器的 mcp_toolset,不使用 MCP 时请省略这两个字段。
POST
/
agent
/
managed
/
v1
/
agents
创建 Agent
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": {
"type": "max"
},
"speed": "standard"
},
"system": null,
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": []
}
],
"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
}{
"id": "agent_01911111-1111-7111-8111-111111111111",
"type": "agent",
"name": "support-agent",
"description": null,
"model": {
"id": "glm-5.3",
"effort": {
"type": "max"
},
"speed": "standard"
},
"system": null,
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": []
}
],
"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..."
}Authorizations
标准的 HTTP Bearer 认证方式,在 API Keys 页面获取密钥。
Headers
Body
application/json
Response
新 beta header 的创建成功响应
Was this page helpful?