curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"name": "<string>",
"agent": "<string>",
"environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01",
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
],
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "Asia/Shanghai"
},
"description": null,
"metadata": {},
"vault_ids": [],
"resources": []
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/deployments"
payload = {
"name": "<string>",
"agent": "<string>",
"environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01",
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
],
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "Asia/Shanghai"
},
"description": None,
"metadata": {},
"vault_ids": [],
"resources": []
}
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: '<string>',
agent: '<string>',
environment_id: 'env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01',
initial_events: [{type: 'user.message', content: [{type: 'text', text: '<string>'}]}],
schedule: {type: 'cron', expression: '0 9 * * 1-5', timezone: 'Asia/Shanghai'},
description: null,
metadata: {},
vault_ids: [],
resources: []
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/deployments', 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/deployments")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agent\": \"<string>\",\n \"environment_id\": \"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01\",\n \"initial_events\": [\n {\n \"type\": \"user.message\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"schedule\": {\n \"type\": \"cron\",\n \"expression\": \"0 9 * * 1-5\",\n \"timezone\": \"Asia/Shanghai\"\n },\n \"description\": null,\n \"metadata\": {},\n \"vault_ids\": [],\n \"resources\": []\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/deployments"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agent\": \"<string>\",\n \"environment_id\": \"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01\",\n \"initial_events\": [\n {\n \"type\": \"user.message\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"schedule\": {\n \"type\": \"cron\",\n \"expression\": \"0 9 * * 1-5\",\n \"timezone\": \"Asia/Shanghai\"\n },\n \"description\": null,\n \"metadata\": {},\n \"vault_ids\": [],\n \"resources\": []\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/deployments",
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' => '<string>',
'agent' => '<string>',
'environment_id' => 'env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01',
'initial_events' => [
[
'type' => 'user.message',
'content' => [
[
'type' => 'text',
'text' => '<string>'
]
]
]
],
'schedule' => [
'type' => 'cron',
'expression' => '0 9 * * 1-5',
'timezone' => 'Asia/Shanghai'
],
'description' => null,
'metadata' => [
],
'vault_ids' => [
],
'resources' => [
]
]),
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": "<string>",
"type": "deployment",
"name": "<string>",
"agent": {
"type": "agent",
"id": "<string>",
"version": 1
},
"environment_id": "<string>",
"description": "<string>",
"metadata": {},
"resources": [
{
"type": "memory_store",
"memory_store_id": "<string>",
"access": "read_write",
"instructions": "<string>"
}
],
"schedule": {
"type": "cron",
"expression": "<string>",
"timezone": "Asia/Shanghai",
"last_run_at": "<string>",
"upcoming_runs_at": [
"2023-11-07T05:31:56Z"
]
},
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
],
"status": "active",
"paused_reason": {
"type": "manual"
},
"vault_ids": [
"<string>"
],
"archived_at": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}创建 Deployment
创建一个绑定到指定 Agent 版本和 Environment 的 Deployment。initial_events 必须包含 1 至 50 个 user.message 事件,且仅支持文本和 base64 图片内容块。省略 schedule 或传 null 时创建仅支持手动触发的 Deployment;配置 cron 时目前仅支持 Asia/Shanghai 时区,并受平台最小触发间隔限制。可同时绑定 Vault、Memory Store 和 File 资源。点击 Try it 按钮可快速试用。
curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"name": "<string>",
"agent": "<string>",
"environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01",
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
],
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "Asia/Shanghai"
},
"description": null,
"metadata": {},
"vault_ids": [],
"resources": []
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/deployments"
payload = {
"name": "<string>",
"agent": "<string>",
"environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01",
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
],
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "Asia/Shanghai"
},
"description": None,
"metadata": {},
"vault_ids": [],
"resources": []
}
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: '<string>',
agent: '<string>',
environment_id: 'env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01',
initial_events: [{type: 'user.message', content: [{type: 'text', text: '<string>'}]}],
schedule: {type: 'cron', expression: '0 9 * * 1-5', timezone: 'Asia/Shanghai'},
description: null,
metadata: {},
vault_ids: [],
resources: []
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/deployments', 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/deployments")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agent\": \"<string>\",\n \"environment_id\": \"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01\",\n \"initial_events\": [\n {\n \"type\": \"user.message\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"schedule\": {\n \"type\": \"cron\",\n \"expression\": \"0 9 * * 1-5\",\n \"timezone\": \"Asia/Shanghai\"\n },\n \"description\": null,\n \"metadata\": {},\n \"vault_ids\": [],\n \"resources\": []\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/deployments"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agent\": \"<string>\",\n \"environment_id\": \"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01\",\n \"initial_events\": [\n {\n \"type\": \"user.message\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"schedule\": {\n \"type\": \"cron\",\n \"expression\": \"0 9 * * 1-5\",\n \"timezone\": \"Asia/Shanghai\"\n },\n \"description\": null,\n \"metadata\": {},\n \"vault_ids\": [],\n \"resources\": []\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/deployments",
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' => '<string>',
'agent' => '<string>',
'environment_id' => 'env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01',
'initial_events' => [
[
'type' => 'user.message',
'content' => [
[
'type' => 'text',
'text' => '<string>'
]
]
]
],
'schedule' => [
'type' => 'cron',
'expression' => '0 9 * * 1-5',
'timezone' => 'Asia/Shanghai'
],
'description' => null,
'metadata' => [
],
'vault_ids' => [
],
'resources' => [
]
]),
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": "<string>",
"type": "deployment",
"name": "<string>",
"agent": {
"type": "agent",
"id": "<string>",
"version": 1
},
"environment_id": "<string>",
"description": "<string>",
"metadata": {},
"resources": [
{
"type": "memory_store",
"memory_store_id": "<string>",
"access": "read_write",
"instructions": "<string>"
}
],
"schedule": {
"type": "cron",
"expression": "<string>",
"timezone": "Asia/Shanghai",
"last_run_at": "<string>",
"upcoming_runs_at": [
"2023-11-07T05:31:56Z"
]
},
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
],
"status": "active",
"paused_reason": {
"type": "manual"
},
"vault_ids": [
"<string>"
],
"archived_at": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"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
Deployment 名称;trim 后不能为空。
1要固定的 Agent 版本或带覆盖的 Agent 引用;创建后每次运行都使用该固定配置。
1必填的 Environment ID。Environment 必须存在、未归档,并归属于 Agent 所有者。
64^env_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
每次运行时注入的 1–50 条 user.message;内容仅允许文本或 base64 图片。
1 - 50 elementsShow child attributes
Show child attributes
Cron 调度;省略或传 null 时为仅手动运行。
Show child attributes
Show child attributes
用途说明;省略或传 null 时不设置。
客户端自定义元数据;省略时默认为空对象。最多 16 个键,键名长度不超过 64 字符,值必须是长度不超过 512 字符的字符串。
Show child attributes
Show child attributes
挂载到每次运行 Session 的 Vault ID;省略时为空,最多 20 个且不得重复。
201挂载到每次运行 Session 的资源;省略或传 null 时为空。默认平台上限为 500 个 file 与 8 个 memory_store,实际上限可调整;文件 mount_path 不得重叠。
- memory_store
- file
Show child attributes
Show child attributes
Response
请求成功。
deployment Show child attributes
Show child attributes
Deployment 绑定的 Environment ID。旧数据缺失该字段时可能返回内部兼容值 env_default。
用途说明。
客户端自定义元数据;省略时默认为空对象。最多 16 个键,键名长度不超过 64 字符,值必须是长度不超过 512 字符的字符串。
Show child attributes
Show child attributes
- memory_store
- file
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
active, paused 暂停原因。手动暂停返回 manual;因资源失效自动暂停时返回对应错误类型。
- manual
- error
Show child attributes
Show child attributes
归档时间。
创建时间。
更新时间。
Was this page helpful?