列出会话线程
curl --request GET \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads \
--header 'Authorization: Bearer <token>' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads"
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>'
}
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("zai-version", "<zai-version>")
req.Header.Add("zai-beta", "<zai-beta>")
req.Header.Add("Authorization", "Bearer <token>")
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/sessions/{sessionId}/threads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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;
}{
"data": [
{
"id": "<string>",
"type": "session_thread",
"session_id": "<string>",
"parent_thread_id": "<string>",
"agent": {
"id": "<string>",
"type": "agent",
"name": "<string>",
"model": {
"id": "glm-5.3",
"speed": "standard",
"effort": {
"type": "low"
}
},
"system": "<string>",
"description": "<string>",
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": [
{
"name": "read",
"enabled": true,
"permission_policy": {
"type": "always_allow"
},
"type": "read"
}
]
}
],
"skills": [
{
"type": "custom",
"skill_id": "<string>",
"version": "latest"
}
],
"mcp_servers": [
{
"type": "url",
"name": "knowledge-base",
"url": "https://mcp.example.com/mcp"
}
],
"version": 1
},
"status": "running",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"stats": {
"startup_seconds": 123,
"active_seconds": 123,
"duration_seconds": 123
},
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_read_input_tokens": 123,
"active_seconds": 123
},
"workflow_run_id": "<string>"
}
],
"next_page": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}Thread
列出会话线程
列出指定 Session 的线程,包括主线程与成员线程,用于查看状态和继续交互。
GET
/
agent
/
managed
/
v1
/
sessions
/
{sessionId}
/
threads
列出会话线程
curl --request GET \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads \
--header 'Authorization: Bearer <token>' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads"
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>'
}
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/sessions/{sessionId}/threads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("zai-version", "<zai-version>")
req.Header.Add("zai-beta", "<zai-beta>")
req.Header.Add("Authorization", "Bearer <token>")
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/sessions/{sessionId}/threads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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;
}{
"data": [
{
"id": "<string>",
"type": "session_thread",
"session_id": "<string>",
"parent_thread_id": "<string>",
"agent": {
"id": "<string>",
"type": "agent",
"name": "<string>",
"model": {
"id": "glm-5.3",
"speed": "standard",
"effort": {
"type": "low"
}
},
"system": "<string>",
"description": "<string>",
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": [
{
"name": "read",
"enabled": true,
"permission_policy": {
"type": "always_allow"
},
"type": "read"
}
]
}
],
"skills": [
{
"type": "custom",
"skill_id": "<string>",
"version": "latest"
}
],
"mcp_servers": [
{
"type": "url",
"name": "knowledge-base",
"url": "https://mcp.example.com/mcp"
}
],
"version": 1
},
"status": "running",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"stats": {
"startup_seconds": 123,
"active_seconds": 123,
"duration_seconds": 123
},
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_read_input_tokens": 123,
"active_seconds": 123
},
"workflow_run_id": "<string>"
}
],
"next_page": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}Headers
Managed Agents API 入口要求的基础协议标识,当前只接受 2026-05-26;响应兼容形态由 zai-beta 选择。两个头均需携带。
Available options:
2026-05-26 Example:
"2026-05-26"
声明 Managed Agents Beta 协议并选择响应字段与兼容行为。新接入使用 managed-agents-2026-09-22;旧客户端仍可使用 managed-agents-2026-05-26。必须同时携带 zai-version: 2026-05-26。字段差异见 /cn/managed-agents/protocol-versions。
Example:
"managed-agents-2026-09-22"
Path Parameters
Query Parameters
Required range:
x >= 1Available options:
idle, running, rescheduling, terminated Was this page helpful?