{
  "openapi": "3.0.1",
  "info": {
    "title": "ZHIPU AI API",
    "description": "ZHIPU AI 接口提供强大的 AI 能力，包括聊天对话、工具调用和视频生成。",
    "license": {
      "name": "ZHIPU AI 开发者协议和政策",
      "url": "https://chat.z.ai/legal-agreement/terms-of-service"
    },
    "version": "1.0.0",
    "contact": {
      "name": "Z.AI 开发者",
      "url": "https://chat.z.ai/legal-agreement/privacy-policy",
      "email": "user_feedback@z.ai"
    }
  },
  "tags": [
    {
      "name": "模型 API",
      "description": "Chat API"
    },
    {
      "name": "工具 API",
      "description": "Web Search API"
    },
    {
      "name": "Agent API",
      "description": "Agent API"
    },
    {
      "name": "文件 API",
      "description": "File API"
    },
    {
      "name": "知识库 API",
      "description": "Knowledge API"
    },
    {
      "name": "实时 API",
      "description": "Realtime API"
    },
    {
      "name": "批处理 API",
      "description": "Batch API"
    },
    {
      "name": "助理 API",
      "description": "Assistant API"
    },
    {
      "name": "智能体 API（旧）",
      "description": "QingLiu Agent API"
    },
    {
      "name": "Managed Agents - Agent",
      "description": "Agent 与版本管理。"
    },
    {
      "name": "Managed Agents - Environment",
      "description": "声明式执行环境管理。"
    },
    {
      "name": "Managed Agents - Session",
      "description": "Session、Resource 与事件流。"
    },
    {
      "name": "Managed Agents - File",
      "description": "Managed Files 上传、读取与删除。"
    },
    {
      "name": "Managed Agents - Memory",
      "description": "Memory Store、Memory 与版本管理。"
    },
    {
      "name": "Managed Agents - Vault",
      "description": "Vault 与 Credential 管理。"
    },
    {
      "name": "Managed Agents - Skill",
      "description": "自定义 Skill 与版本管理。"
    },
    {
      "name": "Managed Agents - Deployment",
      "description": "定时或手动 Deployment 与运行记录。"
    },
    {
      "name": "Channel",
      "description": "渠道管理；Agent 运行仍通过 Managed Session 和 Events API。",
      "x-group": "Channel"
    },
    {
      "name": "Thread",
      "description": "会话线程",
      "x-group": "Thread"
    }
  ],
  "servers": [
    {
      "url": "https://open.bigmodel.cn/api/",
      "description": "开放平台服务"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/paas/v4/chat/completions": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "对话补全",
        "description": "和 [指定模型](/cn/guide/start/model-overview) 对话，模型根据请求给出响应。支持多种模型，支持多模态（文本、图片、音频、视频、文件），流式和非流式输出，可配置采样，温度，最大令牌数，工具调用等。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "文本模型",
                    "$ref": "#/components/schemas/ChatCompletionTextRequest"
                  },
                  {
                    "title": "视觉模型",
                    "$ref": "#/components/schemas/ChatCompletionVisionRequest"
                  },
                  {
                    "title": "音频模型",
                    "$ref": "#/components/schemas/ChatCompletionAudioRequest"
                  }
                ]
              },
              "examples": {
                "基础调用示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "system",
                        "content": "你是编程助手，擅长写简洁高效的代码。"
                      },
                      {
                        "role": "user",
                        "content": "写一个 Python 函数，计算斐波那契数列第 n 项。"
                      }
                    ],
                    "temperature": 1,
                    "stream": false
                  }
                },
                "流式调用示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "user",
                        "content": "请写一个Python函数，计算两个数的和。"
                      }
                    ],
                    "temperature": 1,
                    "stream": true
                  }
                },
                "深度思考示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "user",
                        "content": "请写一个Python函数，计算两个数的和。"
                      }
                    ],
                    "thinking": {
                      "type": "enabled"
                    },
                    "stream": true
                  }
                },
                "多轮对话示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "system",
                        "content": "你是一个专业的编程助手"
                      },
                      {
                        "role": "user",
                        "content": "什么是递归？"
                      },
                      {
                        "role": "assistant",
                        "content": "递归是一种编程技术，函数调用自身来解决问题..."
                      },
                      {
                        "role": "user",
                        "content": "能给我一个 Python 递归的例子吗？"
                      }
                    ],
                    "stream": true
                  }
                },
                "图片理解示例": {
                  "value": {
                    "model": "glm-5.3-flash",
                    "messages": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "image_url",
                            "image_url": {
                              "url": "https://cdn.bigmodel.cn/static/logo/register.png"
                            }
                          },
                          {
                            "type": "image_url",
                            "image_url": {
                              "url": "https://cdn.bigmodel.cn/static/logo/api-key.png"
                            }
                          },
                          {
                            "type": "text",
                            "text": "What are the pics talk about"
                          }
                        ]
                      }
                    ]
                  }
                },
                "视频理解示例": {
                  "value": {
                    "model": "glm-5.3-flash",
                    "messages": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "video_url",
                            "video_url": {
                              "url": "https://cdn.bigmodel.cn/agent-demos/lark/113123.mov"
                            }
                          },
                          {
                            "type": "text",
                            "text": "What are the video show about?"
                          }
                        ]
                      }
                    ]
                  }
                },
                "文件理解示例": {
                  "value": {
                    "model": "glm-5.3-flash",
                    "messages": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "file",
                            "file": {
                              "file_url": "https://cdn.bigmodel.cn/static/demo/demo2.txt"
                            }
                          },
                          {
                            "type": "file",
                            "file": {
                              "file_url": "https://cdn.bigmodel.cn/static/demo/demo1.pdf"
                            }
                          },
                          {
                            "type": "text",
                            "text": "What are the files show about?"
                          }
                        ]
                      }
                    ]
                  }
                },
                "音频对话示例": {
                  "value": {
                    "model": "glm-4-voice",
                    "messages": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "text",
                            "text": "你好，这是我的语音输入测试，请慢速复述一遍"
                          },
                          {
                            "type": "input_audio",
                            "input_audio": {
                              "data": "base64_voice_xxx",
                              "format": "wav"
                            }
                          }
                        ]
                      }
                    ]
                  }
                },
                "Function Call 示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "user",
                        "content": "今天北京的天气怎么样？"
                      }
                    ],
                    "tools": [
                      {
                        "type": "function",
                        "function": {
                          "name": "get_weather",
                          "description": "获取指定城市的天气信息",
                          "parameters": {
                            "type": "object",
                            "properties": {
                              "city": {
                                "type": "string",
                                "description": "城市名称"
                              }
                            },
                            "required": [
                              "city"
                            ]
                          }
                        }
                      }
                    ],
                    "tool_choice": "auto",
                    "temperature": 0.3
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionChunk"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/async/chat/completions": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "对话补全(异步)",
        "description": "和 [指定模型](/cn/guide/start/model-overview) 对话，通过查询异步结果获取模型响应。支持多种模型，支持多模态（文本、图片、音频、视频、文件），可配置采样，温度，最大令牌数，工具调用等。注意此为异步接口，通过 [查询异步结果](/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%9F%A5%E8%AF%A2%E5%BC%82%E6%AD%A5%E7%BB%93%E6%9E%9C) 获取生成结果。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "文本模型",
                    "$ref": "#/components/schemas/AsyncChatCompletionTextRequest"
                  },
                  {
                    "title": "视觉模型",
                    "$ref": "#/components/schemas/AsyncChatCompletionVisionRequest"
                  },
                  {
                    "title": "音频模型",
                    "$ref": "#/components/schemas/AsyncChatCompletionAudioRequest"
                  }
                ]
              },
              "examples": {
                "基础调用示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "system",
                        "content": "你是编程助手，擅长写简洁高效的代码。"
                      },
                      {
                        "role": "user",
                        "content": "写一个 Python 函数，计算斐波那契数列第 n 项。"
                      }
                    ],
                    "temperature": 1
                  }
                },
                "深度思考示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "user",
                        "content": "写一个 Python 函数，计算斐波那契数列第 n 项。"
                      }
                    ],
                    "thinking": {
                      "type": "enabled"
                    }
                  }
                },
                "多轮对话示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "system",
                        "content": "你是一个专业的编程助手"
                      },
                      {
                        "role": "user",
                        "content": "什么是递归？"
                      },
                      {
                        "role": "assistant",
                        "content": "递归是一种编程技术，函数调用自身来解决问题..."
                      },
                      {
                        "role": "user",
                        "content": "能给我一个 Python 递归的例子吗？"
                      }
                    ]
                  }
                },
                "图片理解示例": {
                  "value": {
                    "model": "glm-5.3-flash",
                    "messages": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "image_url",
                            "image_url": {
                              "url": "https://cdn.bigmodel.cn/static/logo/register.png"
                            }
                          },
                          {
                            "type": "image_url",
                            "image_url": {
                              "url": "https://cdn.bigmodel.cn/static/logo/api-key.png"
                            }
                          },
                          {
                            "type": "text",
                            "text": "What are the pics talk about?"
                          }
                        ]
                      }
                    ]
                  }
                },
                "视频理解示例": {
                  "value": {
                    "model": "glm-5.3-flash",
                    "messages": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "video_url",
                            "video_url": {
                              "url": "https://cdn.bigmodel.cn/agent-demos/lark/113123.mov"
                            }
                          },
                          {
                            "type": "text",
                            "text": "What are the video show about?"
                          }
                        ]
                      }
                    ]
                  }
                },
                "文件理解示例": {
                  "value": {
                    "model": "glm-5.3-flash",
                    "messages": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "file_url",
                            "file_url": {
                              "url": "https://cdn.bigmodel.cn/static/demo/demo2.txt"
                            }
                          },
                          {
                            "type": "file_url",
                            "file_url": {
                              "url": "https://cdn.bigmodel.cn/static/demo/demo1.pdf"
                            }
                          },
                          {
                            "type": "text",
                            "text": "What are the files show about?"
                          }
                        ]
                      }
                    ]
                  }
                },
                "音频对话示例": {
                  "value": {
                    "model": "glm-4-voice",
                    "messages": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "text",
                            "text": "你好，这是我的语音输入测试，请慢速复述一遍"
                          },
                          {
                            "type": "input_audio",
                            "input_audio": {
                              "data": "base64_voice_xxx",
                              "format": "wav"
                            }
                          }
                        ]
                      }
                    ]
                  }
                },
                "Function Call 示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "user",
                        "content": "今天北京的天气怎么样？"
                      }
                    ],
                    "tools": [
                      {
                        "type": "function",
                        "function": {
                          "name": "get_weather",
                          "description": "获取指定城市的天气信息",
                          "parameters": {
                            "type": "object",
                            "properties": {
                              "city": {
                                "type": "string",
                                "description": "城市名称"
                              }
                            },
                            "required": [
                              "city"
                            ]
                          }
                        }
                      }
                    ],
                    "tool_choice": "auto",
                    "temperature": 0.3
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/videos/generations": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "视频生成(异步)",
        "description": "通过调用 [视频模型](/cn/guide/models/video-generation/cogvideox-3) 能力生成视频内容。支持多种视频生成方式，包括文本转视频、图像转视频等。注意此为异步接口，通过 [查询异步结果](/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%9F%A5%E8%AF%A2%E5%BC%82%E6%AD%A5%E7%BB%93%E6%9E%9C) 获取生成视频结果。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "CogVideoX-3",
                    "$ref": "#/components/schemas/CogVideoX3Request"
                  },
                  {
                    "title": "CogVideoX",
                    "$ref": "#/components/schemas/CogVideoXRequest"
                  },
                  {
                    "title": "Vidu: Text to Video",
                    "$ref": "#/components/schemas/ViduText2VideoRequest"
                  },
                  {
                    "title": "Vidu: Image to Video",
                    "$ref": "#/components/schemas/ViduImage2VideoRequest"
                  },
                  {
                    "title": "Vidu: First & Last Frame to Video",
                    "$ref": "#/components/schemas/ViduFrames2VideoRequest"
                  },
                  {
                    "title": "Vidu: Ref to Video",
                    "$ref": "#/components/schemas/ViduReference2VideoRequest"
                  }
                ]
              },
              "examples": {
                "文生视频示例": {
                  "value": {
                    "model": "cogvideox-3",
                    "prompt": "A cat is playing with a ball.",
                    "quality": "quality",
                    "with_audio": true,
                    "size": "1920x1080",
                    "fps": 30
                  }
                },
                "图生视频示例": {
                  "value": {
                    "model": "cogvideox-3",
                    "image_url": "https://img.iplaysoft.com/wp-content/uploads/2019/free-images/free_stock_photo.jpg",
                    "prompt": "让画面动起来",
                    "quality": "quality",
                    "with_audio": true,
                    "size": "1920x1080",
                    "fps": 30
                  }
                },
                "首尾帧生示例": {
                  "value": {
                    "model": "cogvideox-3",
                    "image_url": [
                      "https://cdn.bigmodel.cn/markdown/1752547801491cogvideo4.png",
                      "https://cdn.bigmodel.cn/markdown/1752547813297cogvideo5.png"
                    ],
                    "prompt": "让画面动起来",
                    "quality": "quality",
                    "with_audio": true,
                    "size": "1920x1080",
                    "fps": 30
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/async/images/generations": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "图像生成(异步)",
        "description": "使用 [GLM-Image](/cn/guide/models/image-generation/glm-image) 系列模型从文本提示生成高质量图像。通过对用户文字描述快速、精准的理解，让 `AI` 的图像表达更加精确和个性化。仅支持 `GLM-Image` 模型。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AsyncCreateImageRequest"
              },
              "examples": {
                "图像生成示例": {
                  "value": {
                    "model": "glm-image",
                    "prompt": "一只可爱的小猫咪，坐在阳光明媚的窗台上，背景是蓝天白云.",
                    "size": "1280x1280"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/async-result/{id}": {
      "get": {
        "tags": [
          "模型 API"
        ],
        "summary": "查询异步结果",
        "description": "查询对话补全和视频生成异步请求的处理结果和状态。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "任务 ID。"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "对话补全",
                      "$ref": "#/components/schemas/ChatCompletionResponse"
                    },
                    {
                      "title": "视频生成",
                      "$ref": "#/components/schemas/AsyncVideoGenerationResponse"
                    },
                    {
                      "title": "图像生成",
                      "$ref": "#/components/schemas/AsyncImageGenerationResponse"
                    }
                  ]
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionChunk"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/images/generations": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "图像生成",
        "description": "使用 [GLM-Image](/cn/guide/models/image-generation/glm-image) 等系列模型从文本提示生成高质量图像。通过对用户文字描述快速、精准的理解，让 `AI` 的图像表达更加精确和个性化。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateImageRequest"
              },
              "examples": {
                "图像生成示例": {
                  "value": {
                    "model": "glm-image",
                    "prompt": "一只可爱的小猫咪，坐在阳光明媚的窗台上，背景是蓝天白云.",
                    "size": "1280x1280"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageGenerationResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/audio/transcriptions": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "语音转文本",
        "description": "使用 [GLM-ASR-2512](/cn/guide/models/sound-and-video/glm-asr-2512) 模型将音频文件转录为文本，支持多语言和实时流式转录。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/AudioTranscriptionRequest"
              },
              "example": {
                "model": "glm-asr-2512",
                "stream": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionStreamResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/audio/speech": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "文本转语音",
        "description": "使用 `GLM-TTS` 将文本转换为自然语音，支持多种声音、情感控制和语调调整。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudioSpeechRequest"
              },
              "examples": {
                "文本转语音示例": {
                  "value": {
                    "model": "glm-tts",
                    "input": "你好，今天天气怎么样.",
                    "voice": "tongtong",
                    "response_format": "wav"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功 \n - 采样率建议设置为24000",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/voice/clone": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "音色复刻",
        "description": "使用音色复刻技术，基于示例音频生成指定音色、文本内容的语音合成。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceCloneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceCloneResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/voice/list": {
      "get": {
        "tags": [
          "模型 API"
        ],
        "summary": "音色列表",
        "description": "获取音色列表，支持按音色名称模糊搜索、按音色类型过滤。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "voiceName",
            "in": "query",
            "description": "音色名称, 如果传入中文, 需要 url encode",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "voiceType",
            "in": "query",
            "description": "音色类型",
            "schema": {
              "type": "string",
              "enum": [
                "PRIVATE",
                "OFFICIAL"
              ]
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceListResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/voice/delete": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "删除音色",
        "description": "删除指定的音色。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSaveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSaveResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/embeddings": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "文本嵌入",
        "description": "使用 [GLM Embedding](/cn/guide/models/embedding/embedding-3) 系列模型将文本转换为高维向量表示，用于语义相似性和搜索。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingCreateRequest"
              },
              "examples": {
                "文本嵌入示例": {
                  "value": {
                    "model": "embedding-3",
                    "input": "你好，今天天气怎么样.",
                    "dimensions": 2
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/rerank": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "文本重排序",
        "description": "`Rerank` 用于文本重排序，通过接收用户的查询文本及候选文本列表，使用模型计算候选文本与查询文本的相关性得分并返回分数。适用于智能问答、信息检索等场景。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RerankRequest"
              },
              "examples": {
                "文本重排序示例": {
                  "value": {
                    "model": "rerank",
                    "query": "查询候选文本A",
                    "top_n": 4,
                    "documents": [
                      "需要打分的候选文本A",
                      "需要打分的候选文本B"
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RerankResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/tokenizer": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "文本分词器",
        "description": "`Tokenizer` 用于将文本切分为模型可识别的 `token` 并计算数量。它接收用户输入的文本，通过模型进行分词处理，最终返回对应的 `token` 数量。适用于文本长度评估、模型输入预估、对话上下文截断、费用计算等。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenizerRequest"
              },
              "examples": {
                "文本分词示例": {
                  "value": {
                    "model": "glm-5.3",
                    "messages": [
                      {
                        "role": "user",
                        "content": "What opportunities and challenges will the Chinese large model industry face in 2025?"
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenizerResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/layout_parsing": {
      "post": {
        "tags": [
          "模型 API"
        ],
        "summary": "文档解析",
        "description": "使用 [GLM-OCR](/cn/guide/models/vlm/glm-ocr) 模型解析文档和图片的布局并提取文本内容。支持图片和`PDF`文档的`OCR`识别，返回详细的布局信息和可视化结果。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LayoutParsingRequest"
              },
              "examples": {
                "布局解析示例": {
                  "value": {
                    "model": "glm-ocr",
                    "file": "https://cdn.bigmodel.cn/static/logo/introduction.png"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LayoutParsingResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/web_search": {
      "post": {
        "tags": [
          "工具 API"
        ],
        "summary": "网络搜索",
        "description": "`Web Search API` 是一个专给大模型用的搜索引擎，在传统搜索引擎网页读取、排序的能力基础上，增强了意图识别能力，返回更适合大模型处理的结果（网页标题、`URL`、摘要、名称、图标等）。支持意图增强检索、结构化输出和多引擎支持。见 [网络搜索服务](/cn/guide/tools/web-search)。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebSearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebSearchResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。可能的错误码：1701-网络搜索并发已达上限，请稍后重试或减少并发请求；1702-系统未找到可用的搜索引擎服务，请检查配置或联系管理员；1703-搜索引擎未返回有效数据，请调整查询条件。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/reader": {
      "post": {
        "tags": [
          "工具 API"
        ],
        "summary": "网页阅读",
        "description": "读取并解析指定 `URL` 的网页内容，可选择返回格式、支持控制缓存、图片保留与摘要选项等。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReaderRequest"
              },
              "examples": {
                "Basic": {
                  "value": {
                    "url": "https://www.example.com"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReaderResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/moderations": {
      "post": {
        "tags": [
          "工具 API"
        ],
        "summary": "内容安全",
        "description": "可对文本、图片、音频、视频格式类型的内容进行检测，精准识别涉黄、涉暴、违法违规等风险内容，并输出结构化审核结果（包括内容类型、风险类型及具体风险内容片段），快速定位和处理违规信息。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModerationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agents": {
      "post": {
        "tags": [
          "Agent API"
        ],
        "summary": "智能体对话",
        "description": "与智能体进行对话交互。支持同步和流式调用，提供智能体的专业能力。见 [智能体文档](/cn/guide/agents/translation)。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agents/async-result": {
      "post": {
        "tags": [
          "Agent API"
        ],
        "summary": "异步结果",
        "description": "查询智能体异步任务的处理结果和状态。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "async_id",
                  "agent_id"
                ],
                "properties": {
                  "async_id": {
                    "type": "string",
                    "description": "任务ID",
                    "example": "VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5"
                  },
                  "agent_id": {
                    "type": "string",
                    "description": "智能体ID",
                    "example": "intelligent_education_correction_polling"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAsyncResultResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agents/conversation": {
      "post": {
        "tags": [
          "Agent API"
        ],
        "summary": "对话历史",
        "description": "查询智能体对话历史，现仅支持 `slides_glm_agent` 智能体。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlmSlideAgentConversationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlmSlideAgentConversationResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files": {
      "post": {
        "tags": [
          "文件 API"
        ],
        "summary": "上传文件",
        "description": "上传用于 `Batch 任务`、`智能体` 等功能的文件。注意 `Try it` 功能仅支持小文件上传，实际支持的文件大小请参见下文 `purpose` 相关说明。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/FileUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileObject"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "文件 API"
        ],
        "summary": "文件列表",
        "description": "获取已上传文件的分页列表，支持按用途和排序过滤。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "description": "分页游标",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "purpose",
            "in": "query",
            "description": "按用途过滤文件",
            "schema": {
              "type": "string",
              "enum": [
                "batch",
                "code-interpreter",
                "agent"
              ]
            },
            "required": true
          },
          {
            "name": "order",
            "in": "query",
            "description": "排序方式",
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "每页返回的文件数量",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileListResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files/{file_id}": {
      "delete": {
        "tags": [
          "文件 API"
        ],
        "summary": "删除文件",
        "description": "永久删除指定文件及其所有关联数据。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "description": "文件唯一标识符",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDeletedResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files/{file_id}/content": {
      "get": {
        "tags": [
          "文件 API"
        ],
        "summary": "文件内容",
        "description": "获取文件内容。只支持 `batch` 文件类型。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "description": "被请求的文件的唯一标识符，用于指定要获取内容的特定文件。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功，返回文件字节流。",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files/parser/create": {
      "post": {
        "tags": [
          "工具 API"
        ],
        "summary": "文件解析",
        "description": "创建文件解析任务，支持多种文件格式和解析工具。见 [文件解析服务](/cn/guide/tools/file-parser)。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "待解析文件"
                  },
                  "tool_type": {
                    "type": "string",
                    "enum": [
                      "lite",
                      "expert",
                      "prime"
                    ],
                    "description": "使用的解析工具类型"
                  },
                  "file_type": {
                    "type": "string",
                    "enum": [
                      "PDF",
                      "DOCX",
                      "DOC",
                      "XLS",
                      "XLSX",
                      "PPT",
                      "PPTX",
                      "PNG",
                      "JPG",
                      "JPEG",
                      "CSV",
                      "TXT",
                      "MD",
                      "HTML",
                      "BMP",
                      "GIF",
                      "WEBP",
                      "HEIC",
                      "EPS",
                      "ICNS",
                      "IM",
                      "PCX",
                      "PPM",
                      "TIFF",
                      "XBM",
                      "HEIF",
                      "JP2"
                    ],
                    "description": "文件类型。Lite支持：pdf,docx,doc,xls,xlsx,ppt,pptx,png,jpg,jpeg,csv,txt,md。Expert支持：pdf。Prime支持：pdf,docx,doc,xls,xlsx,ppt,pptx,png,jpg,jpeg,csv,txt,md,html,bmp,gif,webp,heic,eps,icns,im,pcx,ppm,tiff,xbm,heif,jp2"
                  }
                },
                "required": [
                  "file",
                  "tool_type"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "任务创建成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "任务创建成功"
                    },
                    "task_id": {
                      "type": "string",
                      "example": "task_123456789"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files/parser/result/{taskId}/{format_type}": {
      "get": {
        "tags": [
          "工具 API"
        ],
        "summary": "解析结果",
        "description": "异步获取文件解析任务的结果，支持返回纯文本或下载链接格式。见 [文件解析服务](/cn/guide/tools/file-parser)。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "description": "文件解析任务ID",
            "required": true,
            "schema": {
              "type": "string",
              "example": "task_123456789"
            }
          },
          {
            "name": "format_type",
            "in": "path",
            "description": "结果返回格式类型",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "text",
                "download_link"
              ],
              "example": "text"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "结果获取成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileParseResultResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files/parser/sync": {
      "post": {
        "tags": [
          "工具 API"
        ],
        "summary": "文件解析(同步)",
        "description": "创建文件解析任务，支持多种文件格式和解析工具。见 [文件解析服务](/cn/guide/tools/file-parser)。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "待解析文件"
                  },
                  "tool_type": {
                    "type": "string",
                    "enum": [
                      "prime-sync"
                    ],
                    "description": "使用的解析工具类型"
                  },
                  "file_type": {
                    "type": "string",
                    "enum": [
                      "WPS",
                      "PDF",
                      "DOCX",
                      "DOC",
                      "XLS",
                      "XLSX",
                      "PPT",
                      "PPTX",
                      "PNG",
                      "JPG",
                      "JPEG",
                      "CSV",
                      "TXT",
                      "MD",
                      "HTML",
                      "BMP",
                      "GIF",
                      "WEBP",
                      "HEIC",
                      "EPS",
                      "ICNS",
                      "IM",
                      "PCX",
                      "PPM",
                      "TIFF",
                      "XBM",
                      "HEIF",
                      "JP2"
                    ],
                    "description": "文件类型支持：pdf,docx,doc,xls,xlsx,ppt,pptx,png,jpg,jpeg,csv,txt,md,html,bmp,gif,webp,heic,eps,icns,im,pcx,ppm,tiff,xbm,heif,jp2"
                  }
                },
                "required": [
                  "file",
                  "tool_type"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "结果获取成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileParseResultResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files/ocr": {
      "post": {
        "tags": [
          "工具 API"
        ],
        "summary": "OCR 服务",
        "description": "上传图片文件，使用指定工具类型进行 OCR（光学字符识别），支持手写体、文字等识别模式，见 [OCR 服务](/cn/guide/tools/zhipu-ocr)。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "待识别的图片文件（如 JPG、PNG）"
                  },
                  "tool_type": {
                    "type": "string",
                    "enum": [
                      "hand_write"
                    ],
                    "description": "OCR识别工具类型，可选 hand_write（手写体识别）"
                  },
                  "language_type": {
                    "type": "string",
                    "enum": [
                      "CHN_ENG",
                      "AUTO",
                      "ENG",
                      "JAP",
                      "KOR",
                      "FRE",
                      "SPA",
                      "POR",
                      "GER",
                      "ITA",
                      "RUS",
                      "DAN",
                      "DUT",
                      "MAL",
                      "SWE",
                      "IND",
                      "POL",
                      "ROM",
                      "TUR",
                      "GRE",
                      "HUN",
                      "THA",
                      "VIE",
                      "ARA",
                      "HIN"
                    ],
                    "description": "语言/识别模型类型，可选 CHN_ENG等"
                  },
                  "probability": {
                    "type": "boolean",
                    "example": true,
                    "default": false,
                    "description": "是否返回置信度（概率）信息。true 为返回"
                  }
                },
                "required": [
                  "file",
                  "tool_type"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "结果获取成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OCRResultResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/batches": {
      "post": {
        "tags": [
          "批处理 API"
        ],
        "summary": "创建批处理任务",
        "description": "创建一个新的批量处理任务。见 [批量服务](/cn/guide/tools/batch)。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "批处理 API"
        ],
        "summary": "列出批处理任务",
        "description": "获取批量处理任务列表，支持分页。见 [批量服务](/cn/guide/tools/batch)。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "description": "分页游标，用于获取指定ID之后的结果",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "返回结果的最大数量",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchListResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/batches/{batch_id}": {
      "get": {
        "tags": [
          "批处理 API"
        ],
        "summary": "检索批处理任务",
        "description": "根据批处理任务`ID`获取批量处理任务详情。见 [批量服务](/cn/guide/tools/batch)。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "description": "批处理任务的唯一标识符。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功，返回 Batch 对象。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/batches/{batch_id}/cancel": {
      "post": {
        "tags": [
          "批处理 API"
        ],
        "summary": "取消批处理任务",
        "description": "根据批处理任务`ID`取消正在运行的批量处理任务。见 [批量服务](/cn/guide/tools/batch)。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "description": "批处理任务ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/knowledge/retrieve": {
      "post": {
        "tags": [
          "知识库 API"
        ],
        "summary": "知识库检索",
        "description": "用于检索个人知识库，支持向量检索、关键词检索、混合检索，支持自定义重排模型。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KnowledgeRetrieveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeRetrieveResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/zrag/agent/chat": {
      "post": {
        "tags": [
          "Agent API"
        ],
        "summary": "问答 Agent 对话（流式）",
        "description": "基于 ReAct（Reasoning + Acting）推理引擎的流式对话接口。LLM 会根据用户问题自主决定是否调用工具（知识检索、查询重写等），并通过 SSE 实时推送思考过程、工具调用和最终回答。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "X-Session-Id",
            "in": "header",
            "description": "会话 ID，续聊时传入",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentChatRequest"
              },
              "example": {
                "messages": [
                  {
                    "role": "user",
                    "content": "公司的年假制度是什么？"
                  }
                ],
                "model": "glm-5v-turbo",
                "temperature": 0.2,
                "max_steps": 10,
                "retrieval": {
                  "know_ids": [
                    "123"
                  ],
                  "top_k": 8,
                  "top_n": 10,
                  "enable_rerank": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSE 流式响应，返回 AgentStreamEvent 事件流",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/AgentStreamEvent"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/zrag/retrieval/retrieve": {
      "post": {
        "tags": [
          "知识库 API"
        ],
        "summary": "全模态知识库检索",
        "description": "用于检索全模态知识库，支持文本、图片、视频等多模态输入检索，支持向量检索、关键词检索、混合检索，支持查询重写、重排、QA干预等高级功能。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ZragRetrieveRequest"
              },
              "example": {
                "multimodal": true,
                "knows": [
                  {
                    "id": "1234567890"
                  }
                ],
                "query": "介绍一下小智",
                "multimodal_parts": [
                  {
                    "type": "image_url",
                    "url": "https://example.com/image.png"
                  }
                ],
                "top_k": 8,
                "top_n": 10,
                "recall_method": "mixed",
                "recall_ratio": 0.8,
                "messages": [
                  {
                    "role": "user",
                    "content": "你是谁"
                  },
                  {
                    "role": "assistant",
                    "content": "我是小智，一个智能助手"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ZragRetrieveResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/knowledge": {
      "post": {
        "tags": [
          "知识库 API"
        ],
        "summary": "创建知识库",
        "description": "用于创建个人知识库，支持绑定向量化模型、设置名称、描述、背景色和图标。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KnowledgeCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeCreateResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "知识库 API"
        ],
        "summary": "知识库列表",
        "description": "获取个人知识库列表，支持分页。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "页码，默认1",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "每页数量，默认10",
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeListResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/knowledge/{id}": {
      "put": {
        "tags": [
          "知识库 API"
        ],
        "summary": "编辑知识库",
        "description": "用于编辑已经创建好的个人知识库，仅传入要修改的字段。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KnowledgeEditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeEditResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "知识库 API"
        ],
        "summary": "知识库详情",
        "description": "根据知识库`ID`获取个人知识库详情。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeDetailResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "知识库 API"
        ],
        "summary": "删除知识库",
        "description": "根据知识库`ID`删除个人知识库。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeDeleteResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/knowledge/capacity": {
      "get": {
        "tags": [
          "知识库 API"
        ],
        "summary": "知识库使用量",
        "description": "获取个人知识库的使用量详情，包括字数和字节数。点击 **Try it** 按钮可快速试用。",
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeCapacityResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document": {
      "get": {
        "tags": [
          "知识库 API"
        ],
        "summary": "文档列表",
        "description": "获取指定知识库下的文档列表。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "knowledge_id",
            "in": "query",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "页码，默认1",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "每页数量，默认10",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "word",
            "in": "query",
            "required": false,
            "description": "文档名称",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeDocumentListResponse"
                },
                "example": {
                  "data": {
                    "list": [
                      {
                        "id": "12312121212",
                        "knowledge_type": 1,
                        "custom_separator": [
                          "\n"
                        ],
                        "sentence_size": 300,
                        "length": 0,
                        "word_num": 100,
                        "name": "",
                        "url": "",
                        "embedding_stat": 0,
                        "failInfo": {
                          "embedding_code": 10002,
                          "embedding_msg": "字数超出限制"
                        }
                      }
                    ],
                    "total": 1
                  },
                  "code": 200,
                  "message": "请求成功",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document/upload_document/{id}": {
      "post": {
        "tags": [
          "知识库 API"
        ],
        "summary": "上传文件文档",
        "description": "向指定知识库上传文件类型文档，支持多种切片方式和回调。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/DocumentUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUploadResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document/upload_url": {
      "post": {
        "tags": [
          "知识库 API"
        ],
        "summary": "上传URL文档",
        "description": "上传`URL`类型的文档或网页作为内容填充知识库。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadUrlKnowledgeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadUrlKnowledgeResponse"
                },
                "example": {
                  "data": {
                    "successInfos": [
                      {
                        "documentId": "122121212",
                        "url": "xxx.com"
                      },
                      {
                        "documentId": "12121212121",
                        "url": "xxx.com"
                      }
                    ],
                    "failedInfos": [
                      {
                        "url": "xxx.com",
                        "failReason": "不支持的文档类型"
                      }
                    ]
                  },
                  "code": 200,
                  "message": "请求成功",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document/slice/image_list/{id}": {
      "post": {
        "tags": [
          "知识库 API"
        ],
        "summary": "解析文档图片",
        "description": "用于获取文件下解析到的图片序号和图片链接映射关系。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "文档ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeImageListResponse"
                },
                "example": {
                  "data": {
                    "images": [
                      {
                        "text": "【示意图序号_1829473032620613632_103】",
                        "cos_url": "https://cdn.bigmodel.cn/knowledge_pdf_image/de7163a7-c67f-4e33-8810-97a6d5a83378.png"
                      }
                    ]
                  },
                  "code": 200,
                  "message": "请求成功",
                  "timestamp": 1725070689634
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document/{id}": {
      "get": {
        "tags": [
          "知识库 API"
        ],
        "summary": "文档详情",
        "description": "根据文档`ID`获取文档详情。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "文档id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeDocumentDetailResponse"
                },
                "example": {
                  "data": {
                    "id": "12121212121212",
                    "knowledge_type": 1,
                    "custom_separator": [
                      "\n"
                    ],
                    "sentence_size": 300,
                    "length": 0,
                    "word_num": 100,
                    "name": "",
                    "url": "",
                    "embedding_stat": 0,
                    "failInfo": {
                      "embedding_code": 10002,
                      "embedding_msg": "字数超出限制"
                    }
                  },
                  "code": 200,
                  "message": "请求成功",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "知识库 API"
        ],
        "summary": "删除文档",
        "description": "根据文档`ID`删除文档。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "文档ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteKnowledgeResponse"
                },
                "example": {
                  "code": 200,
                  "message": "请求成功",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document/embedding/{id}": {
      "post": {
        "tags": [
          "知识库 API"
        ],
        "summary": "重新向量化",
        "description": "用于重新向量化文档（重试等操作）。同步返回成功表示调用成功，向量化完成后调用`callback_url`进行通知，也可调用知识详情接口获取结果。多用于`url`知识场景。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "文档ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReEmbeddingRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReEmbeddingResponse"
                },
                "example": {
                  "code": 200,
                  "message": "请求成功",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/assistant": {
      "post": {
        "tags": [
          "助理 API"
        ],
        "summary": "助手对话",
        "deprecated": true,
        "description": "与`AI`助手进行对话，支持流式和同步模式。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "流式响应数据"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/assistant/list": {
      "post": {
        "tags": [
          "助理 API"
        ],
        "deprecated": true,
        "summary": "助手列表",
        "description": "查询指定的智能体助手列表信息，包括智能体助手的详细配置、工具和元数据。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantListRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "msg": {
                      "type": "string",
                      "example": "操作成功"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AssistantInfo"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/assistant/conversation/list": {
      "post": {
        "tags": [
          "助理 API"
        ],
        "deprecated": true,
        "summary": "助手会话列表",
        "description": "查询指定智能体助手的会话列表，支持分页查询。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationListRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "msg": {
                      "type": "string",
                      "example": "操作成功"
                    },
                    "data": {
                      "$ref": "#/components/schemas/ConversationListResponse"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/v2/application/{app_id}/variables": {
      "get": {
        "tags": [
          "智能体 API（旧）"
        ],
        "deprecated": true,
        "summary": "获取智能体输入参数",
        "description": "获取指定智能体应用的输入参数列表。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "智能体（应用）id，获取位置：我的智能体列表页面",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationVariablesResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v2/application/file_upload": {
      "post": {
        "tags": [
          "智能体 API（旧）"
        ],
        "deprecated": true,
        "summary": "文件上传",
        "description": "上传文件到智能体（应用），同步返回上传结果。需通过文件解析状态接口获取解析结果。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "app_id": {
                    "type": "string",
                    "description": "智能体（应用）id"
                  },
                  "upload_unit_id": {
                    "type": "string",
                    "description": "上传文件组件id，文本类必须传，对话类临时文件不传"
                  },
                  "files": {
                    "type": "string",
                    "format": "binary",
                    "description": "支持多文件上传，files 字段可重复出现，每个文件单独作为一个 form-data 字段上传。示例：--form 'files=@\"/path/to/file1\"' --form 'files=@\"/path/to/file2\"'"
                  },
                  "conversation_id": {
                    "type": "string",
                    "description": "对话类型应用上传临时文件时需先通过创建新会话获得会话ID（对话类型上传临时文件时必传，文本类不传）"
                  },
                  "file_type": {
                    "type": "integer",
                    "description": "文件类型 1: excel 2: 文档 3: 音频 4: 图片 5: 视频"
                  }
                },
                "required": [
                  "app_id",
                  "files"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationFileUploadResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v2/application/file_stat": {
      "post": {
        "tags": [
          "智能体 API（旧）"
        ],
        "deprecated": true,
        "summary": "获取文件解析状态",
        "description": "获取指定文件的解析状态。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationFileStatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationFileStatResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v2/application/{app_id}/conversation": {
      "post": {
        "tags": [
          "智能体 API（旧）"
        ],
        "deprecated": true,
        "summary": "创建新会话",
        "description": "为指定智能体（应用）创建新会话，返回会话`ID`。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "智能体（应用）id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationConversationResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v3/application/invoke": {
      "post": {
        "tags": [
          "智能体 API（旧）"
        ],
        "deprecated": true,
        "summary": "推理接口",
        "description": "对话型或文本型应用推理接口，支持同步和流式`SSE`调用。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationInvokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationInvokeResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v2/application/slice_info": {
      "post": {
        "tags": [
          "智能体 API（旧）"
        ],
        "deprecated": true,
        "summary": "知识库切片引用位置信息",
        "description": "获取知识库切片引用的位置信息。点击 **Try it** 按钮可快速试用。",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationSliceInfoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationSliceInfoResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/history_session_record/{app_id}/{conversation_id}": {
      "get": {
        "tags": [
          "智能体 API（旧）"
        ],
        "deprecated": true,
        "summary": "推荐问题接口",
        "description": "获取推荐问题列表。点击 **Try it** 按钮可快速试用。",
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "应用id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "description": "会话id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistorySessionRecordResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/managed/v1/agents": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Agent"
        ],
        "summary": "创建 Agent",
        "description": "创建 Agent 及其首个不可变版本，配置模型、系统提示词、工具、Skills 与 MCP。\n\n<Accordion title=\"使用说明\">\n\n创建 Agent 及其首个不可变版本。可配置模型、系统提示词、内置或自定义工具、Skill 和 MCP Server；配置 MCP Server 时必须同时提供引用同名服务器的 `mcp_toolset`，不使用 MCP 时请省略这两个字段。\n\n</Accordion>",
        "operationId": "managedPostAgents",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          }
        ],
        "responses": {
          "201": {
            "description": "旧 beta header 的创建成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgent"
                },
                "example": {
                  "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
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "新 beta header 的创建成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgent"
                },
                "example": {
                  "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
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedAgentCreateRequest"
              },
              "example": {
                "name": "support-agent",
                "model": "glm-5.3",
                "system": "你是一个专业的客户支持助手。",
                "tools": [
                  {
                    "type": "agent_toolset_20260601"
                  }
                ]
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--agent/创建-agent"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Agent"
        ],
        "summary": "列出 Agent",
        "description": "分页列出当前账号可访问的 Agent。默认排除已归档资源，可通过 `include_archived` 包含。\n\n<Accordion title=\"使用说明\">\n\n新协议默认排除已归档 Agent，include_archived 可显式指定。\n\n</Accordion>",
        "operationId": "managedGetAgents",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "排序方向。",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "上一页返回的 opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--agent/列出-agent"
        }
      }
    },
    "/agent/managed/v1/agents/{agentId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Agent"
        ],
        "summary": "获取 Agent",
        "description": "获取指定 Agent 的当前版本及完整配置，包括模型、系统提示词、工具、Skill、MCP Server、元数据和归档时间。无读取权限时与资源不存在时均返回 404。",
        "operationId": "managedGetAgentsByAgentId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "agentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgent"
                },
                "example": {
                  "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
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--agent/获取-agent"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Agent"
        ],
        "summary": "更新 Agent",
        "description": "更新 Agent 配置并生成新版本，支持通过 `version` 防止并发覆盖。\n\n<Accordion title=\"使用说明\">\n\n更新指定 Agent 并生成新的不可变版本。可带当前 `version`；不一致时返回 409，避免覆盖刚发生的改动。仅所有者可更新，已归档 Agent 不可更新。MCP Server 与 `mcp_toolset` 必须按名称一一对应。\n\n</Accordion>",
        "operationId": "managedPostAgentsByAgentId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "agentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgent"
                },
                "example": {
                  "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
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedAgentUpdateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--agent/更新-agent"
        }
      }
    },
    "/agent/managed/v1/agents/{agentId}/versions": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Agent"
        ],
        "summary": "列出 Agent 版本",
        "description": "分页列出指定 Agent 的历史版本。每条记录都是该版本的完整 Agent 配置快照，而不是仅包含版本号的摘要。",
        "operationId": "managedGetAgentsByAgentIdVersions",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "agentId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "排序方向。",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "上一页返回的 opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--agent/列出-agent-版本"
        }
      }
    },
    "/agent/managed/v1/agents/{agentId}/archive": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Agent"
        ],
        "summary": "归档 Agent",
        "description": "归档指定 Agent。该操作仅限所有者且幂等，并会同时归档其仍在运行的 Deployment；归档是 Agent 的终止操作。",
        "operationId": "managedPostAgentsByAgentIdArchive",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "agentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgent"
                },
                "example": {
                  "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
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--agent/归档-agent"
        }
      }
    },
    "/agent/managed/v1/environments": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Environment"
        ],
        "summary": "创建 Environment",
        "description": "创建供 Managed Session 和 Deployment 使用的云端 Environment。可配置预装软件包和网络策略；省略配置时使用平台默认设置。",
        "operationId": "managedPostEnvironments",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedEnvironmentCreateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--environment/创建-environment"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Environment"
        ],
        "summary": "列出 Environment",
        "description": "分页列出当前身份可访问的 Environment，可使用游标控制顺序和分页大小。",
        "operationId": "managedGetEnvironments",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "上一页返回的 opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironmentPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--environment/列出-environment"
        }
      }
    },
    "/agent/managed/v1/environments/{environmentId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Environment"
        ],
        "summary": "获取 Environment",
        "description": "获取指定 Environment 的名称、配置、元数据、状态及归档信息。不可见或不存在时返回 404。",
        "operationId": "managedGetEnvironmentsByEnvironmentId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "description": "environmentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--environment/获取-environment"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Environment"
        ],
        "summary": "更新 Environment",
        "description": "更新指定 Environment 的名称、说明、元数据或云端配置。未提供的字段保持不变；归档后的 Environment 不能再绑定到新的 Session 或 Deployment。",
        "operationId": "managedPostEnvironmentsByEnvironmentId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "description": "environmentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedEnvironmentUpdateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--environment/更新-environment"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Environment"
        ],
        "summary": "删除 Environment",
        "description": "永久删除指定 Environment。删除后不能再用于 Session 或 Deployment；不存在或无权限时返回 404。",
        "operationId": "managedDeleteEnvironmentsByEnvironmentId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "description": "environmentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironmentDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--environment/删除-environment"
        }
      }
    },
    "/agent/managed/v1/environments/{environmentId}/archive": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Environment"
        ],
        "summary": "归档 Environment",
        "description": "归档指定 Environment。归档后保留资源记录，但不能再绑定到新的 Session 或 Deployment。",
        "operationId": "managedPostEnvironmentsByEnvironmentIdArchive",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "description": "environmentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--environment/归档-environment"
        }
      }
    },
    "/agent/managed/v1/sessions": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "创建 Session",
        "description": "基于指定 Agent 和 Environment 创建 Session。可选择固定 Agent 版本或提供会话级覆盖，并可附带初始用户消息、File 或 Memory Store 资源及 Vault。",
        "operationId": "managedPostSessions",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "$ref": "#/components/parameters/ManagedEventsEncrypted"
          },
          {
            "$ref": "#/components/parameters/ManagedCheckpoint"
          },
          {
            "$ref": "#/components/parameters/ManagedCheckpointTtl"
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSession"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedSessionCreateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/创建-session"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "列出 Session",
        "description": "分页列出当前身份可读取的 Session，并可按 Agent、状态和创建时间等条件筛选。",
        "operationId": "managedGetSessions",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "description": "按 Agent ID 过滤。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_version",
            "in": "query",
            "required": false,
            "description": "配合 agent_id 过滤版本。",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "memory_store_id",
            "in": "query",
            "required": false,
            "description": "按挂载的 Memory Store 过滤。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statuses[]",
            "in": "query",
            "required": false,
            "description": "可重复传入的 Session 状态。",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "idle",
                  "running",
                  "rescheduling",
                  "terminated"
                ]
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "created_at[gt]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 创建时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[gte]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 创建时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lt]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 创建时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lte]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 创建时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "description": "是否包含已归档 Session。",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "排序方向。",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "双向 opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSessionPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/列出-session"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "获取 Session",
        "description": "获取指定 Session 的配置、状态、关联 Agent 与 Environment，以及归档和错误信息。无读取权限时与资源不存在时均返回 404。",
        "operationId": "managedGetSessionsBySessionId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSession"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/获取-session"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "更新 Session",
        "description": "更新 Session 的标题、元数据或 Agent 工具配置。仅允许更新接口声明的字段，已归档 Session 不可修改。",
        "operationId": "managedPostSessionsBySessionId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSession"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedSessionUpdateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/更新-session"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "删除 Session",
        "description": "删除指定 API Session。运行中的 Session 不能删除；成功后写入删除事件，并尽力清理文件投影和 Checkpoint 等外部运行资源。不存在或无权限时返回 404。",
        "operationId": "managedDeleteSessionsBySessionId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSessionDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/删除-session"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/archive": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "归档 Session",
        "description": "归档指定 API Session，并将其终止后保留历史数据。运行中的 Session 不能归档，已归档 Session 再次归档会返回冲突；归档后不可再追加事件或修改资源。",
        "operationId": "managedPostSessionsBySessionIdArchive",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSession"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/归档-session"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/resources": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "新增 Session File Resource",
        "description": "向未归档的 Session 新增一个 File Resource。`file_id` 必须属于该 Agent 所有者，`mount_path` 必须有效且不能与现有挂载路径重叠。",
        "operationId": "managedPostSessionsBySessionIdResources",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；Session Resource 路由只识别该参数名，不校验取值。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedFileResourceResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedFileResourceInput"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/新增-session-file-resource"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "列出 Session Resource",
        "description": "分页列出 Session 挂载的 File 与 Memory Store Resource，结果按创建时间稳定排序。",
        "operationId": "managedGetSessionsBySessionIdResources",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；Session Resource 路由只识别该参数名，不校验取值。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1000
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "上一页返回的 opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSessionResourcePage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/列出-session-resource"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/resources/{resourceId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "获取 Session File Resource",
        "description": "获取 Session 中指定 File Resource 的挂载信息。Memory Store Resource 通过列表接口返回，不通过该资源详情接口读取。",
        "operationId": "managedGetSessionsBySessionIdResourcesByResourceId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceId",
            "in": "path",
            "required": true,
            "description": "resourceId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；Session Resource 路由只识别该参数名，不校验取值。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedFileResourceResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/获取-session-file-resource"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "删除 Session File Resource",
        "description": "从未归档的 Session 删除指定 File Resource。该操作只解除 Session 挂载，不删除源 File。",
        "operationId": "managedDeleteSessionsBySessionIdResourcesByResourceId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceId",
            "in": "path",
            "required": true,
            "description": "resourceId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；Session Resource 路由只识别该参数名，不校验取值。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSessionResourceDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/删除-session-file-resource"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "轮换仓库凭据",
        "operationId": "managedPostsessionssessionIdresourcesresourceId",
        "description": "轮换 Session 中 GitHub 仓库资源使用的凭据。\n\n<Accordion title=\"使用说明\">\n\n仅 github_repository 支持，已归档返回 400；File Resource 不支持更新。\n\n</Accordion>",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedGithubRepositoryResponse"
                }
              }
            }
          },
          "default": {
            "description": "错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedRepositoryTokenRotation"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/轮换仓库凭据"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/events": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "发送事件",
        "description": "向指定 Session 追加事件并触发后续处理。一次可发送 1 至 10 个受支持事件；已归档 Session 不接受新事件。",
        "operationId": "managedPostSessionsBySessionIdEvents",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSendEventsResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedSendEventsRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/发送事件"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "列出事件",
        "description": "主线程完整活动及子线程生命周期、消息、阻塞审批摘要；与 Session SSE 同集合。子线程完整活动走 Thread events。支持处理时间过滤与分页。",
        "operationId": "managedGetSessionsBySessionIdEvents",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "description": "事件类型过滤；可用逗号分隔或重复传入。",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "agent.custom_tool_use",
                  "agent.mcp_tool_result",
                  "agent.mcp_tool_use",
                  "agent.message",
                  "agent.thinking",
                  "agent.thread_context_compacted",
                  "agent.thread_message_received",
                  "agent.thread_message_sent",
                  "agent.tool_result",
                  "agent.tool_use",
                  "session.deleted",
                  "session.error",
                  "session.status_idle",
                  "session.status_rescheduled",
                  "session.status_running",
                  "session.status_terminated",
                  "session.thread_created",
                  "session.thread_status_idle",
                  "session.thread_status_rescheduled",
                  "session.thread_status_running",
                  "session.thread_status_terminated",
                  "session.updated",
                  "session.usage",
                  "span.model_request_end",
                  "span.model_request_start",
                  "span.outcome_evaluation_end",
                  "span.outcome_evaluation_ongoing",
                  "span.outcome_evaluation_start",
                  "system.message",
                  "user.custom_tool_result",
                  "user.define_outcome",
                  "user.interrupt",
                  "user.message",
                  "user.tool_confirmation",
                  "user.tool_result"
                ]
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "created_at[gt]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 处理时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[gte]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 处理时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lt]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 处理时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lte]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 处理时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 100
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "排序方向。",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "上一页返回的 opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEventPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/列出事件"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/events/stream": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Session"
        ],
        "summary": "订阅实时事件",
        "description": "通过 Server-Sent Events 订阅指定 Session 的实时事件。该流只推送连接后的新事件；重连时应先调用事件列表接口补齐历史并按事件 ID 去重。",
        "operationId": "managedGetSessionsBySessionIdEventsStream",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "sessionId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "event_deltas[]",
            "in": "query",
            "required": false,
            "description": "订阅的 delta 类型；可重复传入，两个写法合计最多 100 项。",
            "schema": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "enum": [
                  "agent.message",
                  "agent.thinking"
                ]
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "event_deltas",
            "in": "query",
            "required": false,
            "description": "event_deltas[] 的兼容写法；两个写法合计最多 100 项。",
            "schema": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "enum": [
                  "agent.message",
                  "agent.thinking"
                ]
              }
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "实时 Session 事件流。",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--session/订阅实时事件"
        }
      }
    },
    "/agent/managed/v1/files": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - File"
        ],
        "summary": "上传 File",
        "description": "通过 `multipart/form-data` 上传一个 File，供 Session 或 Deployment 作为文件资源挂载。请求必须包含 `file` 字段，并受平台文件大小限制。",
        "operationId": "managedPostFiles",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedUploadedFile"
                },
                "example": {
                  "type": "file",
                  "id": "file_01911111-1111-7111-8111-111111111111",
                  "size_bytes": 1024,
                  "created_at": "2026-10-15T08:00:00.000Z",
                  "filename": "report.txt",
                  "mime_type": "text/plain",
                  "downloadable": false,
                  "expires_at": null
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--file/上传-file"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - File"
        ],
        "summary": "列出 File",
        "description": "新协议返回 data/next_page，旧协议返回 data/has_more/first_id/last_id。ids[] 为不分页批量查 ID 入口，见 Files 指南。",
        "operationId": "managedGetFiles",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 20
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "description": "返回此 File 之前的一页。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "description": "返回此 File 之后的一页。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope_id",
            "in": "query",
            "required": false,
            "description": "按 Session scope 过滤，必须为 sess_ 前缀。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "将新协议 next_page 原样传入；优先于 before_id/after_id。"
          },
          {
            "name": "ids[]",
            "in": "query",
            "schema": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "description": "按 ID 查询，去重最多100；不可与 page/limit/before_id/after_id 同用。"
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedFilePage"
                },
                "example": {
                  "data": [
                    {
                      "type": "file",
                      "id": "file_01911111-1111-7111-8111-222222222222",
                      "size_bytes": 1024,
                      "created_at": "2026-10-15T08:00:00.000Z",
                      "filename": "report.txt",
                      "mime_type": "text/plain",
                      "downloadable": true,
                      "expires_at": null,
                      "scope": {
                        "type": "session",
                        "id": "sess_01911111-1111-7111-8111-111111111111"
                      }
                    }
                  ],
                  "next_page": null
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--file/列出-file"
        }
      }
    },
    "/agent/managed/v1/files/{fileId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - File"
        ],
        "summary": "获取 File",
        "description": "获取指定 File 的元数据，不返回文件二进制内容。无读取权限时与文件不存在时均返回 404。",
        "operationId": "managedGetFilesByFileId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "description": "fileId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedFile"
                },
                "example": {
                  "type": "file",
                  "id": "file_01911111-1111-7111-8111-222222222222",
                  "size_bytes": 1024,
                  "created_at": "2026-10-15T08:00:00.000Z",
                  "filename": "report.txt",
                  "mime_type": "text/plain",
                  "downloadable": true,
                  "expires_at": null,
                  "scope": {
                    "type": "session",
                    "id": "sess_01911111-1111-7111-8111-111111111111"
                  }
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--file/获取-file"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - File"
        ],
        "summary": "删除 File",
        "description": "删除指定 File。已被引用或不满足删除条件时会返回相应错误；不存在或无权限时返回 404。",
        "operationId": "managedDeleteFilesByFileId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "description": "fileId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedFileDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--file/删除-file"
        }
      }
    },
    "/agent/managed/v1/files/{fileId}/content": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - File"
        ],
        "summary": "下载 File 内容",
        "description": "下载指定 File 的原始二进制内容。响应媒体类型和文件名由已保存的文件元数据决定。",
        "operationId": "managedGetFilesByFileIdContent",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "description": "fileId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "文件内容。",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--file/下载-file-内容"
        }
      }
    },
    "/agent/managed/v1/memory_stores": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "创建 Memory Store",
        "description": "创建一个用于跨 Session 保存长期记忆的 Memory Store。可设置名称、说明和自定义元数据。",
        "operationId": "managedPostMemoryStores",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "创建成功。当前推荐协议返回 200；旧协议返回 201。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryStore"
                },
                "example": {
                  "id": "memstore_01911111-1111-7111-8111-111111111111",
                  "type": "memory_store",
                  "name": "Project knowledge",
                  "description": "团队项目的共享知识与偏好",
                  "metadata": {},
                  "created_at": "2026-10-15T08:00:00.000Z",
                  "updated_at": "2026-10-15T08:00:00.000Z",
                  "archived_at": null
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedMemoryStoreCreateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/创建-memory-store"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "列出 Memory Store",
        "description": "分页列出当前身份可访问的 Memory Store，可使用游标继续读取。",
        "operationId": "managedGetMemoryStores",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "description": "是否包含已归档 Store。",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "created_at[gte]",
            "in": "query",
            "required": false,
            "description": "创建时间下界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lte]",
            "in": "query",
            "required": false,
            "description": "创建时间上界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "opaque cursor。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryStorePage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/列出-memory-store"
        }
      }
    },
    "/agent/managed/v1/memory_stores/{storeId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "获取 Memory Store",
        "description": "获取指定 Memory Store 的配置、状态、容量和归档信息。不可见或不存在时返回 404。",
        "operationId": "managedGetMemoryStoresByStoreId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryStore"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/获取-memory-store"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "更新 Memory Store",
        "description": "更新指定 Memory Store 的名称、说明或元数据。元数据使用补丁语义，值为 `null` 时删除对应键。",
        "operationId": "managedPostMemoryStoresByStoreId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryStore"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedMemoryStoreUpdateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/更新-memory-store"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "删除 Memory Store",
        "description": "删除指定 Memory Store，解除活动的 Session 挂载并删除其中的 Memory；版本审计记录会保留但不再可通过已删除的 Store 访问。Store 正在被操作时不能删除。",
        "operationId": "managedDeleteMemoryStoresByStoreId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryStoreDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/删除-memory-store"
        }
      }
    },
    "/agent/managed/v1/memory_stores/{storeId}/archive": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "归档 Memory Store",
        "description": "归档指定 Memory Store。归档后保留历史内容，但不能再作为活动资源挂载或写入。",
        "operationId": "managedPostMemoryStoresByStoreIdArchive",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryStore"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/归档-memory-store"
        }
      }
    },
    "/agent/managed/v1/memory_stores/{storeId}/memories": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "创建 Memory",
        "description": "在指定 Memory Store 中创建 Memory。`path` 必须以 `/` 开头且不能包含空、`.` 或 `..` 路径段，内容受平台字节数限制。",
        "operationId": "managedPostMemoryStoresByStoreIdMemories",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "返回基本信息或完整内容。",
            "schema": {
              "type": "string",
              "enum": [
                "basic",
                "full"
              ],
              "default": "basic"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "创建成功。当前推荐协议返回 200；旧协议返回 201。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemory"
                },
                "example": {
                  "id": "mem_01911111-1111-7111-8111-111111111111",
                  "type": "memory",
                  "memory_store_id": "memstore_01911111-1111-7111-8111-111111111111",
                  "memory_version_id": "memver_01911111-1111-7111-8111-111111111111",
                  "path": "/preferences/reporting.md",
                  "content_sha256": "2d650650acd86e21108c8f0f496b076288bcedaad4f8b8f1b39b96537c00d9fb",
                  "content_size_bytes": 75,
                  "content": null,
                  "created_at": "2026-10-15T08:00:00.000Z",
                  "updated_at": "2026-10-15T08:00:00.000Z"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedMemoryCreateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/创建-memory"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "列出 Memory",
        "description": "分页列出指定 Memory Store 中的 Memory 条目，可使用游标继续读取。",
        "operationId": "managedGetMemoryStoresByStoreIdMemories",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "path_prefix",
            "in": "query",
            "required": false,
            "description": "路径前缀，必须为 / 或以 / 结尾。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "description": "递归深度。",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1024
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "返回基本信息或完整内容。",
            "schema": {
              "type": "string",
              "enum": [
                "basic",
                "full"
              ],
              "default": "basic"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "opaque cursor。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；view=full 时最多 20。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/列出-memory"
        }
      }
    },
    "/agent/managed/v1/memory_stores/{storeId}/memories/{memoryId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "获取 Memory",
        "description": "获取指定 Memory 的当前内容、路径、版本及时间信息。",
        "operationId": "managedGetMemoryStoresByStoreIdMemoriesByMemoryId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memoryId",
            "in": "path",
            "required": true,
            "description": "memoryId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "返回基本信息或完整内容。",
            "schema": {
              "type": "string",
              "enum": [
                "basic",
                "full"
              ],
              "default": "full"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemory"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/获取-memory"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "更新 Memory",
        "description": "更新指定 Memory 的路径或内容。可选 `content_sha256` 前置条件用于避免覆盖并发修改；未提供或为 `null` 的字段保持不变。",
        "operationId": "managedPostMemoryStoresByStoreIdMemoriesByMemoryId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memoryId",
            "in": "path",
            "required": true,
            "description": "memoryId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "返回基本信息或完整内容。",
            "schema": {
              "type": "string",
              "enum": [
                "basic",
                "full"
              ],
              "default": "basic"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemory"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedMemoryUpdateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/更新-memory"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "删除 Memory",
        "description": "删除指定 Memory。删除操作会形成可审计的版本记录，资源不存在或无权限时返回 404。",
        "operationId": "managedDeleteMemoryStoresByStoreIdMemoriesByMemoryId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memoryId",
            "in": "path",
            "required": true,
            "description": "memoryId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "expected_content_sha256",
            "in": "query",
            "required": false,
            "description": "可选的内容版本前置条件。",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/删除-memory"
        }
      }
    },
    "/agent/managed/v1/memory_stores/{storeId}/memory_versions": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "列出 Memory Version",
        "description": "分页列出指定 Memory Store 的版本历史，包括创建、更新、删除和脱敏产生的版本。",
        "operationId": "managedGetMemoryStoresByStoreIdMemoryVersions",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "memory_id",
            "in": "query",
            "required": false,
            "description": "按 Memory ID 过滤。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operation",
            "in": "query",
            "required": false,
            "description": "按版本操作过滤。",
            "schema": {
              "type": "string",
              "enum": [
                "created",
                "modified",
                "deleted"
              ]
            }
          },
          {
            "name": "created_at[gte]",
            "in": "query",
            "required": false,
            "description": "创建时间下界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lte]",
            "in": "query",
            "required": false,
            "description": "创建时间上界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "返回基本信息或完整内容。",
            "schema": {
              "type": "string",
              "enum": [
                "basic",
                "full"
              ],
              "default": "basic"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "opaque cursor。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；view=full 时最多 20。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryVersionPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/列出-memory-version"
        }
      }
    },
    "/agent/managed/v1/memory_stores/{storeId}/memory_versions/{versionId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "获取 Memory Version",
        "description": "获取指定 Memory Version 的不可变历史快照。",
        "operationId": "managedGetMemoryStoresByStoreIdMemoryVersionsByVersionId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "description": "versionId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "返回基本信息或完整内容。",
            "schema": {
              "type": "string",
              "enum": [
                "basic",
                "full"
              ],
              "default": "full"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryVersion"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/获取-memory-version"
        }
      }
    },
    "/agent/managed/v1/memory_stores/{storeId}/memory_versions/{versionId}/redact": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Memory"
        ],
        "summary": "脱敏 Memory Version",
        "description": "对指定 Memory Version 执行脱敏，使敏感历史内容不再可读取。该操作针对版本记录，不修改当前 Memory 的业务路径。不能对当前 head 版本脱敏（409）。",
        "operationId": "managedPostMemoryStoresByStoreIdMemoryVersionsByVersionIdRedact",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "storeId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "description": "versionId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beta",
            "in": "query",
            "required": false,
            "description": "SDK 兼容参数；提供时必须为 true。",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMemoryVersion"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--memory/脱敏-memory-version"
        }
      }
    },
    "/agent/managed/v1/vaults": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "创建 Vault",
        "description": "创建一个 Vault，用于保存和组织受保护的 Credential。可设置展示名和自定义元数据。",
        "operationId": "managedPostVaults",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedVault"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedVaultCreateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/创建-vault"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "列出 Vault",
        "description": "分页列出当前身份拥有的 Vault。Vault 用于集中管理 Session、Deployment 和 MCP 访问所需的凭据。",
        "operationId": "managedGetVaults",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "opaque cursor。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "description": "是否包含已归档 Vault。",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedVaultPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/列出-vault"
        }
      }
    },
    "/agent/managed/v1/vaults/{vaultId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "获取 Vault",
        "description": "获取指定 Vault 的元数据和状态；响应不返回任何凭据明文。",
        "operationId": "managedGetVaultsByVaultId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedVault"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/获取-vault"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "更新 Vault",
        "description": "更新指定 Vault 的展示名或元数据。元数据使用补丁语义，值为 `null` 时删除对应键。",
        "operationId": "managedPostVaultsByVaultId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedVault"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedVaultUpdateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/更新-vault"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "删除 Vault",
        "description": "永久删除指定 Vault，并级联删除其中的 Credential。仅 Vault 所有者可以执行，响应不会返回任何凭据明文。",
        "operationId": "managedDeleteVaultsByVaultId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedVaultDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/删除-vault"
        }
      }
    },
    "/agent/managed/v1/vaults/{vaultId}/archive": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "归档 Vault",
        "description": "归档指定 Vault。归档后保留记录，但其中 Credential 不能再用于新的运行时注入。",
        "operationId": "managedPostVaultsByVaultIdArchive",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedVault"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/归档-vault"
        }
      }
    },
    "/agent/managed/v1/vaults/{vaultId}/credentials": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "创建 Credential",
        "description": "在指定 Vault 中创建 Credential。支持 MCP OAuth、静态 Bearer、通用 OAuth、Bearer 和环境变量凭据；敏感字段只写不回显。",
        "operationId": "managedPostVaultsByVaultIdCredentials",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedCredential"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedCredentialCreateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/创建-credential"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "列出 Credential",
        "description": "分页列出指定 Vault 中的 Credential 元数据和认证类型。密钥、Token 等敏感值不会在响应中返回。",
        "operationId": "managedGetVaultsByVaultIdCredentials",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "opaque cursor。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "description": "是否包含已归档 Vault。",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedCredentialPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/列出-credential"
        }
      }
    },
    "/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "获取 Credential",
        "description": "获取指定 Credential 的元数据、认证类型和状态；响应不会返回密钥、Token 或 Secret 明文。",
        "operationId": "managedGetVaultsByVaultIdCredentialsByCredentialId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialId",
            "in": "path",
            "required": true,
            "description": "credentialId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedCredential"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/获取-credential"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "更新 Credential",
        "description": "更新指定 Credential 的展示信息或认证材料，可用于轮换 Token、Secret 和 OAuth 刷新配置；敏感值只写不回显。",
        "operationId": "managedPostVaultsByVaultIdCredentialsByCredentialId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialId",
            "in": "path",
            "required": true,
            "description": "credentialId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedCredential"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedCredentialUpdateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/更新-credential"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "删除 Credential",
        "description": "永久删除指定 Credential。删除后相关运行时不能再使用该凭据。",
        "operationId": "managedDeleteVaultsByVaultIdCredentialsByCredentialId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialId",
            "in": "path",
            "required": true,
            "description": "credentialId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedCredentialDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/删除-credential"
        }
      }
    },
    "/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "验证 MCP OAuth",
        "description": "验证指定 MCP OAuth Credential 当前是否能访问其 MCP Server。该操作只执行连通性与认证校验，不返回敏感 Token。",
        "operationId": "managedPostVaultsByVaultIdCredentialsByCredentialIdMcpOauthValidate",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialId",
            "in": "path",
            "required": true,
            "description": "credentialId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedCredentialValidation"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/验证-mcp-oauth"
        }
      }
    },
    "/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/archive": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Vault"
        ],
        "summary": "归档 Credential",
        "description": "归档指定 Credential。归档后保留记录，但不能再注入到新的 Session 或 Deployment 运行。",
        "operationId": "managedPostVaultsByVaultIdCredentialsByCredentialIdArchive",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "vaultId",
            "in": "path",
            "required": true,
            "description": "vaultId 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialId",
            "in": "path",
            "required": true,
            "description": "credentialId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedCredential"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--vault/归档-credential"
        }
      }
    },
    "/agent/managed/v1/skills": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "创建 Skill",
        "description": "上传完整 Skill 目录并创建首个版本。上传包须包含 `SKILL.md`。\n\n<Accordion title=\"使用说明\">\n\n通过 `multipart/form-data` 上传一个完整 Skill 目录并创建首个版本。上传内容必须包含顶层目录中的 `SKILL.md`，字段名使用 Skill 内相对路径。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。\n\n</Accordion>",
        "operationId": "managedPostSkills",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          }
        ],
        "responses": {
          "201": {
            "description": "旧 beta header 的创建成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkill"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "新 beta header 的创建成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkill"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "display_title": {
                    "type": "string",
                    "description": "可选展示名。"
                  },
                  "display_name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "新协议展示名；旧协议 display_title 兼容。"
                  }
                },
                "additionalProperties": {
                  "type": "string",
                  "format": "binary",
                  "description": "字段名为 Skill 内相对路径；必须包含顶层目录下的 SKILL.md。"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/创建-skill"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "列出 Skill",
        "description": "分页列出当前身份可访问的 Skill，可使用游标控制排序和分页大小。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。",
        "operationId": "managedGetSkills",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "按来源过滤。",
            "schema": {
              "type": "string",
              "enum": [
                "custom",
                "zai"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量，默认 20；新协议下大于 1000 时按 1000 返回，旧协议上限为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "排序方向。",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "传入上一页响应的 next_page，继续读取。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkillPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/列出-skill"
        }
      }
    },
    "/agent/managed/v1/skills/{id}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "获取 Skill",
        "description": "获取指定 Skill 的元数据和当前版本信息。不可见或不存在时返回 404。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。",
        "operationId": "managedGetSkillsById",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkill"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/获取-skill"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "删除 Skill",
        "description": "摘牌资源，不检查引用；已固定 Session 保留字节，新引用不可用。最后一个在架版本不能单独删除（400）。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。",
        "operationId": "managedDeleteSkillsById",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkillDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/删除-skill"
        }
      }
    },
    "/agent/managed/v1/skills/{id}/versions": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "创建 Skill Version",
        "description": "为已有 Skill 上传完整目录，创建一个新版本。\n\n<Accordion title=\"使用说明\">\n\n重新上传完整 Skill 目录以创建新版本。上传内容必须包含顶层目录中的 `SKILL.md`，字段名使用 Skill 内相对路径。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。\n\n</Accordion>",
        "operationId": "managedPostSkillsByIdVersions",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkillVersion"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "新 beta header 成功 200；旧 beta header 成功 201。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkillVersion"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": {
                  "type": "string",
                  "format": "binary",
                  "description": "字段名为 Skill 内相对路径；重新上传完整 Skill 目录。"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/创建-skill-version"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "列出 Skill Version",
        "description": "分页列出指定 Skill 的历史版本，可使用游标继续读取。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。",
        "operationId": "managedGetSkillsByIdVersions",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量，默认 20；新协议下大于 1000 时按 1000 返回。旧协议忽略此参数，一次返回全部版本。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "传入上一页响应的 next_page；仅新协议返回分页游标。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkillVersionPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/列出-skill-version"
        }
      }
    },
    "/agent/managed/v1/skills/{id}/versions/{v}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "获取 Skill Version",
        "description": "获取指定 Skill Version 的元数据和不可变版本信息。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。",
        "operationId": "managedGetSkillsByIdVersionsByV",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "v",
            "in": "path",
            "required": true,
            "description": "v 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkillVersion"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/获取-skill-version"
        }
      },
      "delete": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "删除 Skill Version",
        "description": "摘牌资源，不检查引用；已固定 Session 保留字节，新引用不可用。最后一个在架版本不能单独删除（400）。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。",
        "operationId": "managedDeleteSkillsByIdVersionsByV",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "v",
            "in": "path",
            "required": true,
            "description": "v 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkillVersionDeleted"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/删除-skill-version"
        }
      }
    },
    "/agent/managed/v1/skills/{id}/versions/{v}/content": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "下载 Skill ZIP",
        "description": "下载指定 Skill Version 的 ZIP 内容，用于检查或复用该不可变版本。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。",
        "operationId": "managedGetSkillsByIdVersionsByVContent",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id 资源标识。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "v",
            "in": "path",
            "required": true,
            "description": "v 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "文件内容。",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/下载-skill-zip"
        }
      }
    },
    "/agent/managed/v1/deployments": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "创建 Deployment",
        "description": "创建定时或手动触发的 Deployment，固定 Agent 版本、环境与任务输入。\n\n<Accordion title=\"使用说明\">\n\n创建一个绑定到指定 Agent 版本和 Environment 的 Deployment。`initial_events` 必须包含 1 至 50 个 `user.message` 事件，且仅支持文本和图片内容块（base64、url 或 file 来源）；图片要求生效模型支持图片输入。省略 `schedule` 或传 `null` 时创建仅支持手动触发的 Deployment；配置 cron 时目前仅支持 `Asia/Shanghai` 时区，并受平台最小触发间隔限制。可同时绑定 Vault、Memory Store 和 File 资源。\n\n</Accordion>",
        "operationId": "managedPostDeployments",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          }
        ],
        "responses": {
          "201": {
            "description": "旧 beta header 的创建成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeployment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "新 beta header 的创建成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeployment"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedDeploymentCreateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/创建-deployment"
        }
      },
      "get": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "列出 Deployment",
        "description": "分页列出可访问的 Deployment，支持按 Agent、状态和创建时间筛选。\n\n<Accordion title=\"使用说明\">\n\n分页列出当前身份可读取的 Deployment，支持按 Agent、状态和创建时间过滤。默认不返回已归档记录；传入 `include_archived=true` 可包含已归档 Deployment。归档状态由 `archived_at` 表示，`status` 仍只会是 `active` 或 `paused`。\n\n</Accordion>",
        "operationId": "managedGetDeployments",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "description": "按 Agent ID 过滤。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "按状态过滤。",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "paused"
              ]
            }
          },
          {
            "name": "created_at[gte]",
            "in": "query",
            "required": false,
            "description": "创建时间下界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lte]",
            "in": "query",
            "required": false,
            "description": "创建时间上界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "description": "是否包含已归档 Deployment。",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "排序方向。",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeploymentPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/列出-deployment"
        }
      }
    },
    "/agent/managed/v1/deployments/{deploymentId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "获取 Deployment",
        "description": "获取指定 Deployment 的当前配置和运行状态，包括固定的 Agent 版本、Environment、资源、Vault、调度计划及初始事件。已归档状态通过 `archived_at` 返回。",
        "operationId": "managedGetDeploymentsByDeploymentId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "deploymentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeployment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/获取-deployment"
        }
      },
      "post": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "更新 Deployment",
        "description": "更新 Deployment 的配置、任务输入与调度，或重新固定同一 Agent 的版本。\n\n<Accordion title=\"使用说明\">\n\n更新指定 Deployment 的可变配置。支持 `name`、`description`、`metadata`、`initial_events`、`environment_id`、`vault_ids`、`resources`、`schedule` 和 `agent`；`agent` 只能重新固定同一个 Agent 的版本或覆盖配置，不能切换 Agent ID。`schedule: null` 会改为仅手动触发，`resources: null` 和 `metadata: null` 会清空对应配置，`environment_id: null` 会保留原值。已归档 Deployment 不可更新。\n\n</Accordion>",
        "operationId": "managedPostDeploymentsByDeploymentId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "deploymentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeployment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedDeploymentUpdateRequest"
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/更新-deployment"
        }
      }
    },
    "/agent/managed/v1/deployments/{deploymentId}/pause": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "暂停 Deployment",
        "description": "暂停指定 Deployment 的定时触发。该操作幂等：重复暂停不会更新时间；如果 Deployment 已因资源错误自动暂停，则保留原有错误原因。已归档 Deployment 不可暂停。",
        "operationId": "managedPostDeploymentsByDeploymentIdPause",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "deploymentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeployment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/暂停-deployment"
        }
      }
    },
    "/agent/managed/v1/deployments/{deploymentId}/unpause": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "恢复 Deployment",
        "description": "恢复 Deployment 的后续调度；不会补跑暂停期间错过的任务。\n\n<Accordion title=\"使用说明\">\n\n恢复指定 Deployment。该操作幂等；对于 cron Deployment，会从当前时间重新计算下一次未来执行时间，不补跑暂停期间错过的任务；仅手动触发的 Deployment 不会生成下一次执行时间。已归档 Deployment 不可恢复。\n\n</Accordion>",
        "operationId": "managedPostDeploymentsByDeploymentIdUnpause",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "deploymentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeployment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/恢复-deployment"
        }
      }
    },
    "/agent/managed/v1/deployments/{deploymentId}/archive": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "归档 Deployment",
        "description": "归档指定 Deployment 并停止后续定时触发。归档是终态且操作幂等，重复归档不会刷新 `archived_at`；归档后不能更新、暂停、恢复或手动运行。Deployment 没有删除接口。",
        "operationId": "managedPostDeploymentsByDeploymentIdArchive",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "deploymentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeployment"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/归档-deployment"
        }
      }
    },
    "/agent/managed/v1/deployments/{deploymentId}/run": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "post": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "手动运行 Deployment",
        "description": "立即触发一次 Deployment Run，返回 `202 Accepted`。可查询运行记录和关联会话。\n\n<Accordion title=\"使用说明\">\n\n立即为指定 Deployment 创建一次手动触发的 Deployment Run，并返回 `202 Accepted`。手动运行不会推进 cron 的下一次执行时间，可在 Deployment 暂停时执行，但不能对已归档 Deployment 执行。\n\n</Accordion>",
        "operationId": "managedPostDeploymentsByDeploymentIdRun",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "deploymentId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeploymentRun"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/手动运行-deployment"
        }
      }
    },
    "/agent/managed/v1/deployment_runs": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "列出 Deployment Run",
        "description": "分页查询 Deployment 的运行记录，支持按任务、触发方式、时间和错误筛选。\n\n<Accordion title=\"使用说明\">\n\n分页列出当前身份可读取的 Deployment Run，支持按 Deployment、是否有错误、触发方式和创建时间过滤。已归档 Deployment 的历史 Run 仍可查询；Run 是否成功通过 `error` 是否为 `null` 判断，响应中不包含 `status` 字段。\n\n</Accordion>",
        "operationId": "managedGetDeploymentRuns",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "deployment_id",
            "in": "query",
            "required": false,
            "description": "按 Deployment ID 过滤。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "has_error",
            "in": "query",
            "required": false,
            "description": "按是否包含错误过滤。",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "trigger_type",
            "in": "query",
            "required": false,
            "description": "按触发方式过滤。",
            "schema": {
              "type": "string",
              "enum": [
                "schedule",
                "manual"
              ]
            }
          },
          {
            "name": "created_at[gt]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 创建时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[gte]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 创建时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lt]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 创建时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_at[lte]",
            "in": "query",
            "required": false,
            "description": "RFC 3339 创建时间边界。",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量；大于 100 时服务端截断为 100。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "排序方向。",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeploymentRunPage"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/列出-deployment-run"
        }
      }
    },
    "/agent/managed/v1/deployment_runs/{runId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Deployment"
        ],
        "summary": "获取 Deployment Run",
        "description": "获取指定 Deployment Run 的执行记录，包括触发方式、关联 Session、固定的 Agent 版本和错误信息。不存在或当前身份无权读取时均返回 404。",
        "operationId": "managedGetDeploymentRunsByRunId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "runId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeploymentRun"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--deployment/获取-deployment-run"
        }
      }
    },
    "/agent/forward/v0/channels": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "生产环境"
        },
        {
          "url": "https://dev-agent-api.bigmodel.cn/api",
          "description": "测试环境"
        }
      ],
      "post": {
        "tags": [
          "Channel"
        ],
        "summary": "创建 Channel",
        "description": "创建飞书 Channel，将 Agent 绑定到飞书机器人。连接异步建立，创建后可查询连接状态。\n\n<Accordion title=\"使用说明\">\n\n创建飞书 Channel。Caller 必须有目标 Agent 的 owner 权限，所有资源必须属于同一 customer。Agent ID 字符串或省略 version 时在创建时固定最新版本；template 不接受 Tools/MCP/Skills override。\n\nowner 或资源预检调用失败时统一返回固定 500，且不创建 Channel。凭据已识别的鉴权拒绝返回 400；Provider 瞬态故障或并发预检忙返回 503。HTTP 201 只表示预检与保存成功；连接由后台异步建立，请读取 connection_status 与 last_error 判断状态。凭据不会回显。\n\n完整配置 JSON 不得超过 65,535 UTF-8 字节。群聊模板必须包含两个占位符各一次。\n\n</Accordion>",
        "operationId": "forwardPostChannels",
        "parameters": [
          {
            "$ref": "#/components/parameters/ForwardZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ForwardZaiBeta"
          }
        ],
        "responses": {
          "201": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardChannel"
                },
                "example": {
                  "id": "channel_xxx",
                  "type": "channel",
                  "channel_type": "feishu",
                  "name": "Support Feishu channel",
                  "template": {
                    "agent": {
                      "type": "agent",
                      "id": "agent_xxx",
                      "version": 3
                    },
                    "environment_id": "env_xxx",
                    "vault_ids": [
                      "vault_xxx"
                    ],
                    "file_ids": [
                      "file_xxx"
                    ],
                    "memory_stores": []
                  },
                  "enabled": true,
                  "binding_status": "bound",
                  "connection_status": "disabled",
                  "channel_config": {
                    "response_options": {
                      "include_tool_calls": false,
                      "include_process": false,
                      "card_output": true
                    },
                    "group_prompt_template": null,
                    "private_memory_store_enabled": false
                  },
                  "last_error": null,
                  "created_at": "2026-09-01T00:00:00.000Z",
                  "updated_at": "2026-09-01T00:00:00.000Z"
                }
              }
            }
          },
          "429": {
            "description": "当前 customer 或 Forward 全局限流。",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-scope": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "global"
                  ]
                },
                "description": "仅全局 bucket 拒绝时出现。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "创建并发名额忙、依赖服务不可用或 Provider 瞬态错误；Retry-After: 1。",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "建议等待的秒数。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForwardChannelCreateRequest"
              },
              "example": {
                "channel_type": "feishu",
                "name": "Support Feishu channel",
                "template": {
                  "agent": {
                    "type": "agent",
                    "id": "agent_01911111-1111-7111-8111-111111111111",
                    "version": 3
                  },
                  "environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
                },
                "channel_config": {
                  "credentials": {
                    "app_id": "cli_xxx",
                    "app_secret": "<app-secret>"
                  }
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/channel/create",
          "metadata": {
            "sidebarTitle": "创建 Channel"
          }
        }
      },
      "get": {
        "tags": [
          "Channel"
        ],
        "summary": "列出 Channel",
        "description": "分页列出当前账号的 Channel，返回安全配置，不回显凭据。\n\n<Accordion title=\"使用说明\">\n\n按当前 customer 分页列出 Channel。返回安全的 resolved inline template 与 Channel 配置，不返回 credential、计费字段或内部 Identity/Session/binding 标识。\n\n</Accordion>",
        "operationId": "forwardGetChannels",
        "parameters": [
          {
            "$ref": "#/components/parameters/ForwardZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ForwardZaiBeta"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每页数量。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "排序方向。",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "上一页返回的 opaque cursor。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardChannelPage"
                },
                "example": {
                  "data": [
                    {
                      "id": "channel_xxx",
                      "type": "channel",
                      "channel_type": "feishu",
                      "name": "Support Feishu channel",
                      "template": {
                        "agent": {
                          "type": "agent",
                          "id": "agent_xxx",
                          "version": 3
                        },
                        "environment_id": "env_xxx",
                        "vault_ids": [
                          "vault_xxx"
                        ],
                        "file_ids": [
                          "file_xxx"
                        ],
                        "memory_stores": []
                      },
                      "enabled": true,
                      "binding_status": "bound",
                      "connection_status": "connected",
                      "channel_config": {
                        "response_options": {
                          "include_tool_calls": false,
                          "include_process": false,
                          "card_output": true
                        },
                        "group_prompt_template": null,
                        "private_memory_store_enabled": false
                      },
                      "last_error": null,
                      "created_at": "2026-09-01T00:00:00.000Z",
                      "updated_at": "2026-09-01T00:00:00.000Z"
                    }
                  ],
                  "next_page": null
                }
              }
            }
          },
          "429": {
            "description": "当前 customer 或 Forward 全局限流。",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-scope": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "global"
                  ]
                },
                "description": "仅全局 bucket 拒绝时出现。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/channel/list",
          "metadata": {
            "sidebarTitle": "列出 Channel"
          }
        }
      }
    },
    "/agent/forward/v0/channels/{channelId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "生产环境"
        },
        {
          "url": "https://dev-agent-api.bigmodel.cn/api",
          "description": "测试环境"
        }
      ],
      "get": {
        "tags": [
          "Channel"
        ],
        "summary": "获取 Channel",
        "description": "获取 Channel 的配置、连接状态与最近错误，不回显凭据。\n\n<Accordion title=\"使用说明\">\n\n读取 Channel 的安全结构，包含固定 Agent 版本、共享记忆配置、connection_status、last_error、response_options、private_memory_store_enabled 和 group_prompt_template。凭据不回显；不存在、已删除或属于其他 customer 均返回 404。\n\n</Accordion>",
        "operationId": "forwardGetChannelsByChannelId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ForwardZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ForwardZaiBeta"
          },
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "channelId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardChannel"
                },
                "example": {
                  "id": "channel_xxx",
                  "type": "channel",
                  "channel_type": "feishu",
                  "name": "Support Feishu channel",
                  "template": {
                    "agent": {
                      "type": "agent",
                      "id": "agent_xxx",
                      "version": 3
                    },
                    "environment_id": "env_xxx",
                    "vault_ids": [
                      "vault_xxx"
                    ],
                    "file_ids": [
                      "file_xxx"
                    ],
                    "memory_stores": []
                  },
                  "enabled": true,
                  "binding_status": "bound",
                  "connection_status": "connected",
                  "channel_config": {
                    "response_options": {
                      "include_tool_calls": false,
                      "include_process": false,
                      "card_output": true
                    },
                    "group_prompt_template": null,
                    "private_memory_store_enabled": false
                  },
                  "last_error": null,
                  "created_at": "2026-09-01T00:00:00.000Z",
                  "updated_at": "2026-09-01T00:00:00.000Z"
                }
              }
            }
          },
          "429": {
            "description": "当前 customer 或 Forward 全局限流。",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-scope": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "global"
                  ]
                },
                "description": "仅全局 bucket 拒绝时出现。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/channel/get",
          "metadata": {
            "sidebarTitle": "获取 Channel"
          }
        }
      },
      "delete": {
        "tags": [
          "Channel"
        ],
        "summary": "删除 Channel",
        "description": "删除 Channel 并停止后续连接与回复，保留已有会话和记忆。\n\n<Accordion title=\"使用说明\">\n\n删除 Channel，停止渠道连接、会话 worker 和后续回复，并清除 Provider 凭据。已有 Memory Store、Managed Session 和审计记录保留。重复删除返回 404；删除前已发出的远端请求可能完成，但不会继续生成渠道回复。\n\n</Accordion>",
        "operationId": "forwardDeleteChannelsByChannelId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ForwardZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ForwardZaiBeta"
          },
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "channelId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardChannelDeleted"
                },
                "example": {
                  "id": "channel_xxx",
                  "deleted": true
                }
              }
            }
          },
          "429": {
            "description": "当前 customer 或 Forward 全局限流。",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-scope": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "global"
                  ]
                },
                "description": "仅全局 bucket 拒绝时出现。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/channel/delete",
          "metadata": {
            "sidebarTitle": "删除 Channel"
          }
        }
      },
      "patch": {
        "tags": [
          "Channel"
        ],
        "summary": "更新 Channel 群聊模板",
        "description": "更新 Channel 的群聊提示模板，或恢复默认模板；不支持修改其他配置。\n\n<Accordion title=\"使用说明\">\n\n仅更新 channel_config.group_prompt_template；字符串中的 `{{context_note}}` 与 `{{messages}}` 必须各一次，null 恢复默认模板。其他配置字段返回 400。成功后新准备的群聊消息使用新模板；已冻结输入继续使用原模板。\n\n</Accordion>",
        "operationId": "forwardPatchChannelsByChannelId",
        "parameters": [
          {
            "$ref": "#/components/parameters/ForwardZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ForwardZaiBeta"
          },
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "channelId 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardChannel"
                },
                "example": {
                  "id": "channel_xxx",
                  "type": "channel",
                  "channel_type": "feishu",
                  "name": "Support Feishu channel",
                  "template": {
                    "agent": {
                      "type": "agent",
                      "id": "agent_xxx",
                      "version": 3
                    },
                    "environment_id": "env_xxx",
                    "vault_ids": [
                      "vault_xxx"
                    ],
                    "file_ids": [
                      "file_xxx"
                    ],
                    "memory_stores": []
                  },
                  "enabled": true,
                  "binding_status": "bound",
                  "connection_status": "connected",
                  "channel_config": {
                    "response_options": {
                      "include_tool_calls": false,
                      "include_process": false,
                      "card_output": true
                    },
                    "group_prompt_template": null,
                    "private_memory_store_enabled": false
                  },
                  "last_error": null,
                  "created_at": "2026-09-01T00:00:00.000Z",
                  "updated_at": "2026-09-01T00:00:00.000Z"
                }
              }
            }
          },
          "429": {
            "description": "当前 customer 或 Forward 全局限流。",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-scope": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "global"
                  ]
                },
                "description": "仅全局 bucket 拒绝时出现。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardAgentErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForwardChannelPatchRequest"
              },
              "example": {
                "channel_config": {
                  "group_prompt_template": "请结合来源说明回复。\n{{context_note}}\n{{messages}}"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/channel/update",
          "metadata": {
            "sidebarTitle": "更新 Channel 群聊模板"
          }
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/threads": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api"
        }
      ],
      "get": {
        "tags": [
          "Thread"
        ],
        "summary": "列出会话线程",
        "operationId": "managedGetsessionssessionIdthreads",
        "description": "列出指定 Session 的线程，包括主线程与成员线程，用于查看状态和继续交互。",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 100
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statuses[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "idle",
                  "running",
                  "rescheduling",
                  "terminated"
                ]
              }
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedThreadPage"
                }
              }
            }
          },
          "default": {
            "description": "错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/session/threads/列出会话线程"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/threads/{threadId}": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api"
        }
      ],
      "get": {
        "tags": [
          "Thread"
        ],
        "summary": "获取会话线程",
        "operationId": "managedGetsessionssessionIdthreadsthreadId",
        "description": "获取指定会话线程的状态、Agent 与用量信息。",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedThread"
                }
              }
            }
          },
          "default": {
            "description": "错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/session/threads/获取会话线程"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/threads/{threadId}/archive": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api"
        }
      ],
      "post": {
        "tags": [
          "Thread"
        ],
        "summary": "归档会话线程",
        "operationId": "managedPostsessionssessionIdthreadsthreadIdarchive",
        "description": "归档处于空闲状态的子线程，保留历史记录。\n\n<Accordion title=\"使用说明\">\n\n仅 idle 子线程可归档；running/rescheduling/primary 返回 400，重复归档幂等。\n\n</Accordion>",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedThread"
                }
              }
            }
          },
          "default": {
            "description": "错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/session/threads/归档会话线程"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/threads/{threadId}/events": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api"
        }
      ],
      "get": {
        "tags": [
          "Thread"
        ],
        "summary": "列出线程事件",
        "operationId": "managedGetsessionssessionIdthreadsthreadIdevents",
        "description": "分页列出指定线程的完整事件历史，按创建时间升序返回。\n\n<Accordion title=\"使用说明\">\n\n线程完整历史，data/next_page，按 created_at 升序。\n\n</Accordion>",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 100
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEventsPage"
                }
              }
            }
          },
          "default": {
            "description": "错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/session/threads/列出线程事件"
        }
      }
    },
    "/agent/managed/v1/sessions/{sessionId}/threads/{threadId}/stream": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api"
        }
      ],
      "get": {
        "tags": [
          "Thread"
        ],
        "summary": "订阅线程实时事件",
        "operationId": "managedGetsessionssessionIdthreadsthreadIdstream",
        "description": "实时订阅指定线程的完整事件；仅推送连接建立后的新事件。\n\n<Accordion title=\"使用说明\">\n\nlive-only；Thread 自己的完整流，primary id 使用 Session 频道。路径不是 /events/stream。\n\n</Accordion>",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_deltas[]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "agent.message",
                  "agent.thinking"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "event: session.thread_status_idle\ndata: {\"type\":\"session.thread_status_idle\",\"stop_reason\":{\"type\":\"end_turn\"}}\n\n"
              }
            }
          },
          "default": {
            "description": "错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/session/threads/订阅线程实时事件"
        }
      }
    },
    "/agent/managed/v1/skills/{id}/versions/latest": {
      "servers": [
        {
          "url": "https://agent-api.bigmodel.cn/api",
          "description": "智谱 Managed Agents 服务"
        }
      ],
      "get": {
        "tags": [
          "Managed Agents - Skill"
        ],
        "summary": "获取最新 Skill 版本",
        "description": "读取当前 head 版本。删除最后一个在架版本返回 400；已摘牌读取 404。 新旧字段和 latest 固定规则见 [Skill 使用指南](/cn/managed-agents/skills)。",
        "operationId": "managedGetLatestSkillVersion",
        "parameters": [
          {
            "$ref": "#/components/parameters/ManagedZaiVersion"
          },
          {
            "$ref": "#/components/parameters/ManagedZaiBeta"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id 资源标识。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "请求成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSkillVersion"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentsErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/managed-agents--skill/获取最新-skill-版本"
        }
      }
    }
  },
  "components": {
    "parameters": {
      "AcceptLanguage": {
        "name": "Accept-Language",
        "in": "header",
        "schema": {
          "type": "string",
          "description": "HTTP 请求头，用于告知服务器浏览器的首选语言列表，以便服务器返回最符合用户偏好的语言内容。",
          "default": "cn",
          "enum": [
            "en",
            "cn"
          ]
        }
      },
      "ManagedZaiVersion": {
        "name": "zai-version",
        "in": "header",
        "required": true,
        "description": "Managed Agents API 入口要求的基础协议标识，当前只接受 2026-05-26；响应兼容形态由 zai-beta 选择。两个头均需携带。",
        "schema": {
          "type": "string",
          "enum": [
            "2026-05-26"
          ],
          "default": "2026-05-26",
          "example": "2026-05-26"
        }
      },
      "ManagedZaiBeta": {
        "name": "zai-beta",
        "in": "header",
        "required": true,
        "description": "声明 Managed Agents Beta 协议并选择响应字段与兼容行为。新接入使用 managed-agents-2026-09-22；旧客户端仍可使用 managed-agents-2026-05-26。必须同时携带 zai-version: 2026-05-26。字段差异见 /cn/managed-agents/protocol-versions。",
        "schema": {
          "type": "string",
          "default": "managed-agents-2026-09-22",
          "example": "managed-agents-2026-09-22"
        }
      },
      "ManagedEventsEncrypted": {
        "name": "x-events-encrypted",
        "in": "header",
        "required": false,
        "description": "仅创建 Session 时可用。精确传 true 时启用事件加密。详见 [会话事件数据加密](/cn/managed-agents/events#会话事件数据加密)。",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ],
          "default": "false"
        }
      },
      "ManagedCheckpoint": {
        "name": "x-checkpoint",
        "in": "header",
        "required": false,
        "description": "创建时固定。显式 true/false 优先；未声明时Multi Agent Agent 列表/仓库资源可推导默认开启。成功或合作式中断收尾尽力保存，失败/配额不足可能回退，不保证唯一持久存储。",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      },
      "ManagedCheckpointTtl": {
        "name": "x-checkpoint-ttl",
        "in": "header",
        "required": false,
        "description": "保留天数 1–30。通常须显式 x-checkpoint:true；仓库资源默认开启时也可设置；只依赖 Agent 列表 默认开启时单独 TTL 仍被拒绝。",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 30,
          "default": 30
        }
      },
      "ForwardZaiVersion": {
        "name": "zai-version",
        "in": "header",
        "required": true,
        "description": "Forward Channel v0 基础协议标识，当前固定为 2026-05-26。",
        "schema": {
          "type": "string",
          "enum": [
            "2026-05-26"
          ],
          "default": "2026-05-26",
          "example": "2026-05-26"
        }
      },
      "ForwardZaiBeta": {
        "name": "zai-beta",
        "in": "header",
        "required": true,
        "description": "Channel v0 必须包含 managed-agents-2026-05-26；不要直接替换成 Managed API 推荐的新 Beta 值。多个值用逗号分隔。",
        "schema": {
          "type": "string",
          "default": "managed-agents-2026-05-26",
          "example": "managed-agents-2026-05-26"
        }
      }
    },
    "schemas": {
      "ChatCompletionTextRequest": {
        "required": [
          "model",
          "messages"
        ],
        "type": "object",
        "description": "普通对话模型请求，支持纯文本对话和工具调用",
        "properties": {
          "model": {
            "type": "string",
            "description": "调用的模型代码。`GLM-5.3` 是最新的旗舰模型系列，提供了复杂推理、超长上下文、极致推理速度。",
            "example": "glm-5.3",
            "default": "glm-5.3",
            "enum": [
              "glm-5.3",
              "glm-5.2",
              "glm-5.1",
              "glm-5-turbo",
              "glm-5",
              "glm-4.7",
              "glm-4.7-flash",
              "glm-4.7-flashx",
              "glm-4.6",
              "glm-4.5-air",
              "glm-4.5-airx",
              "glm-4.5-flash",
              "glm-4-flash-250414",
              "glm-4-flashx-250414"
            ]
          },
          "messages": {
            "type": "array",
            "description": "对话消息列表，包含当前对话的完整上下文信息。每条消息都有特定的角色和内容，模型会根据这些消息生成回复。消息按时间顺序排列，支持四种角色：`system`（系统消息，用于设定`AI`的行为和角色）、`user`（用户消息，来自用户的输入）、`assistant`（助手消息，来自`AI`的回复）、`tool`（工具消息，工具调用的结果）。普通对话模型主要支持纯文本内容。注意不能只包含系统消息或助手消息。",
            "items": {
              "oneOf": [
                {
                  "title": "用户消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "user"
                      ],
                      "description": "消息作者的角色",
                      "default": "user"
                    },
                    "content": {
                      "type": "string",
                      "description": "文本消息内容",
                      "example": "What opportunities and challenges will the Chinese large model industry face in 2025?"
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "系统消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system"
                      ],
                      "description": "消息作者的角色",
                      "default": "system"
                    },
                    "content": {
                      "type": "string",
                      "description": "消息文本内容",
                      "example": "You are a helpful assistant."
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "助手消息",
                  "type": "object",
                  "description": "可包含工具调用",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "assistant"
                      ],
                      "description": "消息作者的角色",
                      "default": "assistant"
                    },
                    "content": {
                      "type": "string",
                      "description": "文本消息内容",
                      "example": "I'll help you with that analysis."
                    },
                    "tool_calls": {
                      "type": "array",
                      "description": "模型生成的工具调用消息。当提供此字段时，`content`通常为空。",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "工具调用ID"
                          },
                          "type": {
                            "type": "string",
                            "description": "工具类型，支持 `web_search、retrieval、function`",
                            "enum": [
                              "function",
                              "web_search",
                              "retrieval"
                            ]
                          },
                          "function": {
                            "type": "object",
                            "description": "函数调用信息，当`type`为`function`时不为空",
                            "properties": {
                              "name": {
                                "type": "string",
                                "description": "函数名称"
                              },
                              "arguments": {
                                "type": "string",
                                "description": "函数参数，`JSON`格式字符串"
                              }
                            },
                            "required": [
                              "name",
                              "arguments"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      }
                    }
                  },
                  "required": [
                    "role"
                  ]
                },
                {
                  "title": "工具消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "tool"
                      ],
                      "description": "消息作者的角色",
                      "default": "tool"
                    },
                    "content": {
                      "type": "string",
                      "description": "消息文本内容",
                      "example": "Function executed successfully with result: ..."
                    },
                    "tool_call_id": {
                      "type": "string",
                      "description": "指示此消息对应的工具调用 `ID`"
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                }
              ]
            },
            "minItems": 1
          },
          "stream": {
            "type": "boolean",
            "example": false,
            "default": false,
            "description": "是否启用流式输出模式。默认值为 `false`。当设置为 `false` 时，模型会在生成完整响应后一次性返回所有内容，适合短文本生成和批处理场景。当设置为 `true` 时，模型会通过`Server-Sent Events (SSE)`流式返回生成的内容，用户可以实时看到文本生成过程，适合聊天对话和长文本生成场景，能提供更好的用户体验。流式输出结束时会返回 `data: [DONE]` 消息。"
          },
          "thinking": {
            "$ref": "#/components/schemas/ChatThinking"
          },
          "reasoning_effort": {
            "type": "string",
            "description": "控制模型的推理程度，`thinking` 开启时生效，默认 `max`，仅  `GLM-5.2` 及其以上模型支持。对于 `GLM-5.3` `GLM-5.3-FLASH` 模型，仅支持 low / high / max 档位。对于 `GLM-5.2` 模型，传入 `none` 或 `minimal` 模型会放弃思考；传入 `low` `medium` 将映射为 `high`；传入 `xhigh` 将映射为 `max`。",
            "example": "max",
            "default": "max",
            "enum": [
              "max",
              "xhigh",
              "high",
              "medium",
              "low",
              "minimal",
              "none"
            ]
          },
          "do_sample": {
            "type": "boolean",
            "example": true,
            "default": true,
            "description": "是否启用采样策略来生成文本。默认值为 `true`。当设置为 `true` 时，模型会使用 `temperature、top_p` 等参数进行随机采样，生成更多样化的输出；当设置为 `false` 时，模型总是选择概率最高的词汇，生成更确定性的输出，此时 `temperature` 和 `top_p` 参数将被忽略。对于需要一致性和可重复性的任务（如代码生成、翻译），建议设置为 `false`。"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，控制输出的随机性和创造性，取值范围为 `[0.0, 1.0]`，限两位小数。对于`GLM-5.3` `GLM-5.2` `GLM-5.1` `GLM-5` `GLM-4.7` `GLM-4.6`系列默认值为 `1.0`，`GLM-4.5`系列默认值为 `0.6`，`GLM-4`系列默认值为 `0.75`。较高的值（如`0.8`）会使输出更随机、更具创造性，适合创意写作和头脑风暴；较低的值（如`0.2`）会使输出更稳定、更确定，适合事实性问答等场景。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 1,
            "default": 1,
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "description": "核采样（`nucleus sampling`）参数，是`temperature`采样的替代方法，取值范围为 `[0.01, 1.0]`，限两位小数。对于`GLM-5.3` `GLM-5.2` `GLM-5.1` `GLM-5` `GLM-4.7` `GLM-4.6` `GLM-4.5`系列默认值为 `0.95`，`GLM-4`系列默认值为 `0.9`。模型只考虑累积概率达到`top_p`的候选词汇。例如：`0.1`表示只考虑前`10%`概率的词汇，`0.9`表示考虑前`90%`概率的词汇。较小的值会产生更集中、更一致的输出；较大的值会增加输出的多样性。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不建议同时调整两个参数。",
            "format": "float",
            "example": 0.95,
            "default": 0.95,
            "minimum": 0.01,
            "maximum": 1
          },
          "max_tokens": {
            "type": "integer",
            "description": "模型输出的最大令牌`token`数量限制。`GLM-5.3` `GLM-5.2` `GLM-5.1` `GLM-5` `GLM-4.7` `GLM-4.6`系列最大支持`128K`输出长度，`GLM-4.5`系列最大支持`96K`输出长度，建议设置不小于`1024`。令牌是文本的基本单位，通常`1`个令牌约等于`0.75`个英文单词或`1.5`个中文字符。设置合适的`max_tokens`可以控制响应长度和成本，避免过长的输出。如果模型在达到`max_tokens`限制前完成回答，会自然结束；如果达到限制，输出可能被截断。\n默认值和最大值等更多详见 [max_tokens 文档](/cn/guide/start/concept-param#max_tokens)",
            "example": 1024,
            "minimum": 1,
            "maximum": 131072
          },
          "tool_stream": {
            "type": "boolean",
            "example": false,
            "default": false,
            "description": "是否开启流式响应`Function Calls`，仅限`GLM-5.3` `GLM-5.2` `GLM-5.1` `GLM-5` `GLM-5-Turbo` `GLM-4.7` `GLM-4.6`系列支持此参数，默认值`false`。参考 [工具流式输出](/cn/guide/capabilities/stream-tool)"
          },
          "tools": {
            "type": "array",
            "description": "模型可以调用的工具列表。支持函数调用、知识库检索和网络搜索。使用此参数提供模型可以生成 `JSON` 输入的函数列表或配置其他工具。最多支持 `128` 个函数。",
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionToolSchema"
                }
              },
              {
                "items": {
                  "$ref": "#/components/schemas/RetrievalToolSchema"
                }
              },
              {
                "items": {
                  "$ref": "#/components/schemas/WebSearchToolSchema"
                }
              },
              {
                "items": {
                  "$ref": "#/components/schemas/MCPToolSchema"
                }
              }
            ]
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto"
                ],
                "description": "用于控制模型选择调用哪个函数的方式，仅在工具类型为`function`时补充。默认`auto`且仅支持`auto`。"
              }
            ],
            "description": "控制模型如何选择工具。"
          },
          "stop": {
            "type": "array",
            "description": "停止词列表，当模型生成的文本中遇到这些指定的字符串时会立即停止生成。格式为[\"stop_word1\"]。",
            "items": {
              "type": "string"
            },
            "maxItems": 4
          },
          "response_format": {
            "type": "object",
            "description": "指定模型的响应输出格式，默认为`text`，仅文本模型支持此字段。`type` 取值收敛为三种：`text`（普通文本输出）、`json_object`（`JSON` 格式输出）。",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text",
                  "json_object"
                ],
                "default": "text",
                "description": "输出格式类型：`text` 表示普通文本输出；`json_object` 表示 `JSON` 格式输出。"
              }
            },
            "required": [
              "type"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一标识符。`ID`长度要求：最少`6`个字符，最多`128`个字符，建议使用不包含敏感信息的唯一标识。",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "AsyncChatCompletionTextRequest": {
        "required": [
          "model",
          "messages"
        ],
        "type": "object",
        "description": "普通对话模型请求，支持纯文本对话和工具调用",
        "properties": {
          "model": {
            "type": "string",
            "description": "调用的模型代码。`GLM-5.3` 是最新的旗舰模型系列，提供了复杂推理、超长上下文、极致推理速度。",
            "example": "glm-5.3",
            "default": "glm-5.3",
            "enum": [
              "glm-5.3",
              "glm-5.2",
              "glm-5.1",
              "glm-5-turbo",
              "glm-5",
              "glm-4.7",
              "glm-4.6",
              "glm-4.5-air",
              "glm-4.5-airx",
              "glm-4.5-flash",
              "glm-4-flash-250414",
              "glm-4-flashx-250414"
            ]
          },
          "messages": {
            "type": "array",
            "description": "对话消息列表，包含当前对话的完整上下文信息。每条消息都有特定的角色和内容，模型会根据这些消息生成回复。消息按时间顺序排列，支持四种角色：`system`（系统消息，用于设定`AI`的行为和角色）、`user`（用户消息，来自用户的输入）、`assistant`（助手消息，来自`AI`的回复）、`tool`（工具消息，工具调用的结果）。普通对话模型主要支持纯文本内容。注意不能只包含系统消息或助手消息。",
            "items": {
              "oneOf": [
                {
                  "title": "用户消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "user"
                      ],
                      "description": "消息作者的角色",
                      "default": "user"
                    },
                    "content": {
                      "type": "string",
                      "description": "文本消息内容",
                      "example": "What opportunities and challenges will the Chinese large model industry face in 2025?"
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "系统消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system"
                      ],
                      "description": "消息作者的角色",
                      "default": "system"
                    },
                    "content": {
                      "type": "string",
                      "description": "消息文本内容",
                      "example": "You are a helpful assistant."
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "助手消息",
                  "type": "object",
                  "description": "可包含工具调用",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "assistant"
                      ],
                      "description": "消息作者的角色",
                      "default": "assistant"
                    },
                    "content": {
                      "type": "string",
                      "description": "文本消息内容",
                      "example": "I'll help you with that analysis."
                    },
                    "tool_calls": {
                      "type": "array",
                      "description": "模型生成的工具调用消息。当提供此字段时，`content`通常为空。",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "工具调用ID"
                          },
                          "type": {
                            "type": "string",
                            "description": "工具类型，支持 `web_search、retrieval、function`",
                            "enum": [
                              "function",
                              "web_search",
                              "retrieval"
                            ]
                          },
                          "function": {
                            "type": "object",
                            "description": "函数调用信息，当`type`为`function`时不为空",
                            "properties": {
                              "name": {
                                "type": "string",
                                "description": "函数名称"
                              },
                              "arguments": {
                                "type": "string",
                                "description": "函数参数，`JSON`格式字符串"
                              }
                            },
                            "required": [
                              "name",
                              "arguments"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      }
                    }
                  },
                  "required": [
                    "role"
                  ]
                },
                {
                  "title": "工具消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "tool"
                      ],
                      "description": "消息作者的角色",
                      "default": "tool"
                    },
                    "content": {
                      "type": "string",
                      "description": "消息文本内容",
                      "example": "Function executed successfully with result: ..."
                    },
                    "tool_call_id": {
                      "type": "string",
                      "description": "指示此消息对应的工具调用 `ID`"
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                }
              ]
            },
            "minItems": 1
          },
          "thinking": {
            "$ref": "#/components/schemas/ChatThinking"
          },
          "reasoning_effort": {
            "type": "string",
            "description": "控制模型的推理程度，`thinking` 开启时生效，默认 `max`，仅  `GLM-5.2` 及其以上模型支持。对于 `GLM-5.3` `GLM-5.3-FLASH` 模型，仅支持 low / high / max 档位。对于 `GLM-5.2` 模型，传入 `none` 或 `minimal` 模型会放弃思考；传入 `low` `medium` 将映射为 `high`；传入 `xhigh` 将映射为 `max`。",
            "example": "max",
            "default": "max",
            "enum": [
              "max",
              "xhigh",
              "high",
              "medium",
              "low",
              "minimal",
              "none"
            ]
          },
          "do_sample": {
            "type": "boolean",
            "example": true,
            "default": true,
            "description": "是否启用采样策略来生成文本。默认值为 `true`。当设置为 `true` 时，模型会使用 `temperature、top_p` 等参数进行随机采样，生成更多样化的输出；当设置为 `false` 时，模型总是选择概率最高的词汇，生成更确定性的输出，此时 `temperature` 和 `top_p` 参数将被忽略。对于需要一致性和可重复性的任务（如代码生成、翻译），建议设置为 `false`。"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，控制输出的随机性和创造性，取值范围为 `(0.0, 1.0]`，限两位小数。对于`GLM-5.3` `GLM-5.2` `GLM-5.1` `GLM-5` `GLM-5-Turbo` `GLM-4.7` `GLM-4.6`系列默认值为 `1.0`，`GLM-4.5`系列默认值为 `0.6`，`GLM-4`系列默认值为 `0.75`。较高的值（如`0.8`）会使输出更随机、更具创造性，适合创意写作和头脑风暴；较低的值（如`0.2`）会使输出更稳定、更确定，适合事实性问答等场景。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 1,
            "default": 1,
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "description": "核采样（`nucleus sampling`）参数，是`temperature`采样的替代方法，取值范围为 `[0.01, 1.0]`，限两位小数。对于`GLM-5.3` `GLM-5.2` `GLM-5.1` `GLM-5` `GLM-5-Turbo` `GLM-4.7` `GLM-4.6` `GLM-4.5`系列默认值为 `0.95`，`GLM-4`系列默认值为 `0.9`。模型只考虑累积概率达到`top_p`的候选词汇。例如：`0.1`表示只考虑前`10%`概率的词汇，`0.9`表示考虑前`90%`概率的词汇。较小的值会产生更集中、更一致的输出；较大的值会增加输出的多样性。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不建议同时调整两个参数。",
            "format": "float",
            "example": 0.95,
            "default": 0.95,
            "minimum": 0.01,
            "maximum": 1
          },
          "max_tokens": {
            "type": "integer",
            "description": "模型输出的最大令牌`token`数量限制。`GLM-5.3` `GLM-5.2` `GLM-5.1` `GLM-5` `GLM-5-Turbo` `GLM-4.7` `GLM-4.6`系列最大支持`128K`输出长度，`GLM-4.5`最大支持`96K`输出长度，建议设置不小于`1024`。令牌是文本的基本单位，通常`1`个令牌约等于`0.75`个英文单词或`1.5`个中文字符。设置合适的`max_tokens`可以控制响应长度和成本，避免过长的输出。如果模型在达到`max_tokens`限制前完成回答，会自然结束；如果达到限制，输出可能被截断。\n默认值和最大值等更多详见 [max_tokens 文档](/cn/guide/start/concept-param#max_tokens)",
            "example": 1024,
            "minimum": 1,
            "maximum": 131072
          },
          "tools": {
            "type": "array",
            "description": "模型可以调用的工具列表。支持函数调用、知识库检索和网络搜索。使用此参数提供模型可以生成 `JSON` 输入的函数列表或配置其他工具。最多支持 `128` 个函数。",
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionToolSchema"
                }
              },
              {
                "items": {
                  "$ref": "#/components/schemas/RetrievalToolSchema"
                }
              },
              {
                "items": {
                  "$ref": "#/components/schemas/WebSearchToolSchema"
                }
              },
              {
                "items": {
                  "$ref": "#/components/schemas/MCPToolSchema"
                }
              }
            ]
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto"
                ],
                "description": "用于控制模型选择调用哪个函数的方式，仅在工具类型为`function`时补充。默认`auto`且仅支持`auto`。"
              }
            ],
            "description": "控制模型如何选择工具。"
          },
          "stop": {
            "type": "array",
            "description": "停止词列表，当模型生成的文本中遇到这些指定的字符串时会立即停止生成。格式为[\"stop_word1\"]。",
            "items": {
              "type": "string"
            },
            "maxItems": 4
          },
          "response_format": {
            "type": "object",
            "description": "指定模型的响应输出格式，默认为`text`，仅文本模型支持此字段。`type` 取值收敛为三种：`text`（普通文本输出）、`json_object`（`JSON` 格式输出）。",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text",
                  "json_object"
                ],
                "default": "text",
                "description": "输出格式类型：`text` 表示普通文本输出；`json_object` 表示 `JSON` 格式输出；"
              }
            },
            "required": [
              "type"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一标识符。`ID`长度要求：最少`6`个字符，最多`128`个字符，建议使用不包含敏感信息的唯一标识。",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "ChatCompletionVisionRequest": {
        "required": [
          "model",
          "messages"
        ],
        "type": "object",
        "description": "视觉模型请求，支持多模态内容（文本、图片、视频、文件）",
        "properties": {
          "model": {
            "type": "string",
            "description": "调用的视觉模型代码。`GLM-5.3-Flash` 系列支持视觉理解，具备卓越的多模态理解能力和工具调用能力。",
            "example": "glm-5.3-flashx",
            "default": "glm-5.3-flashx",
            "enum": [
              "glm-5.3-flashx",
              "glm-5.3-flash",
              "glm-5v-turbo",
              "glm-4.6v",
              "autoglm-phone",
              "glm-4.6v-flash",
              "glm-4.6v-flashx",
              "glm-4v-flash",
              "glm-4.1v-thinking-flashx",
              "glm-4.1v-thinking-flash"
            ]
          },
          "messages": {
            "type": "array",
            "description": "对话消息列表，包含当前对话的完整上下文信息。每条消息都有特定的角色和内容，模型会根据这些消息生成回复。消息按时间顺序排列，支持角色：`system`（系统消息，用于设定`AI`的行为和角色）、`user`（用户消息，来自用户的输入）、`assistant`（助手消息，来自`AI`的回复）。视觉模型支持纯文本和多模态内容（文本、图片、视频、文件）。注意不能只包含系统或助手消息。",
            "items": {
              "oneOf": [
                {
                  "title": "用户消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "user"
                      ],
                      "description": "消息作者的角色",
                      "default": "user"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "array",
                          "description": "多模态消息内容，支持文本、图片、文件、视频（可从上方切换至文本消息）",
                          "items": {
                            "$ref": "#/components/schemas/VisionMultimodalContentItem"
                          }
                        },
                        {
                          "type": "string",
                          "description": "文本消息内容（可从上方切换至多模态消息）",
                          "example": "What opportunities and challenges will the Chinese large model industry face in 2025?"
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "系统消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system"
                      ],
                      "description": "消息作者的角色",
                      "default": "system"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "消息文本内容",
                          "example": "You are a helpful assistant."
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "助手消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "assistant"
                      ],
                      "description": "消息作者的角色",
                      "default": "assistant"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "文本消息内容",
                          "example": "I'll help you with that analysis."
                        }
                      ]
                    }
                  },
                  "required": [
                    "role"
                  ]
                }
              ]
            },
            "minItems": 1
          },
          "stream": {
            "type": "boolean",
            "example": false,
            "default": false,
            "description": "是否启用流式输出模式。默认值为 `false`。当设置为 `false` 时，模型会在生成完整响应后一次性返回所有内容，适合短文本生成和批处理场景。当设置为 `true` 时，模型会通过`Server-Sent Events (SSE)`流式返回生成的内容，用户可以实时看到文本生成过程，适合聊天对话和长文本生成场景，能提供更好的用户体验。流式输出结束时会返回 `data: [DONE]` 消息。"
          },
          "thinking": {
            "$ref": "#/components/schemas/ChatThinking"
          },
          "reasoning_effort": {
            "type": "string",
            "description": "控制模型的推理程度，`thinking` 开启时生效，默认 `max`。`GLM-5.3-FLASH` 系列模型支持 low / high / max 档位。",
            "example": "max",
            "default": "max",
            "enum": [
              "max",
              "high",
              "low"
            ]
          },
          "do_sample": {
            "type": "boolean",
            "example": true,
            "default": true,
            "description": "是否启用采样策略来生成文本。默认值为 `true`。当设置为 `true` 时，模型会使用 `temperature、top_p` 等参数进行随机采样，生成更多样化的输出；当设置为 `false` 时，模型总是选择概率最高的词汇，生成更确定性的输出，此时 `temperature` 和 `top_p` 参数将被忽略。对于需要一致性和可重复性的任务（如代码生成、翻译），建议设置为 `false`。"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，控制输出的随机性和创造性，取值范围为 `[0.0, 1.0]`，限两位小数。对于 `GLM-5.3-Flash`系列默认值为 `1.0`，`GLM-5V-Turbo`，`GLM-4.6V`, `GLM-4.5V`系列默认值为 `0.8`，`AutoGLM-Phone`默认值为 `0.0`，`GLM-4.1v`系列默认值为 `0.8`。较高的值（如`0.8`）会使输出更随机、更具创造性；较低的值（如`0.2`）会使输出更稳定、更确定。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 1,
            "default": 1,
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "description": "核采样（`nucleus sampling`）参数，是`temperature`采样的替代方法，取值范围为 `[0.01, 1.0]`，限两位小数。对于`GLM-5.3-Flash`系列默认值为 `0.95`，`GLM-5V-Turbo`，`GLM-4.6V`, `GLM-4.5V`系列默认值为 `0.6`，`AutoGLM-Phone`默认值为 `0.85`，`GLM-4.1v`系列默认值为 `0.6`。模型只考虑累积概率达到`top_p`的候选词汇。例如：`0.1`表示只考虑前`10%`概率的词汇，`0.9`表示考虑前`90%`概率的词汇。较小的值会产生更集中、更一致的输出；较大的值会增加输出的多样性。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 0.95,
            "default": 0.95,
            "minimum": 0.01,
            "maximum": 1
          },
          "max_tokens": {
            "type": "integer",
            "description": "模型输出的最大令牌`token`数量限制。`GLM-5.3-Flash`系列 `GLM-5V-Turbo`最大支持`128K`输出长度，`GLM-4.6V`最大支持`32K`输出长度，`GLM-4.5V`最大支持`16K`输出长度，`AutoGLM-Phone`最大支持`4K`输出长度，`GLM-4.1v`系列最大支持`16K`输出长度，建议设置不小于`1024`。令牌是文本的基本单位，通常`1`个令牌约等于`0.75`个英文单词或`1.5`个中文字符。设置合适的`max_tokens`可以控制响应长度和成本，避免过长的输出。如果模型在达到`max_tokens`限制前完成回答，会自然结束；如果达到限制，输出可能被截断。\n默认值和最大值等更多详见 [max_tokens 文档](/cn/guide/start/concept-param#max_tokens)",
            "example": 1024,
            "minimum": 1,
            "maximum": 131072
          },
          "tools": {
            "type": "array",
            "description": "模型可以调用的工具列表。仅限`GLM-5.3-Flash`系列 `GLM-4.6V`和`AutoGLM-Phone`支持。使用此参数提供模型可以生成 `JSON` 输入的函数列表或配置其他工具。最多支持 `128` 个函数。",
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionToolSchema"
                }
              }
            ]
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto"
                ],
                "description": "用于控制模型选择调用哪个函数的方式，仅在工具类型为`function`时补充，仅限`GLM-4.6V`支持此参数。默认`auto`且仅支持`auto`。"
              }
            ],
            "description": "控制模型如何选择工具。"
          },
          "stop": {
            "type": "array",
            "description": "停止词列表，当模型生成的文本中遇到这些指定的字符串时会立即停止生成。格式为[\"stop_word1\"]。",
            "items": {
              "type": "string"
            },
            "maxItems": 4
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一标识符。`ID`长度要求：最少`6`个字符，最多`128`个字符，建议使用不包含敏感信息的唯一标识。",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "AsyncChatCompletionVisionRequest": {
        "required": [
          "model",
          "messages"
        ],
        "type": "object",
        "description": "视觉模型请求，支持多模态内容（文本、图片、视频、文件）",
        "properties": {
          "model": {
            "type": "string",
            "description": "调用的视觉模型代码。`GLM-5.3-Flash`、`GLM-5V-Turbo` 系列支持视觉理解，具备卓越的多模态理解能力和工具调用能力。",
            "example": "glm-5.3-flashx",
            "default": "glm-5.3-flashx",
            "enum": [
              "glm-5.3-flashx",
              "glm-5.3-flash",
              "glm-5v-turbo",
              "glm-4.6v",
              "glm-4.6v-flash",
              "glm-4.6v-flashx",
              "glm-4v-flash",
              "glm-4.1v-thinking-flashx",
              "glm-4.1v-thinking-flash"
            ]
          },
          "messages": {
            "type": "array",
            "description": "对话消息列表，包含当前对话的完整上下文信息。每条消息都有特定的角色和内容，模型会根据这些消息生成回复。消息按时间顺序排列，支持角色：`system`（系统消息，用于设定`AI`的行为和角色）、`user`（用户消息，来自用户的输入）、`assistant`（助手消息，来自`AI`的回复）。视觉模型支持纯文本和多模态内容（文本、图片、视频、文件）。注意不能只包含系统或助手消息。",
            "items": {
              "oneOf": [
                {
                  "title": "用户消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "user"
                      ],
                      "description": "消息作者的角色",
                      "default": "user"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "array",
                          "description": "多模态消息内容，支持文本、图片、文件、视频（可从上方切换至文本消息）",
                          "items": {
                            "$ref": "#/components/schemas/VisionMultimodalContentItem"
                          }
                        },
                        {
                          "type": "string",
                          "description": "文本消息内容（可从上方切换至多模态消息）",
                          "example": "What opportunities and challenges will the Chinese large model industry face in 2025?"
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "系统消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system"
                      ],
                      "description": "消息作者的角色",
                      "default": "system"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "消息文本内容",
                          "example": "You are a helpful assistant."
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "助手消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "assistant"
                      ],
                      "description": "消息作者的角色",
                      "default": "assistant"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "文本消息内容",
                          "example": "I'll help you with that analysis."
                        }
                      ]
                    }
                  },
                  "required": [
                    "role"
                  ]
                }
              ]
            },
            "minItems": 1
          },
          "thinking": {
            "$ref": "#/components/schemas/ChatThinking"
          },
          "reasoning_effort": {
            "type": "string",
            "description": "控制模型的推理程度，`thinking` 开启时生效，默认 `max`。`GLM-5.3-FLASH` 系列模型支持 low / high / max 档位。",
            "example": "max",
            "default": "max",
            "enum": [
              "max",
              "high",
              "low"
            ]
          },
          "do_sample": {
            "type": "boolean",
            "example": true,
            "default": true,
            "description": "是否启用采样策略来生成文本。默认值为 `true`。当设置为 `true` 时，模型会使用 `temperature、top_p` 等参数进行随机采样，生成更多样化的输出；当设置为 `false` 时，模型总是选择概率最高的词汇，生成更确定性的输出，此时 `temperature` 和 `top_p` 参数将被忽略。对于需要一致性和可重复性的任务（如代码生成、翻译），建议设置为 `false`。"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，控制输出的随机性和创造性，取值范围为 `[0.0, 1.0]`，限两位小数。对于 `GLM-5.3-Flash`系列默认值为 `1.0`，`GLM-5V-Turbo`，`GLM-4.6V`, `GLM-4.5V`系列默认值为 `0.8`，`AutoGLM-Phone`默认值为 `0.0`，`GLM-4.1v`系列默认值为 `0.8`。较高的值（如`0.8`）会使输出更随机、更具创造性；较低的值（如`0.2`）会使输出更稳定、更确定。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 1,
            "default": 1,
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "description": "核采样（`nucleus sampling`）参数，是`temperature`采样的替代方法，取值范围为 `[0.01, 1.0]`，限两位小数。对于`GLM-5.3-Flash`系列默认值为 `0.95`，`GLM-5V-Turbo`，`GLM-4.6V`, `GLM-4.5V`系列默认值为 `0.6`，`AutoGLM-Phone`默认值为 `0.85`，`GLM-4.1v`系列默认值为 `0.6`。模型只考虑累积概率达到`top_p`的候选词汇。例如：`0.1`表示只考虑前`10%`概率的词汇，`0.9`表示考虑前`90%`概率的词汇。较小的值会产生更集中、更一致的输出；较大的值会增加输出的多样性。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 0.95,
            "default": 0.95,
            "minimum": 0.01,
            "maximum": 1
          },
          "max_tokens": {
            "type": "integer",
            "description": "模型输出的最大令牌`token`数量限制。`GLM-5.3-Flash`系列 `GLM-5V-Turbo`最大支持`128K`输出长度，`GLM-4.6V`最大支持`32K`输出长度，`GLM-4.5V`最大支持`16K`输出长度，`AutoGLM-Phone`最大支持`4K`输出长度，`GLM-4.1v`系列最大支持`16K`输出长度，建议设置不小于`1024`。令牌是文本的基本单位，通常`1`个令牌约等于`0.75`个英文单词或`1.5`个中文字符。设置合适的`max_tokens`可以控制响应长度和成本，避免过长的输出。如果模型在达到`max_tokens`限制前完成回答，会自然结束；如果达到限制，输出可能被截断。\n默认值和最大值等更多详见 [max_tokens 文档](/cn/guide/start/concept-param#max_tokens)",
            "example": 1024,
            "minimum": 1,
            "maximum": 131072
          },
          "tools": {
            "type": "array",
            "description": "模型可以调用的工具列表。仅限`GLM-5.3-Flash`系列 `GLM-4.6V`和`AutoGLM-Phone`支持。使用此参数提供模型可以生成 `JSON` 输入的函数列表或配置其他工具。最多支持 `128` 个函数。",
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionToolSchema"
                }
              }
            ]
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto"
                ],
                "description": "用于控制模型选择调用哪个函数的方式，仅在工具类型为`function`时补充。默认`auto`且仅支持`auto`。"
              }
            ],
            "description": "控制模型如何选择工具。"
          },
          "stop": {
            "type": "array",
            "description": "停止词列表，当模型生成的文本中遇到这些指定的字符串时会立即停止生成。格式为[\"stop_word1\"]。",
            "items": {
              "type": "string"
            },
            "maxItems": 4
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一标识符。`ID`长度要求：最少`6`个字符，最多`128`个字符，建议使用不包含敏感信息的唯一标识。",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "ChatCompletionAudioRequest": {
        "required": [
          "model",
          "messages"
        ],
        "type": "object",
        "description": "音频模型请求，支持语音理解、生成和识别功能",
        "properties": {
          "model": {
            "type": "string",
            "description": "调用的音频模型代码。`GLM-4-Voice` 支持语音理解和生成。",
            "example": "glm-4-voice",
            "default": "glm-4-voice",
            "enum": [
              "glm-4-voice",
              "禁用仅占位"
            ]
          },
          "messages": {
            "type": "array",
            "description": "对话消息列表，包含当前对话的完整上下文信息。每条消息都有特定的角色和内容，模型会根据这些消息生成回复。消息按时间顺序排列，支持角色：`system`（系统消息，用于设定`AI`的行为和角色）、`user`（用户消息，来自用户的输入）、`assistant`（助手消息，来自`AI`的回复）。音频模型支持文本和音频内容。注意不能只包含系统或助手消息。",
            "items": {
              "oneOf": [
                {
                  "title": "用户消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "user"
                      ],
                      "description": "消息作者的角色",
                      "default": "user"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "array",
                          "description": "多模态消息内容，支持文本、音频",
                          "items": {
                            "$ref": "#/components/schemas/AudioMultimodalContentItem"
                          }
                        },
                        {
                          "type": "string",
                          "description": "消息文本内容",
                          "example": "You are a helpful assistant."
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "系统消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system"
                      ],
                      "description": "消息作者的角色",
                      "default": "system"
                    },
                    "content": {
                      "type": "string",
                      "description": "消息文本内容",
                      "example": "你是一个专业的语音助手，能够理解和生成自然语音。"
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "助手消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "assistant"
                      ],
                      "description": "消息作者的角色",
                      "default": "assistant"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "文本消息内容",
                          "example": "I'll help you with that analysis."
                        }
                      ]
                    },
                    "audio": {
                      "type": "object",
                      "description": "语音消息",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "语音消息`id`，用于多轮对话"
                        }
                      }
                    }
                  },
                  "required": [
                    "role"
                  ]
                }
              ]
            },
            "minItems": 1
          },
          "stream": {
            "type": "boolean",
            "example": false,
            "default": false,
            "description": "是否启用流式输出模式。默认值为 `false`。当设置为 `false` 时，模型会在生成完整响应后一次性返回所有内容，适合语音识别和批处理场景。当设置为 `true` 时，模型会通过`Server-Sent Events (SSE)`流式返回生成的内容，用户可以实时看到文本生成过程，适合实时语音对话场景，能提供更好的用户体验。流式输出结束时会返回 `data: [DONE]` 消息。"
          },
          "do_sample": {
            "type": "boolean",
            "example": true,
            "default": true,
            "description": "是否启用采样策略来生成文本。默认值为 `true`。当设置为 `true` 时，模型会使用 `temperature、top_p` 等参数进行随机采样，生成更多样化的输出；当设置为 `false` 时，模型总是选择概率最高的词汇，生成更确定性的输出，此时 `temperature` 和 `top_p` 参数将被忽略。对于需要一致性和可重复性的任务（如语音识别、转录），建议设置为 `false`。"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，控制输出的随机性和创造性，取值范围为 `[0.0, 1.0]`，限两位小数。对于`GLM-4-Voice`默认值为 `0.8`。较高的值（如`0.8`）会使输出更随机、更具创造性，适合语音生成和对话；较低的值（如`0.1`）会使输出更稳定、更确定，适合语音识别和转录。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 0.8,
            "default": 0.8,
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "description": "核采样（`nucleus sampling`）参数，是`temperature`采样的替代方法，取值范围为 `[0.01, 1.0]`，限两位小数。对于`GLM-4-Voice`默认值为 `0.6`。模型只考虑累积概率达到`top_p`的候选词汇。例如：`0.1`表示只考虑前`10%`概率的词汇，`0.9`表示考虑前`90%`概率的词汇。较小的值会产生更集中、更一致的输出；较大的值会增加输出的多样性。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 0.6,
            "default": 0.6,
            "minimum": 0.01,
            "maximum": 1
          },
          "max_tokens": {
            "type": "integer",
            "description": "模型输出的最大令牌`token`数量限制。`GLM-4-Voice`最大支持`4K`输出长度，默认`1024`。令牌是文本的基本单位。",
            "example": 1024,
            "minimum": 1,
            "maximum": 4096
          },
          "watermark_enabled": {
            "type": "boolean",
            "description": "控制`AI`生成图片时是否添加水印。\n - `true`: 默认启用`AI`生成的显式水印及隐式数字水印，符合政策要求。\n - `false`: 关闭所有水印，仅允许已签署免责声明的客户使用，签署路径：个人中心-安全管理-去水印管理",
            "example": true
          },
          "stop": {
            "type": "array",
            "description": "停止词列表，当模型生成的文本中遇到这些指定的字符串时会立即停止生成。格式为[\"stop_word1\"]。",
            "items": {
              "type": "string"
            },
            "maxItems": 4
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一标识符。`ID`长度要求：最少`6`个字符，最多`128`个字符，建议使用不包含敏感信息的唯一标识。",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "AsyncChatCompletionAudioRequest": {
        "required": [
          "model",
          "messages"
        ],
        "type": "object",
        "description": "音频模型请求，支持语音理解、生成和识别功能",
        "properties": {
          "model": {
            "type": "string",
            "description": "调用的音频模型代码。`GLM-4-Voice` 支持语音理解和生成。",
            "example": "glm-4-voice",
            "default": "glm-4-voice",
            "enum": [
              "glm-4-voice",
              "禁用仅占位"
            ]
          },
          "messages": {
            "type": "array",
            "description": "对话消息列表，包含当前对话的完整上下文信息。每条消息都有特定的角色和内容，模型会根据这些消息生成回复。消息按时间顺序排列，支持角色：`system`（系统消息，用于设定`AI`的行为和角色）、`user`（用户消息，来自用户的输入）、`assistant`（助手消息，来自`AI`的回复）。音频模型支持文本和音频内容。注意不能只包含系统或助手消息。",
            "items": {
              "oneOf": [
                {
                  "title": "用户消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "user"
                      ],
                      "description": "消息作者的角色",
                      "default": "user"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "array",
                          "description": "多模态消息内容，支持文本、音频",
                          "items": {
                            "$ref": "#/components/schemas/AudioMultimodalContentItem"
                          }
                        },
                        {
                          "type": "string",
                          "description": "消息文本内容",
                          "example": "You are a helpful assistant."
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "系统消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system"
                      ],
                      "description": "消息作者的角色",
                      "default": "system"
                    },
                    "content": {
                      "type": "string",
                      "description": "消息文本内容",
                      "example": "你是一个专业的语音助手，能够理解和生成自然语音。"
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "助手消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "assistant"
                      ],
                      "description": "消息作者的角色",
                      "default": "assistant"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "文本消息内容",
                          "example": "I'll help you with that analysis."
                        }
                      ]
                    },
                    "audio": {
                      "type": "object",
                      "description": "语音消息",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "语音消息`id`，用于多轮对话"
                        }
                      }
                    }
                  },
                  "required": [
                    "role"
                  ]
                }
              ]
            },
            "minItems": 1
          },
          "do_sample": {
            "type": "boolean",
            "example": true,
            "default": true,
            "description": "是否启用采样策略来生成文本。默认值为 `true`。当设置为 `true` 时，模型会使用 `temperature、top_p` 等参数进行随机采样，生成更多样化的输出；当设置为 `false` 时，模型总是选择概率最高的词汇，生成更确定性的输出，此时 `temperature` 和 `top_p` 参数将被忽略。对于需要一致性和可重复性的任务（如语音识别、转录），建议设置为 `false`。"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，控制输出的随机性和创造性，取值范围为 `[0.0, 1.0]`，限两位小数。对于`GLM-4-Voice`默认值为 `0.8`。较高的值（如`0.8`）会使输出更随机、更具创造性，适合语音生成和对话；较低的值（如`0.1`）会使输出更稳定、更确定，适合语音识别和转录。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 0.8,
            "default": 0.8,
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "description": "核采样（`nucleus sampling`）参数，是`temperature`采样的替代方法，取值范围为 `[0.01, 1.0]`，限两位小数。对于`GLM-4-Voice`默认值为 `0.6`。模型只考虑累积概率达到`top_p`的候选词汇。例如：`0.1`表示只考虑前`10%`概率的词汇，`0.9`表示考虑前`90%`概率的词汇。较小的值会产生更集中、更一致的输出；较大的值会增加输出的多样性。建议根据应用场景调整 `top_p` 或 `temperature` 参数，但不要同时调整两个参数。",
            "format": "float",
            "example": 0.6,
            "default": 0.6,
            "minimum": 0.01,
            "maximum": 1
          },
          "max_tokens": {
            "type": "integer",
            "description": "模型输出的最大令牌`token`数量限制。`GLM-4-Voice`最大支持`4K`输出长度，默认`1024`。令牌是文本的基本单位。",
            "example": 1024,
            "minimum": 1,
            "maximum": 4096
          },
          "watermark_enabled": {
            "type": "boolean",
            "description": "控制`AI`生成图片时是否添加水印。\n - `true`: 默认启用`AI`生成的显式水印及隐式数字水印，符合政策要求。\n - `false`: 关闭所有水印，仅允许已签署免责声明的客户使用，签署路径：个人中心-安全管理-去水印管理",
            "example": true
          },
          "stop": {
            "type": "array",
            "description": "停止词列表，当模型生成的文本中遇到这些指定的字符串时会立即停止生成。格式为[\"stop_word1\"]。",
            "items": {
              "type": "string"
            },
            "maxItems": 4
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一标识符。`ID`长度要求：最少`6`个字符，最多`128`个字符，建议使用不包含敏感信息的唯一标识。",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "VisionMultimodalContentItem": {
        "oneOf": [
          {
            "title": "文本",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ],
                "description": "内容类型为文本",
                "default": "text"
              },
              "text": {
                "type": "string",
                "description": "文本内容"
              }
            },
            "required": [
              "type",
              "text"
            ],
            "additionalProperties": false
          },
          {
            "title": "图片",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "image_url"
                ],
                "description": "内容类型为图片`URL`",
                "default": "image_url"
              },
              "image_url": {
                "type": "object",
                "description": "图片信息",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "图片的`URL`地址或`Base64`编码。图像大小上传限制为每张图像`5M`以下，且像素不超过`6000*6000`。支持`jpg、png、jpeg`格式。`GLM-5.3-Flash`系列 `GLM-5V-Turbo` `GLM4.6V` `GLM4.5V` 系列限制`50`张。`GLM-4V-Plus-0111` 限制`5`张。`GLM-4V-Flash`限制`1`张图像且不支持`Base64`编码。"
                  }
                },
                "required": [
                  "url"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "image_url"
            ],
            "additionalProperties": false
          },
          {
            "title": "视频",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "video_url"
                ],
                "description": "内容类型为视频输入",
                "default": "video_url"
              },
              "video_url": {
                "type": "object",
                "description": "视频信息。注意：`GLM-4V-Plus-0111` 的 `video_url` 参数必须在 `content` 数组的第一位。",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "视频的`URL`地址。`GLM-5.3-Flash`系列 `GLM-5V-Turbo` `GLM-4.6V` `GLM-4.5V` 系列视频大小限制为 `200M` 以内。`GLM-4V-Plus`视频大小限制为`20M`以内，视频时长不超过`30s`。对于其他多模态模型，视频大小限制为`200M`以内。视频类型：`mp4`，`mkv`，`mov`。"
                  }
                },
                "required": [
                  "url"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "video_url"
            ],
            "additionalProperties": false
          },
          {
            "title": "文件",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "file"
                ],
                "description": "新文件类型，兼容历史 `file_url` 类型但不建议增量场景再使用。",
                "default": "file"
              },
              "file": {
                "type": "object",
                "description": "文件内容，支持 `file_id` `file_url` `file_data` 选其一，单文件大小限制 `50M`。",
                "properties": {
                  "file_id": {
                    "type": "string",
                    "description": "内容类型为文件ID，通过 [文件上传](/api-reference/文件-api/上传文件) 接口获取ID。"
                  },
                  "file_url": {
                    "type": "string",
                    "description": "文件的`URL`地址，支持`pdf、txt、word、jsonl、xlsx、pptx`等格式，最多支持`50`个。"
                  },
                  "file_data": {
                    "type": "string",
                    "description": "`Base64` 文件内容，使用 `data:<MIME>;base64,<BASE64_DATA>` 格式。"
                  },
                  "filename": {
                    "type": "string",
                    "description": "文件名称。"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "file"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AudioMultimodalContentItem": {
        "oneOf": [
          {
            "title": "文本",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ],
                "description": "内容类型为文本",
                "default": "text"
              },
              "text": {
                "type": "string",
                "description": "文本内容"
              }
            },
            "required": [
              "type",
              "text"
            ],
            "additionalProperties": false
          },
          {
            "title": "音频",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "input_audio"
                ],
                "description": "内容类型为音频输入",
                "default": "input_audio"
              },
              "input_audio": {
                "type": "object",
                "description": "音频信息，仅`glm-4-voice`支持音频输入",
                "properties": {
                  "data": {
                    "type": "string",
                    "description": "语音文件的`base64`编码。音频最长不超过 `10` 分钟。`1s`音频=`12.5 Tokens`，向上取整。"
                  },
                  "format": {
                    "type": "string",
                    "description": "语音文件的格式，支持`wav`和`mp3`",
                    "enum": [
                      "wav",
                      "mp3"
                    ]
                  }
                },
                "required": [
                  "data",
                  "format"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "input_audio"
            ],
            "additionalProperties": false
          }
        ]
      },
      "FunctionToolSchema": {
        "type": "object",
        "title": "Function Call",
        "properties": {
          "type": {
            "type": "string",
            "default": "function",
            "enum": [
              "function"
            ]
          },
          "function": {
            "$ref": "#/components/schemas/FunctionObject"
          }
        },
        "required": [
          "type",
          "function"
        ],
        "additionalProperties": false
      },
      "FunctionObject": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "要调用的函数名称。必须是 `a-z、A-Z、0-9`，或包含下划线和破折号，最大长度为 `64`。",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "description": {
            "type": "string",
            "description": "函数功能的描述，供模型选择何时以及如何调用函数。"
          },
          "parameters": {
            "$ref": "#/components/schemas/FunctionParameters"
          }
        },
        "required": [
          "name",
          "description",
          "parameters"
        ]
      },
      "FunctionParameters": {
        "type": "object",
        "description": "使用 `JSON Schema` 定义的参数。必须传递 `JSON Schema` 对象以准确定义接受的参数。如果调用函数时不需要参数，则省略。",
        "additionalProperties": true
      },
      "RetrievalToolSchema": {
        "type": "object",
        "title": "Retrieval",
        "properties": {
          "type": {
            "type": "string",
            "default": "retrieval",
            "enum": [
              "retrieval"
            ]
          },
          "retrieval": {
            "$ref": "#/components/schemas/RetrievalObject"
          }
        },
        "required": [
          "type",
          "retrieval"
        ],
        "additionalProperties": false
      },
      "RetrievalObject": {
        "type": "object",
        "properties": {
          "knowledge_id": {
            "type": "string",
            "description": "知识库 `ID`，从平台创建或获取"
          },
          "prompt_template": {
            "type": "string",
            "description": "请求模型的提示模板，包含占位符 `{{ knowledge }}` 和 `{{ question }}` 的自定义请求模板。默认模板：`在文档 `{{ knowledge }}` 中搜索问题 `{{question}}` 的答案。如果找到答案，仅使用文档中的陈述进行回应；如果没有找到答案，使用你自己的知识回答并告知用户信息不来自文档。不要重复问题，直接开始答案。`"
          }
        },
        "required": [
          "knowledge_id"
        ]
      },
      "ChatThinking": {
        "type": "object",
        "description": "仅 `GLM-4.5` 及以上模型支持此参数配置. 控制大模型是否开启思维链。",
        "properties": {
          "type": {
            "type": "string",
            "description": "是否开启思维链(`GLM-5.3` `GLM-5.3-FLASH`系列限制只能开启，由 `reasoning_effort` 控制思考强度。其它模型当开启后 `GLM-5.2` `GLM-5.1` `GLM-5` `GLM-5-Turbo` `GLM-5v-Turbo` `GLM-4.6` `GLM-4.6V` `GLM-4.5` 为模型自动判断是否思考，`GLM-4.7` `GLM-4.5V` 为强制思考), 默认: `enabled`.",
            "default": "enabled",
            "enum": [
              "enabled",
              "disabled"
            ]
          },
          "clear_thinking": {
            "type": "boolean",
            "description": "默认为 `True`。用于控制是否清除历史对话轮次（`previous turns`）中的 `reasoning_content`。详见 [思考模式](/cn/guide/capabilities/thinking-mode) \n - `true`（默认）：在本次请求中，系统会忽略/移除历史 `turns` 的 `reasoning_content`，仅使用非推理内容（如用户/助手可见文本、工具调用与结果等）作为上下文输入。适用于普通对话与轻量任务，可降低上下文长度与成本 \n - `false`：保留历史 `turns` 的 `reasoning_content` 并随上下文一同提供给模型。若你希望启用 `Preserved Thinking`，必须在 `messages` 中完整、未修改、按原顺序透传历史 `reasoning_content`；缺失、裁剪、改写或重排会导致效果下降或无法生效。\n - 注意：该参数只影响跨 `turn` 的历史 `thinking blocks`；不改变模型在当前 `turn` 内是否产生/输出 `thinking`",
            "default": true,
            "example": true
          }
        }
      },
      "WebSearchToolSchema": {
        "type": "object",
        "title": "Web Search",
        "properties": {
          "type": {
            "type": "string",
            "default": "web_search",
            "enum": [
              "web_search"
            ]
          },
          "web_search": {
            "$ref": "#/components/schemas/WebSearchObject"
          }
        },
        "required": [
          "type",
          "web_search"
        ],
        "additionalProperties": false
      },
      "WebSearchObject": {
        "type": "object",
        "properties": {
          "enable": {
            "type": "boolean",
            "description": "是否启用搜索功能，默认值为 `false`，启用时设置为 `true`"
          },
          "search_engine": {
            "type": "string",
            "description": "搜索引擎类型，默认为 `search_std`；支持`search_std、search_pro、search_pro_sogou、search_pro_quark`。",
            "enum": [
              "search_std",
              "search_pro",
              "search_pro_sogou",
              "search_pro_quark"
            ]
          },
          "search_query": {
            "type": "string",
            "description": "强制触发搜索"
          },
          "search_intent": {
            "type": "string",
            "description": "是否进行搜索意图识别，默认执行搜索意图识别。`true`：执行搜索意图识别，有搜索意图后执行搜索；`false`：跳过搜索意图识别，直接执行搜索"
          },
          "count": {
            "type": "integer",
            "description": "返回结果的条数。可填范围：`1-50`，最大单次搜索返回`50`条，默认为`10`。支持的搜索引擎：`search_std、search_pro、search_pro_sogou`。对于`search_pro_sogou`: 可选枚举值，`10、20、30、40、50`",
            "minimum": 1,
            "maximum": 50
          },
          "search_domain_filter": {
            "type": "string",
            "description": "用于限定搜索结果的范围，仅返回指定白名单域名的内容。\n白名单域名:（如 `www.example.com`）。\n支持的搜索引擎：`search_std、search_pro、search_pro_sogou`"
          },
          "search_recency_filter": {
            "type": "string",
            "description": "搜索指定时间范围内的网页。默认为`noLimit`。可填值：`oneDay`（一天内）、`oneWeek`（一周内）、`oneMonth`（一个月内）、`oneYear`（一年内）、`noLimit`（不限，默认）。支持的搜索引擎：`search_std、search_pro、search_pro_sogou、search_pro_quark`",
            "enum": [
              "oneDay",
              "oneWeek",
              "oneMonth",
              "oneYear",
              "noLimit"
            ]
          },
          "content_size": {
            "type": "string",
            "description": "控制网页摘要的字数。默认值为`medium`。`medium`：返回摘要信息，满足大模型的基础推理需求。`high`：最大化上下文，信息量较大但内容详细，适合需要信息细节的场景。",
            "enum": [
              "medium",
              "high"
            ]
          },
          "result_sequence": {
            "type": "string",
            "description": "指定搜索结果返回的顺序是在模型回复结果之前还是之后，可选值：`before`、`after`，默认 `after`",
            "enum": [
              "before",
              "after"
            ]
          },
          "search_result": {
            "type": "boolean",
            "description": "是否返回搜索来源的详细信息，默认值 `false`"
          },
          "require_search": {
            "type": "boolean",
            "description": "是否强制搜索结果才返回回答，默认值 `false`"
          },
          "search_prompt": {
            "type": "string",
            "description": "用于定制搜索结果处理的`Prompt`，默认`Prompt`：\n\n你是一位智能问答专家，具备整合信息的能力，能够进行时间识别、语义理解与矛盾信息清洗处理。\n当前日期是{{current_date}}，请以此时间为唯一基准，参考以下信息，全面、准确地回答用户问题。\n仅提炼有价值的内容用于回答，确保答案具有实时性与权威性，直接陈述答案，无需说明数据来源或内部处理过程。"
          }
        },
        "required": [
          "search_engine"
        ]
      },
      "MCPToolSchema": {
        "type": "object",
        "title": "MCP",
        "properties": {
          "type": {
            "type": "string",
            "default": "mcp",
            "enum": [
              "mcp"
            ]
          },
          "mcp": {
            "$ref": "#/components/schemas/MCPObject"
          }
        },
        "required": [
          "type",
          "mcp"
        ],
        "additionalProperties": false
      },
      "MCPObject": {
        "type": "object",
        "properties": {
          "server_label": {
            "description": "`mcp server`标识，如果连接智谱的`mcp server`，以`mcp code`填充该字段，且无需填写`server_url`",
            "type": "string"
          },
          "server_url": {
            "description": "`mcp server`地址",
            "type": "string"
          },
          "transport_type": {
            "description": "传输类型",
            "type": "string",
            "default": "streamable-http",
            "enum": [
              "sse",
              "streamable-http"
            ]
          },
          "allowed_tools": {
            "description": "允许的工具集合",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "headers": {
            "description": "`mcp server` 需要的鉴权信息",
            "type": "object"
          }
        },
        "required": [
          "server_label"
        ]
      },
      "ChatCompletionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "description": "任务 `ID`",
            "type": "string"
          },
          "request_id": {
            "description": "请求 `ID`",
            "type": "string"
          },
          "created": {
            "description": "请求创建时间，`Unix` 时间戳（秒）",
            "type": "integer"
          },
          "model": {
            "description": "模型名称",
            "type": "string"
          },
          "choices": {
            "type": "array",
            "description": "模型响应列表",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "结果索引"
                },
                "message": {
                  "$ref": "#/components/schemas/ChatCompletionResponseMessage"
                },
                "finish_reason": {
                  "type": "string",
                  "description": "推理终止原因。'stop’表示自然结束或触发stop词，'tool_calls’表示模型命中函数，'length’表示达到token长度限制，'sensitive’表示内容被安全审核接口拦截（用户应判断并决定是否撤回公开内容），'network_error’表示模型推理异常，'model_context_window_exceeded'表示超出模型上下文窗口。"
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "description": "调用结束时返回的 `Token` 使用统计。",
            "properties": {
              "prompt_tokens": {
                "type": "number",
                "description": "用户输入的 `Token` 数量。"
              },
              "completion_tokens": {
                "type": "number",
                "description": "输出的 `Token` 数量"
              },
              "prompt_tokens_details": {
                "type": "object",
                "properties": {
                  "cached_tokens": {
                    "type": "number",
                    "description": "命中的缓存 `Token` 数量"
                  }
                }
              },
              "total_tokens": {
                "type": "integer",
                "description": "`Token` 总数，对于 `glm-4-voice` 模型，`1`秒音频=`12.5 Tokens`，向上取整"
              }
            }
          },
          "video_result": {
            "type": "array",
            "description": "视频生成结果。",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "视频链接。"
                },
                "cover_image_url": {
                  "type": "string",
                  "description": "视频封面链接。"
                }
              }
            }
          },
          "web_search": {
            "type": "array",
            "description": "返回与网页搜索相关的信息，使用`WebSearchToolSchema`时返回",
            "items": {
              "type": "object",
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "来源网站的图标"
                },
                "title": {
                  "type": "string",
                  "description": "搜索结果的标题"
                },
                "link": {
                  "type": "string",
                  "description": "搜索结果的网页链接"
                },
                "media": {
                  "type": "string",
                  "description": "搜索结果网页的媒体来源名称"
                },
                "publish_date": {
                  "type": "string",
                  "description": "网站发布时间"
                },
                "content": {
                  "type": "string",
                  "description": "搜索结果网页引用的文本内容"
                },
                "refer": {
                  "type": "string",
                  "description": "角标序号"
                }
              }
            }
          },
          "content_filter": {
            "type": "array",
            "description": "返回内容安全的相关信息",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "description": "安全生效环节，包括 `role = assistant` 模型推理，`role = user` 用户输入，`role = history` 历史上下文"
                },
                "level": {
                  "type": "integer",
                  "description": "严重程度 `level 0-3`，`level 0`表示最严重，`3`表示轻微"
                }
              }
            }
          }
        }
      },
      "ChatCompletionResponseMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "当前对话角色，默认为 `assistant`",
            "example": "assistant"
          },
          "content": {
            "oneOf": [
              {
                "type": "string",
                "description": "当前对话文本内容。如果调用函数则为 `null`，否则返回推理结果。\n对于`GLM-4.5V`系列模型，返回内容可能包含思考过程标签 `<think> </think>`，文本边界标签 `<|begin_of_box|> <|end_of_box|>`。"
              },
              {
                "type": "array",
                "description": "多模态回复内容，适用于`GLM-4V`系列模型",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "text"
                      ],
                      "description": "回复内容类型，目前为文本"
                    },
                    "text": {
                      "type": "string",
                      "description": "文本内容"
                    }
                  }
                }
              },
              {
                "type": "string",
                "nullable": true,
                "description": "当使用`tool_calls`时，`content`可能为`null`"
              }
            ]
          },
          "reasoning_content": {
            "type": "string",
            "description": "思维链内容，仅在使用 `glm-4.5` 系列, `glm-4.1v-thinking` 系列模型时返回。"
          },
          "audio": {
            "type": "object",
            "description": "当使用 `glm-4-voice` 模型时返回的音频内容",
            "properties": {
              "id": {
                "type": "string",
                "description": "当前对话的音频内容`id`，可用于多轮对话输入"
              },
              "data": {
                "type": "string",
                "description": "当前对话的音频内容`base64`编码"
              },
              "expires_at": {
                "type": "string",
                "description": "当前对话的音频内容过期时间"
              }
            }
          },
          "tool_calls": {
            "type": "array",
            "description": "生成的应该被调用的函数名称和参数。",
            "items": {
              "$ref": "#/components/schemas/ChatCompletionResponseMessageToolCall"
            }
          }
        }
      },
      "ChatCompletionResponseMessageToolCall": {
        "type": "object",
        "properties": {
          "function": {
            "type": "object",
            "description": "包含生成的函数名称和 `JSON` 格式参数。",
            "properties": {
              "name": {
                "type": "string",
                "description": "生成的函数名称。"
              },
              "arguments": {
                "type": "string",
                "description": "生成的函数调用参数的 `JSON` 格式字符串。调用函数前请验证参数。"
              }
            },
            "required": [
              "name",
              "arguments"
            ]
          },
          "mcp": {
            "type": "object",
            "description": "`MCP` 工具调用参数",
            "properties": {
              "id": {
                "description": "`mcp` 工具调用唯一标识",
                "type": "string"
              },
              "type": {
                "description": "工具调用类型, 例如 `mcp_list_tools, mcp_call`",
                "type": "string",
                "enum": [
                  "mcp_list_tools",
                  "mcp_call"
                ]
              },
              "server_label": {
                "description": "`MCP`服务器标签",
                "type": "string"
              },
              "error": {
                "description": "错误信息",
                "type": "string"
              },
              "tools": {
                "description": "`type = mcp_list_tools` 时的工具列表",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "description": "工具名称",
                      "type": "string"
                    },
                    "description": {
                      "description": "工具描述",
                      "type": "string"
                    },
                    "annotations": {
                      "description": "工具注解",
                      "type": "object"
                    },
                    "input_schema": {
                      "description": "工具输入参数规范",
                      "type": "object",
                      "properties": {
                        "type": {
                          "description": "固定值 'object'",
                          "type": "string",
                          "default": "object",
                          "enum": [
                            "object"
                          ]
                        },
                        "properties": {
                          "description": "参数属性定义",
                          "type": "object"
                        },
                        "required": {
                          "description": "必填属性列表",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": {
                          "description": "是否允许额外参数",
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              },
              "arguments": {
                "description": "工具调用参数，参数为 `json` 字符串",
                "type": "string"
              },
              "name": {
                "description": "工具名称",
                "type": "string"
              },
              "output": {
                "description": "工具返回的结果输出",
                "type": "object"
              }
            }
          },
          "id": {
            "type": "string",
            "description": "命中函数的唯一标识符。"
          },
          "type": {
            "type": "string",
            "description": "调用的工具类型，目前仅支持 'function', 'mcp'。"
          }
        }
      },
      "ChatCompletionChunk": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "任务 ID"
          },
          "created": {
            "type": "integer",
            "description": "请求创建时间，`Unix` 时间戳（秒）"
          },
          "model": {
            "type": "string",
            "description": "模型名称"
          },
          "choices": {
            "type": "array",
            "description": "模型响应列表",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "结果索引"
                },
                "delta": {
                  "type": "object",
                  "description": "模型增量返回的文本信息",
                  "properties": {
                    "role": {
                      "type": "string",
                      "description": "当前对话的角色，目前默认为 `assistant`（模型）"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "当前对话文本内容。如果调用函数则为 `null`，否则返回推理结果。\n对于`GLM-4.5V`系列模型，返回内容可能包含思考过程标签 `<think> </think>`，文本边界标签 `<|begin_of_box|> <|end_of_box|>`。"
                        },
                        {
                          "type": "array",
                          "description": "当前对话的多模态内容（适用于`GLM-4V`系列）",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "text"
                                ],
                                "description": "内容类型，目前为文本"
                              },
                              "text": {
                                "type": "string",
                                "description": "文本内容"
                              }
                            }
                          }
                        },
                        {
                          "type": "string",
                          "nullable": true,
                          "description": "当使用`tool_calls`时，`content`可能为`null`"
                        }
                      ]
                    },
                    "audio": {
                      "type": "object",
                      "description": "当使用 `glm-4-voice` 模型时返回的音频内容",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "当前对话的音频内容`id`，可用于多轮对话输入"
                        },
                        "data": {
                          "type": "string",
                          "description": "当前对话的音频内容`base64`编码"
                        },
                        "expires_at": {
                          "type": "string",
                          "description": "当前对话的音频内容过期时间"
                        }
                      }
                    },
                    "reasoning_content": {
                      "type": "string",
                      "description": "思维链内容, 仅 `glm-4.5` 系列支持"
                    },
                    "tool_calls": {
                      "type": "array",
                      "description": "生成的应该被调用的工具信息，流式返回时会逐步生成",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer",
                            "description": "工具调用索引"
                          },
                          "id": {
                            "type": "string",
                            "description": "工具调用的唯一标识符"
                          },
                          "type": {
                            "type": "string",
                            "description": "工具类型，目前支持`function`",
                            "enum": [
                              "function"
                            ]
                          },
                          "function": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "description": "函数名称"
                              },
                              "arguments": {
                                "type": "string",
                                "description": "函数参数，`JSON`格式字符串"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "finish_reason": {
                  "type": "string",
                  "description": "模型推理终止的原因。`stop` 表示自然结束或触发stop词，`tool_calls` 表示模型命中函数，`length` 表示达到 `token` 长度限制，`sensitive` 表示内容被安全审核接口拦截（用户应判断并决定是否撤回公开内容），`network_error` 表示模型推理异常，'model_context_window_exceeded'表示超出模型上下文窗口。",
                  "enum": [
                    "stop",
                    "length",
                    "tool_calls",
                    "sensitive",
                    "network_error"
                  ]
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "description": "本次模型调用的 `tokens` 数量统计",
            "properties": {
              "prompt_tokens": {
                "type": "integer",
                "description": "用户输入的 `tokens` 数量。对于 `glm-4-voice`，`1`秒音频=`12.5 Tokens`，向上取整。"
              },
              "completion_tokens": {
                "type": "integer",
                "description": "模型输出的 `tokens` 数量"
              },
              "total_tokens": {
                "type": "integer",
                "description": "总 `tokens` 数量，对于 `glm-4-voice` 模型，`1`秒音频=`12.5 Tokens`，向上取整"
              }
            }
          },
          "content_filter": {
            "type": "array",
            "description": "返回内容安全的相关信息",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "description": "安全生效环节，包括：`role = assistant` 模型推理，`role = user` 用户输入，`role = history` 历史上下文"
                },
                "level": {
                  "type": "integer",
                  "description": "严重程度 `level 0-3`，`level 0` 表示最严重，`3` 表示轻微"
                }
              }
            }
          }
        }
      },
      "CogVideoX3Request": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseVideoGenerationRequest"
          },
          {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "description": "要调用的模型编码。",
                "enum": [
                  "cogvideox-3"
                ]
              },
              "prompt": {
                "type": "string",
                "example": "A cat is playing with a ball.",
                "description": "视频的文本描述，字符长度不能超过`512`个字符。`image_url` 和 `prompt` 不能同时为空。"
              },
              "image_url": {
                "description": "提供基于其生成内容的图像，如果传入此参数，系统将以该图像为基础进行操作。支持通过`URL`或`Base64`编码传入图片。图片要求如下：图片支持.`png、.jpeg、.jpg` 格式、图片大小：不超过`5M`。 `image_url` 和 `prompt` 不能同时为空。\n首尾帧：支持输入两张图，上传的第一张图片视作首帧图，第二张图片视作尾帧图，模型将以此参数中传入的图片来生成视频。",
                "$ref": "#/components/schemas/ImageUrlInputExtended"
              },
              "size": {
                "type": "string",
                "description": "默认值：若不指定，默认生成视频的短边为 `1080`，长边根据原图片比例确认。最高支持 `4K` 分辨率。",
                "example": "1920x1080",
                "enum": [
                  "1280x720",
                  "720x1280",
                  "1024x1024",
                  "1920x1080",
                  "1080x1920",
                  "2048x1080",
                  "3840x2160"
                ]
              },
              "fps": {
                "type": "integer",
                "description": "视频帧率（`FPS`），可选值为 `30` 或 `60`。默认值：`30`。",
                "example": 30,
                "enum": [
                  30,
                  60
                ]
              },
              "duration": {
                "type": "integer",
                "description": "视频持续时长，默认`5`秒，支持`5`、`10`",
                "example": 5,
                "enum": [
                  5,
                  10
                ]
              }
            },
            "required": [
              "model"
            ]
          },
          {
            "$ref": "#/components/schemas/VideoCommonRequest"
          }
        ]
      },
      "CogVideoXRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseVideoGenerationRequest"
          },
          {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "description": "要调用的代码。",
                "enum": [
                  "cogvideox-2",
                  "cogvideox-flash"
                ]
              },
              "prompt": {
                "type": "string",
                "description": "视频的文本描述，最大输入长度为 `512` 个字符。必须提供 `image_url` 或 `prompt`，或两者都提供。"
              },
              "image_url": {
                "description": "用于内容生成的基础图像。如果提供，系统将基于此图像进行操作。支持 `URL` 或 `Base64` 编码图像。图像要求：支持 `.png、.jpeg、.jpg` 格式；图像大小不超过 `5M`。必须提供 `image_url` 或 `prompt`，或两者都提供。",
                "$ref": "#/components/schemas/ImageUrlInput"
              },
              "size": {
                "type": "string",
                "description": "默认：如果未指定，生成视频的短边默认为 `1080`，长边根据原始图像比例缩放。支持最高 `4K` 分辨率。分辨率选项：`720x480`、`1024x1024`、`1280x960`、`960x1280`、`1920x1080`、`1080x1920`、`2048x1080`、`3840x2160`。",
                "example": "1920x1080",
                "enum": [
                  "720x480",
                  "1024x1024",
                  "1280x960",
                  "960x1280",
                  "1920x1080",
                  "1080x1920",
                  "2048x1080",
                  "3840x2160"
                ]
              },
              "fps": {
                "type": "integer",
                "description": "视频帧率（`FPS`），可选值为 `30` 或 `60`。默认：`30`。",
                "example": 30,
                "enum": [
                  30,
                  60
                ]
              }
            },
            "required": [
              "model"
            ]
          },
          {
            "$ref": "#/components/schemas/VideoCommonRequest"
          }
        ]
      },
      "ViduText2VideoRequest": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "description": "要调用的代码。",
                "enum": [
                  "viduq1-text"
                ]
              },
              "prompt": {
                "type": "string",
                "description": "视频的文本描述，最大输入长度为 `512` 个字符。"
              },
              "style": {
                "type": "string",
                "description": "风格\n默认：`general`\n可选值：`general`、`anime`\n`general`：通用风格，可以使用提示词控制定义风格。\n`anime`：动漫风格，针对动漫特定视觉效果进行优化。可以使用不同的动漫主题提示词控制风格。",
                "enum": [
                  "general",
                  "anime"
                ]
              },
              "duration": {
                "type": "integer",
                "description": "视频时长参数。\n默认：`5`，可选：`5`。",
                "example": 5,
                "enum": [
                  5
                ]
              },
              "aspect_ratio": {
                "type": "string",
                "description": "宽高比\n默认：`16:9`，可选值：`16:9`、`9:16`、`1:1`",
                "example": "16:9",
                "enum": [
                  "16:9",
                  "9:16",
                  "1:1"
                ]
              },
              "size": {
                "type": "string",
                "description": "分辨率参数\n默认：`1920x1080`，可选：`1920x1080`",
                "example": "1920x1080",
                "enum": [
                  "1920x1080"
                ]
              },
              "movement_amplitude": {
                "type": "string",
                "description": "运动幅度\n默认：`auto`，可选值：`auto`、`small`、`medium`、`large`",
                "example": "auto",
                "enum": [
                  "auto",
                  "small",
                  "medium",
                  "large"
                ]
              }
            },
            "required": [
              "model",
              "prompt"
            ]
          },
          {
            "$ref": "#/components/schemas/VideoCommonRequest"
          }
        ]
      },
      "ViduImage2VideoRequest": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "description": "要调用的代码。",
                "enum": [
                  "viduq1-image",
                  "vidu2-image"
                ]
              },
              "prompt": {
                "type": "string",
                "description": "视频的文本描述，最大输入长度为 `512` 个字符。必须提供 `image_url` 或 `prompt`，或两者都提供。"
              },
              "image_url": {
                "description": "系统将使用此参数中提供的图像作为第一帧来生成视频。\n仅支持 `1` 张图像。\n支持的格式：`png`、`jpeg`、`jpg`、`webp`。\n图像宽高比必须小于 `1:4` 或 `4:1`。\n图像文件大小不得超过 `50MB`。\n注意：`Base64` 解码后，字节长度必须小于 `50MB`，编码必须包含适当的内容类型字符串（例如，`data:image/png;base64,{base64_encode}`）。",
                "$ref": "#/components/schemas/ImageUrlInput"
              },
              "duration": {
                "oneOf": [
                  {
                    "title": "viduq1-image",
                    "type": "integer",
                    "description": "视频时长参数。\n默认：`5`，可选：`5`。",
                    "example": 5,
                    "enum": [
                      5
                    ]
                  },
                  {
                    "title": "viduq2-image",
                    "type": "integer",
                    "description": "视频时长参数。\n默认：`4`，可选：`4`。",
                    "example": 4,
                    "enum": [
                      4
                    ]
                  }
                ]
              },
              "size": {
                "oneOf": [
                  {
                    "title": "viduq1-image",
                    "type": "string",
                    "description": "分辨率参数\n默认：`1920x1080`，可选：`1920x1080`",
                    "example": "1920x1080",
                    "enum": [
                      "1920x1080"
                    ]
                  },
                  {
                    "title": "viduq2-image",
                    "type": "string",
                    "description": "分辨率参数\n默认：`1280x720`，可选：`1280x720`",
                    "example": "1280x720",
                    "default": "1280x720",
                    "enum": [
                      "1280x720"
                    ]
                  }
                ]
              },
              "movement_amplitude": {
                "type": "string",
                "description": "运动幅度\n默认：`auto`，可选值：`auto`、`small`、`medium`、`large`",
                "example": "auto",
                "enum": [
                  "auto",
                  "small",
                  "medium",
                  "large"
                ]
              },
              "with_audio": {
                "type": "boolean",
                "description": "为生成的视频添加背景音乐，仅当最终生成的视频时长为 `4`秒 时支持。"
              }
            },
            "required": [
              "model"
            ]
          },
          {
            "$ref": "#/components/schemas/VideoCommonRequest"
          }
        ]
      },
      "ViduFrames2VideoRequest": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "description": "要调用的代码。",
                "enum": [
                  "viduq1-start-end",
                  "vidu2-start-end"
                ]
              },
              "prompt": {
                "type": "string",
                "description": "视频的文本描述，最大输入长度为 `512` 个字符。必须提供 `image_url` 或 `prompt`，或两者都提供。"
              },
              "image_url": {
                "type": "array",
                "description": "图像\n支持输入两张图像：第一张上传的图像将被视为第一帧，第二张图像作为最后一帧。模型将使用此参数中提供的图像来生成视频。\n两张输入图像（第一帧和最后一帧）的分辨率必须相似，第一帧分辨率与最后一帧分辨率的比例应在 `0.8–1.25` 范围内。此外，图像宽高比必须小于 `1:4` 或 `4:1`。\n支持图像 `URL` 或 `Base64` 编码的图像（确保可访问性；建议使用图像 URL）。\n支持的格式：`png`、`jpeg`、`.jpg`、`webp`。\n图像文件大小不得超过 `50 MB`。\n注意：`Base64` 解码后，字节长度必须小于 `50MB`，编码必须包含适当的内容类型字符串，例如 `data:image/png;base64,{base64_encode}`。",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 1,
                "maxItems": 2
              },
              "duration": {
                "oneOf": [
                  {
                    "title": "viduq1-start-end",
                    "type": "integer",
                    "description": "视频时长参数。\n默认：`5`，可选：`5`。",
                    "example": 5,
                    "enum": [
                      5
                    ]
                  },
                  {
                    "title": "vidu2-start-end",
                    "type": "integer",
                    "description": "视频时长参数。\n默认：`4`，可选：`4`。",
                    "example": 4,
                    "enum": [
                      4
                    ]
                  }
                ]
              },
              "size": {
                "oneOf": [
                  {
                    "title": "viduq1-start-end",
                    "type": "string",
                    "description": "分辨率参数\n默认：`1920x1080`，可选：`1920x1080`",
                    "example": "1920x1080",
                    "enum": [
                      "1920x1080"
                    ]
                  },
                  {
                    "title": "vidu2-start-end",
                    "type": "string",
                    "description": "分辨率参数\n默认：`1280x720`，可选：`1280x720`, `480x360`",
                    "example": "1280x720",
                    "default": "1280x720",
                    "enum": [
                      "1280x720",
                      "480x360"
                    ]
                  }
                ]
              },
              "movement_amplitude": {
                "type": "string",
                "description": "运动幅度\n默认：`auto`，可选值：`auto`、`small`、`medium`、`large`",
                "example": "auto",
                "enum": [
                  "auto",
                  "small",
                  "medium",
                  "large"
                ]
              },
              "with_audio": {
                "type": "boolean",
                "description": "为生成的视频添加背景音乐。"
              }
            },
            "required": [
              "model"
            ]
          },
          {
            "$ref": "#/components/schemas/VideoCommonRequest"
          }
        ]
      },
      "ViduReference2VideoRequest": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "description": "要调用的代码。",
                "enum": [
                  "vidu2-reference"
                ]
              },
              "prompt": {
                "type": "string",
                "description": "视频的文本描述，最大输入长度为 `512` 个字符。必须提供 `image_url` 或 `prompt`，或两者都提供。"
              },
              "image_url": {
                "type": "array",
                "description": "图像参考\n支持输入 `1` 到 `3` 张图像。模型将使用此参数中提供的图像主题作为参考，生成具有一致主体的视频。\n1. 支持图像 `URL` 或 `Base64` 编码的图像（确保可访问性；建议优先使用图像 URL）。\n2. 支持的格式：`png`、`jpeg`、`.jpg`、`webp`。\n3. 图像分辨率不得小于 `128x128`，宽高比必须小于 `1:4` 或 `4:1`。\n4. 图像文件大小不得超过 `50 MB`。\n5. 注意：`Base64` 解码后，字节长度必须小于 `50MB`，编码必须包含适当的内容类型字符串，例如 `data:image/png;base64,{base64_encode}`。",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 1,
                "maxItems": 3
              },
              "duration": {
                "title": "vidu2-reference",
                "type": "integer",
                "description": "视频时长参数。\n默认：`4`，可选：`4`。",
                "example": 4,
                "enum": [
                  4
                ]
              },
              "aspect_ratio": {
                "type": "string",
                "description": "宽高比\n默认：`16:9`，可选值：`16:9`、`9:16`、`1:1`",
                "example": "16:9",
                "enum": [
                  "16:9",
                  "9:16",
                  "1:1"
                ]
              },
              "size": {
                "title": "vidu2-reference ",
                "type": "string",
                "description": "分辨率参数\n默认：`1280x720`，可选：`1280x720`",
                "example": "1280x720",
                "enum": [
                  "1280x720"
                ]
              },
              "movement_amplitude": {
                "type": "string",
                "description": "运动幅度\n默认：`auto`，可选值：`auto`、`small`、`medium`、`large`",
                "example": "auto",
                "enum": [
                  "auto",
                  "small",
                  "medium",
                  "large"
                ]
              },
              "with_audio": {
                "type": "boolean",
                "description": "为生成的视频添加背景音乐。"
              }
            },
            "required": [
              "model"
            ]
          },
          {
            "$ref": "#/components/schemas/VideoCommonRequest"
          }
        ]
      },
      "ImageUrlInput": {
        "oneOf": [
          {
            "title": "Image URL",
            "type": "string",
            "format": "uri",
            "example": "https://example.com/image.png"
          },
          {
            "title": "Base64 Encoded Image",
            "type": "string",
            "format": "byte",
            "example": "data:image/png;base64, XXX"
          }
        ]
      },
      "ImageUrlInputExtended": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ImageUrlInput"
          },
          {
            "title": "Image URLs Array (First & Last Frame)",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "minItems": 2,
            "maxItems": 2,
            "example": [
              "https://example.com/first_frame.png",
              "https://example.com/last_frame.png"
            ]
          }
        ]
      },
      "BaseVideoGenerationRequest": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "视频的文本描述"
          },
          "quality": {
            "type": "string",
            "description": "输出模式，默认为 `speed`。 `quality`：质量优先，生成质量高。 `speed`：速度优先，生成时间更快，质量相对稍低。",
            "example": "speed",
            "enum": [
              "speed",
              "quality"
            ]
          },
          "with_audio": {
            "type": "boolean",
            "description": "是否生成 `AI` 音效。默认值：`False` （不生成音效）。",
            "example": false
          },
          "watermark_enabled": {
            "type": "boolean",
            "description": "控制`AI`生成图片时是否添加水印。\n - `true`: 默认启用`AI`生成的显式水印及隐式数字水印，符合政策要求。\n - `false`: 关闭所有水印，仅允许已签署免责声明的客户使用，签署路径：个人中心-安全管理-去水印管理",
            "example": true
          }
        }
      },
      "VideoCommonRequest": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "由客户端提供，必须唯一；用于区分每个请求的唯一标识符。如果客户端未提供，平台将默认生成一个。"
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一 `ID`，协助平台干预终端用户违规、生成非法或不当信息或其他滥用行为。`ID` 长度要求：最少 `6` 个字符，最多 `128` 个字符。"
          }
        }
      },
      "AsyncResponse": {
        "type": "object",
        "properties": {
          "model": {
            "description": "此次调用使用的名称。",
            "type": "string"
          },
          "id": {
            "description": "生成的任务`ID`，调用请求结果接口时使用此`ID`。",
            "type": "string"
          },
          "request_id": {
            "description": "用户在客户端请求期间提交的任务编号或平台生成的任务编号。",
            "type": "string"
          },
          "task_status": {
            "description": "处理状态，`PROCESSING (处理中)`、`SUCCESS (成功)`、`FAIL (失败)`。结果需要通过查询获取。",
            "type": "string"
          }
        }
      },
      "WebSearchRequest": {
        "type": "object",
        "properties": {
          "search_query": {
            "type": "string",
            "description": "需要进行搜索的内容，建议搜索 `query` 不超过 `70` 个字符。",
            "maxLength": 70
          },
          "search_engine": {
            "type": "string",
            "description": "要调用的搜索引擎编码。目前支持：\n`search_std`：智谱基础版搜索引擎\n`search_pro`：智谱高阶版搜索引擎\n`search_pro_sogou`：搜狗\n`search_pro_quark`：夸克搜索",
            "example": "search_std",
            "enum": [
              "search_std",
              "search_pro",
              "search_pro_sogou",
              "search_pro_quark"
            ]
          },
          "search_intent": {
            "type": "boolean",
            "description": "是否进行搜索意图识别，默认不执行搜索意图识别。\n`true`：执行搜索意图识别，有搜索意图后执行搜索\n`false`：跳过搜索意图识别，直接执行搜索",
            "default": false
          },
          "count": {
            "type": "integer",
            "description": "返回结果的条数。可填范围：`1-50`，最大单次搜索返回`50`条，默认为`10`。\n支持的搜索引擎：`search_pro_sogou`、`search_std`、`search_pro`\n`search_pro_sogou`: 可选枚举值，10、20、30、40、50。注意同时指定 search_domain_filter 和 search_recency_filter 时 count 不生效。",
            "minimum": 1,
            "maximum": 50,
            "default": 10
          },
          "search_domain_filter": {
            "type": "string",
            "description": "用于限定搜索结果的范围，仅返回指定白名单域名的内容。\n白名单域名:（如 `www.example.com`）\n支持的搜索引擎：`search_std、search_pro 、search_pro_sogou`"
          },
          "search_recency_filter": {
            "type": "string",
            "description": "搜索指定时间范围内的网页。默认为 `noLimit`。可填值：`oneDay`（一天内）、`oneWeek`（一周内）、`oneMonth`（一个月内）、`oneYear`（一年内）、`noLimit`（不限，默认）。支持的搜索引擎：`search_std、search_pro、search_pro_Sogou、search_pro_quark`",
            "default": "noLimit",
            "enum": [
              "oneDay",
              "oneWeek",
              "oneMonth",
              "oneYear",
              "noLimit"
            ]
          },
          "content_size": {
            "type": "string",
            "description": "控制返回网页内容的长短。`medium`：返回摘要信息，满足大模型的基础推理需求，满足常规问答任务的信息检索需求。`high`：最大化上下文，信息量较大但内容详细，适合需要信息细节的场景。支持的搜索引擎：`search_std、search_pro、search_pro_Sogou、search_pro_quark`",
            "enum": [
              "medium",
              "high"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一`ID`，帮助平台对终端用户的非法活动、生成非法不当信息或其他滥用行为进行干预。`ID`长度要求：至少`6`个字符，最多`128`个字符。",
            "minLength": 6,
            "maxLength": 128
          }
        },
        "required": [
          "search_query",
          "search_engine",
          "search_intent"
        ]
      },
      "WebSearchResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "任务 ID"
          },
          "created": {
            "type": "integer",
            "description": "请求创建时间，是以秒为单位的 `Unix` 时间戳"
          },
          "request_id": {
            "type": "string",
            "description": "请求标识符"
          },
          "search_intent": {
            "type": "array",
            "description": "搜索意图结果",
            "items": {
              "type": "object",
              "properties": {
                "query": {
                  "type": "string",
                  "description": "原始搜索query"
                },
                "intent": {
                  "type": "string",
                  "description": "识别的意图类型。`SEARCH_ALL` = 搜索全网，`SEARCH_NONE` = 无搜索意图，`SEARCH_ALWAYS` = 强制搜索模式：当`search_intent=false`时返回此值",
                  "enum": [
                    "SEARCH_ALL",
                    "SEARCH_NONE",
                    "SEARCH_ALWAYS"
                  ]
                },
                "keywords": {
                  "type": "string",
                  "description": "改写后的搜索关键词"
                }
              }
            }
          },
          "search_result": {
            "type": "array",
            "description": "搜索结果",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "标题"
                },
                "content": {
                  "type": "string",
                  "description": "内容摘要"
                },
                "link": {
                  "type": "string",
                  "description": "结果链接"
                },
                "media": {
                  "type": "string",
                  "description": "网站名称"
                },
                "icon": {
                  "type": "string",
                  "description": "网站图标"
                },
                "refer": {
                  "type": "string",
                  "description": "角标序号"
                },
                "publish_date": {
                  "type": "string",
                  "description": "网站发布时间"
                }
              }
            }
          }
        }
      },
      "ReaderRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "需要抓取的`url`"
          },
          "timeout": {
            "type": "integer",
            "description": "请求超时时间（秒），默认值 `20`",
            "default": 20
          },
          "no_cache": {
            "type": "boolean",
            "description": "是否禁用缓存（`true`/`false`），默认值 `false`",
            "default": false
          },
          "return_format": {
            "type": "string",
            "description": "返回格式（如：`markdown`、`text`等），默认值 `markdown`",
            "default": "markdown"
          },
          "retain_images": {
            "type": "boolean",
            "description": "是否保留图片（`true`/`false`），默认值 `true`",
            "default": true
          },
          "no_gfm": {
            "type": "boolean",
            "description": "是否禁用 `GitHub Flavored Markdown`（`true`/`false`），默认值 `false`",
            "default": false
          },
          "keep_img_data_url": {
            "type": "boolean",
            "description": "是否保留图片数据 `URL`（`true`/`false`），默认值 `false`",
            "default": false
          },
          "with_images_summary": {
            "type": "boolean",
            "description": "是否包含图片摘要（`true`/`false`），默认值 `false`",
            "default": false
          },
          "with_links_summary": {
            "type": "boolean",
            "description": "是否包含链接摘要（`true`/`false`），默认值 `false`",
            "default": false
          }
        },
        "required": [
          "url"
        ]
      },
      "ReaderResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "任务 `ID`"
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "请求创建时间，是以秒为单位的 `Unix` 时间戳"
          },
          "request_id": {
            "type": "string",
            "description": "由用户端传递，需要唯一；用于区分每次请求的唯一标识符。如果用户端未提供，平台将默认生成。"
          },
          "model": {
            "type": "string",
            "description": "模型编码"
          },
          "reader_result": {
            "type": "object",
            "description": "网页阅读结果",
            "properties": {
              "content": {
                "type": "string",
                "description": "网页解析后的主要内容（正文、图片、链接等标记）"
              },
              "description": {
                "type": "string",
                "description": "网页简要描述"
              },
              "title": {
                "type": "string",
                "description": "网页标题"
              },
              "url": {
                "type": "string",
                "description": "网页原始地址"
              },
              "external": {
                "type": "object",
                "description": "网页引用的外部资源对象",
                "properties": {
                  "stylesheet": {
                    "type": "object",
                    "description": "外部样式表集合",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "样式表类型，通常为`text/css`"
                        }
                      }
                    }
                  }
                }
              },
              "metadata": {
                "type": "object",
                "description": "页面元数据信息",
                "properties": {
                  "keywords": {
                    "type": "string",
                    "description": "页面关键词"
                  },
                  "viewport": {
                    "type": "string",
                    "description": "页面视口设置"
                  },
                  "description": {
                    "type": "string",
                    "description": "元数据描述"
                  },
                  "format-detection": {
                    "type": "string",
                    "description": "格式检测设置，如`telephone=no`"
                  }
                }
              }
            }
          }
        }
      },
      "ModerationRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "安全模型",
            "enum": [
              "moderation"
            ],
            "default": "moderation"
          },
          "input": {
            "description": "需要审核的内容\n 纯文本字符串（最大输入长度：`2000` 字符）\n多媒体对象(`type+url`)\n 图片：图片小于 `10M`，最低分辨率 `20* 20`，不超过 `6000 * 6000`\n视频：推荐视频时长 `30` 秒\n音频：推荐音频时长 `60` 秒",
            "oneOf": [
              {
                "type": "string",
                "description": "需要审核的文本内容",
                "example": "审核内容安全样例字符串。"
              },
              {
                "type": "object",
                "description": "单个多模态审核内容",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "内容类型，可以是文本、视频链接、音频链接或图片链接",
                    "enum": [
                      "text",
                      "image_url",
                      "video_url",
                      "audio_url"
                    ]
                  },
                  "text": {
                    "type": "string",
                    "description": "当 `type` 为 `text` 时的文本内容",
                    "example": "待审核内容"
                  },
                  "image_url": {
                    "type": "object",
                    "description": "当 `type` 为 `image_url` 时的图片参数",
                    "properties": {
                      "url": {
                        "type": "string",
                        "description": "当 `type` 为 `image_url` 时的图片链接地址"
                      }
                    }
                  },
                  "video_url": {
                    "type": "object",
                    "description": "当 `type` 为 `video_url` 时的视频参数",
                    "properties": {
                      "url": {
                        "type": "string",
                        "description": "当 `type` 为 `video_url` 时的视频链接地址"
                      }
                    }
                  },
                  "audio_url": {
                    "type": "object",
                    "description": "当 `type` 为 `audio_url` 时的音频参数",
                    "properties": {
                      "url": {
                        "type": "string",
                        "description": "当 `type` 为 `audio_url` 时的音频链接地址"
                      }
                    }
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "array",
                "description": "审核多模态内容数组，支持文本、文件和图片",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "内容类型，可以是文本、视频链接、音频链接或图片链接",
                      "enum": [
                        "text",
                        "image_url",
                        "video_url",
                        "audio_url"
                      ]
                    },
                    "text": {
                      "type": "string",
                      "description": "当 `type` 为 `text` 时的文本内容",
                      "example": "待审核内容"
                    },
                    "image_url": {
                      "type": "object",
                      "description": "当 `type` 为 `image_url` 时的图片参数",
                      "properties": {
                        "url": {
                          "type": "string",
                          "description": "当 `type` 为 `image_url` 时的图片链接地址"
                        }
                      }
                    },
                    "video_url": {
                      "type": "object",
                      "description": "当 `type` 为 `video_url` 时的视频参数",
                      "properties": {
                        "url": {
                          "type": "string",
                          "description": "当 `type` 为 `video_url` 时的视频链接地址"
                        }
                      }
                    },
                    "audio_url": {
                      "type": "object",
                      "description": "当 `type` 为 `audio_url` 时的音频参数",
                      "properties": {
                        "url": {
                          "type": "string",
                          "description": "当 `type` 为 `audio_url` 时的音频链接地址"
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        },
        "required": [
          "model",
          "input"
        ]
      },
      "ModerationResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "任务 `ID`"
          },
          "created": {
            "type": "integer",
            "description": "请求创建时间，是以秒为单位的 `Unix` 时间戳"
          },
          "request_id": {
            "type": "string",
            "description": "请求标识符"
          },
          "result_list": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "content_type": {
                  "description": "内容类型",
                  "type": "string"
                },
                "risk_level": {
                  "type": "string",
                  "enum": [
                    "PASS",
                    "REVIEW",
                    "BLOCK",
                    "REJECT",
                    "HIGH"
                  ],
                  "description": "检测结果，处置建议，可能返回值：\nPASS：正常，机审不拦截，建议直接放行\nREVIEW：可疑，机审不拦截，建议人工后审\nBLOCK：一般违规，建议机审拦截，但可以不终止本轮对话\nREJECT：违规，建议机审拦截，并终止多轮对话\nHIGH：高危，建议机审拦截，输入也要做回撤处理"
                },
                "risk_type": {
                  "type": "array",
                  "description": "风险类型列表",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "moderation_text": {
                "type": "object",
                "properties": {
                  "call_count": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      },
      "AudioSpeechRequest": {
        "type": "object",
        "required": [
          "model",
          "input",
          "voice"
        ],
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "glm-tts"
            ],
            "default": "glm-tts",
            "description": "要使用的`TTS`模型"
          },
          "input": {
            "type": "string",
            "description": "要转换为语音的文本",
            "default": "你好，今天天气怎么样",
            "maxLength": 1024
          },
          "voice": {
            "type": "string",
            "enum": [
              "tongtong",
              "chuichui",
              "xiaochen",
              "jam",
              "kazi",
              "douji",
              "luodo"
            ],
            "default": "tongtong",
            "description": "生成音频时使用的音色，支持系统音色以及复刻音色两种类型，其中系统音色如下：\n`tongtong`: 彤彤，默认音色 \n`chuichui`: 锤锤 \n`xiaochen`: 小陈 \n`jam`: 动动动物圈`jam`音色 \n`kazi`: 动动动物圈`kazi`音色 \n`douji`: 动动动物圈`douji`音色 \n`luodo`: 动动动物圈`luodo`音色"
          },
          "watermark_enabled": {
            "type": "boolean",
            "description": "控制`AI`生成音频时是否添加水印。去水印操作路径：右上角个人中心-安全管理-去水印管理-打开开关。\n - `true`: 默认启用`AI`生成的显式水印及隐式数字水印，符合政策要求。\n - `false`: 关闭所有水印，仅对已完成去水印动作的用户生效。",
            "example": true
          },
          "stream": {
            "type": "boolean",
            "default": false,
            "description": "是否启用流式输出。\n- `true`: 启用流式输出，模型将通过标准`Event Stream`逐块返回生成的音频内容。\n- `false`: 关闭流式输出，模型在生成所有内容后一次性返回所有内容。默认值为`false`。"
          },
          "speed": {
            "type": "number",
            "description": "语速，默认1.0，取值范围[0.5, 2]"
          },
          "volume": {
            "type": "number",
            "description": "音量，默认1.0，取值范围(0, 10]"
          },
          "encode_format": {
            "type": "string",
            "enum": [
              "base64",
              "hex"
            ],
            "description": "仅流式返回时，决定返回的编码格式。默认返回对应音频文件格式的`base64`字符串。"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "wav",
              "pcm"
            ],
            "default": "pcm",
            "description": "音频输出格式，默认返回`pcm`格式的文件。流式生成音频时，仅支持返回`pcm`格式的文件"
          }
        }
      },
      "AudioTranscriptionRequest": {
        "type": "object",
        "required": [
          "file",
          "model"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "需要转录的音频文件，支持上传的音频文件格式：`.wav / .mp3`，规格限制：文件大小 ≤ `25 MB`、音频时长 ≤ `30 秒`"
          },
          "file_base64": {
            "type": "string",
            "description": "音频文件Base64编码。file_base64 和 file 只需要传一个（同时传入以file为准）"
          },
          "model": {
            "type": "string",
            "description": "要调用的模型编码",
            "enum": [
              "glm-asr-2512"
            ],
            "default": "glm-asr-2512"
          },
          "prompt": {
            "type": "string",
            "description": "在长文本场景中，可以提供之前的转录结果作为上下文。建议小于8000字。"
          },
          "hotwords": {
            "type": "array",
            "description": "热词表，用于提升特定领域词汇识别率。格式例如[\"人名\",\"地名\"]，建议不超过100个。",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          },
          "stream": {
            "type": "boolean",
            "default": false,
            "description": "该参数在使用同步调用时应设置为`false`或省略。表示模型在生成所有内容后一次性返回所有内容。默认值为`false`。如果设置为`true`，模型将通过标准`Event Stream`逐块返回生成的内容。当`Event Stream`结束时，将返回一个`data: [DONE]`消息。"
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一`ID`，帮助平台对终端用户的非法活动、生成非法不当信息或其他滥用行为进行干预。`ID`长度要求：至少`6`个字符，最多`128`个字符。"
          }
        }
      },
      "AudioTranscriptionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "任务 ID"
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "请求创建时间，是以秒为单位的 `Unix` 时间戳"
          },
          "request_id": {
            "type": "string",
            "description": "由用户端传递，需要唯一；用于区分每次请求的唯一标识符。如果用户端未提供，平台将默认生成。"
          },
          "model": {
            "type": "string",
            "description": "模型名称"
          },
          "text": {
            "type": "string",
            "description": "音频转录的完整内容"
          }
        }
      },
      "AudioTranscriptionStreamResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "任务 ID"
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "请求创建时间，是以秒为单位的 `Unix` 时间戳"
          },
          "model": {
            "type": "string",
            "description": "模型名称"
          },
          "type": {
            "type": "string",
            "description": "音频转录事件类型，`transcript.text.delta`表示正在转录，`transcript.text.done`表示转录完成"
          },
          "delta": {
            "type": "string",
            "description": "模型增量返回的音频转录信息"
          }
        }
      },
      "VoiceCloneRequest": {
        "type": "object",
        "required": [
          "voice_name",
          "input",
          "file_id",
          "model"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "模型",
            "enum": [
              "glm-tts-clone"
            ],
            "default": "glm-tts-clone",
            "example": "glm-tts-clone"
          },
          "voice_name": {
            "type": "string",
            "description": "指定唯一的音色名称",
            "example": "my_custom_voice_001"
          },
          "text": {
            "type": "string",
            "description": "示例音频的文本内容，选填",
            "example": "你好，这是一段示例音频的文本内容，用于音色复刻参考。"
          },
          "input": {
            "type": "string",
            "description": "生成试听音频的目标文本内容",
            "example": "欢迎使用我们的音色复刻服务，这将生成与示例音频相同音色的语音。"
          },
          "file_id": {
            "type": "string",
            "description": "示例音频的file_id，通过文件接口上传获取。大小限制不超过10M，建议音频时长在3秒到30秒之间。",
            "example": "file_abc123def456ghi789"
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          }
        }
      },
      "VoiceCloneResponse": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "string",
            "description": "音色",
            "example": "voice_clone_20240315_143052_001"
          },
          "file_id": {
            "type": "string",
            "description": "音频试听文件ID",
            "example": "file_xyz789abc456def123"
          },
          "file_purpose": {
            "type": "string",
            "description": "文件 purpose，固定为voice-clone-output",
            "example": "voice-clone-output"
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "example": "voice_clone_req_20240315_143052_001"
          }
        }
      },
      "VoiceListResponse": {
        "type": "object",
        "properties": {
          "voice_list": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceVO"
            },
            "description": "音色列表"
          }
        }
      },
      "VoiceSaveRequest": {
        "type": "object",
        "required": [
          "voice"
        ],
        "properties": {
          "voice": {
            "type": "string",
            "description": "音色",
            "example": "voice_clone_20240315_143052_001"
          },
          "request_id": {
            "type": "string",
            "description": "请求ID",
            "example": "voice_save_req_001"
          }
        }
      },
      "VoiceSaveResponse": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "string",
            "description": "音色",
            "example": "voice_clone_20240315_143052_001"
          },
          "update_time": {
            "type": "string",
            "description": "删除时间",
            "example": "2024-03-15 14:30:52"
          }
        }
      },
      "VoiceVO": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "string",
            "description": "音色",
            "example": "voice_clone_20240315_143052_001"
          },
          "voice_name": {
            "type": "string",
            "description": "音色名称",
            "example": "my_custom_voice_001"
          },
          "voice_type": {
            "type": "string",
            "description": "音色类型，OFFICIAL为官方音色，PRIVATE为自定义音色",
            "example": "PRIVATE"
          },
          "download_url": {
            "type": "string",
            "description": "试听音频的下载链接",
            "example": "https://example.com/voice_clone_20240315_143052_001.mp3"
          },
          "create_time": {
            "type": "string",
            "description": "创建时间",
            "example": "2024-03-15 14:30:52"
          }
        }
      },
      "ImageObject": {
        "type": "object",
        "properties": {
          "b64_json": {
            "type": "string",
            "description": "生成图像的base64编码JSON"
          },
          "url": {
            "type": "string",
            "description": "生成图像的URL"
          },
          "revised_prompt": {
            "type": "string",
            "description": "修订后的提示"
          }
        }
      },
      "EmbeddingCreateRequest": {
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "嵌入模型名称，如 `embedding-3、embedding-2`",
            "enum": [
              "embedding-3",
              "embedding-2"
            ]
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "输入文本，支持字符串或字符串数组。\n- `embedding-2` 的单条请求最多支持 `512` 个`Tokens`，数组总长度不得超过`8K` \n- `embedding-3` 的单条请求最多支持 `3072` 个`Tokens`，且数组最大不得超过 `64` 条"
          },
          "dimensions": {
            "type": "integer",
            "minimum": 1,
            "description": "输出向量维度，`Embedding-3` 默认 `2048`，`Embedding-2` 固定 `1024`。`Embedding-3` 支持自定义，可选值：`256、512、1024`或`2048`。",
            "enum": [
              2048,
              1024,
              512,
              256
            ]
          }
        }
      },
      "EmbeddingResponse": {
        "type": "object",
        "description": "文本嵌入响应对象，包含嵌入向量结果、模型信息和 `tokens` 统计。",
        "properties": {
          "model": {
            "type": "string",
            "description": "模型编码。"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "结果类型，目前为 `list`。"
          },
          "data": {
            "type": "array",
            "description": "模型生成的数组结果。每个元素为单条文本的嵌入结果对象。",
            "items": {
              "$ref": "#/components/schemas/EmbeddingObject"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/EmbeddingUsage",
            "description": "本次模型调用的 `tokens` 数量统计。"
          }
        }
      },
      "EmbeddingObject": {
        "type": "object",
        "description": "单条文本的嵌入向量对象。",
        "properties": {
          "index": {
            "type": "integer",
            "description": "结果下标。该嵌入向量对应的输入文本在输入数组中的索引。"
          },
          "object": {
            "type": "string",
            "enum": [
              "embedding"
            ],
            "description": "结果类型，目前为 `embedding`。"
          },
          "embedding": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "`embedding` 的处理结果，返回向量化表征的数组。"
          }
        }
      },
      "EmbeddingUsage": {
        "type": "object",
        "description": "本次模型调用的 `tokens` 数量统计。",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "description": "用户输入的 `tokens` 数量。"
          },
          "completion_tokens": {
            "type": "integer",
            "description": "模型输出的 `tokens` 数量。"
          },
          "total_tokens": {
            "type": "integer",
            "description": "总 `tokens` 数量。"
          }
        }
      },
      "FileUploadRequest": {
        "type": "object",
        "required": [
          "file",
          "purpose"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "要上传的文件。"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "batch",
              "code-interpreter",
              "agent",
              "voice-clone-input"
            ],
            "description": "文件的预期用途。\n`batch`：用于批量任务处理，支持 `.jsonl` 文件格式，，单个文件大小限制为`100 MB`，文件数不超过 `1000` 个。`Batch`指南。\n`code-interpreter`：文件上传给代码沙盒`CI`使用，支持的格式包括：`pdf、docx、doc、xls、xlsx、txt、png、jpg、jpeg、csv`，单个文件大小限制为 `20M`，图片大小不超过`5M`，文件数不超过 `100` 个。\n`agent`：用于智能体文件上传，支持的格式包括：`pdf、docx、doc、xls、xlsx、txt、png、jpg、jpeg、csv`，单个文件大小限制为 `20M`，图片大小不超过`5M`，文件数不超过 `1000` 个。\n`voice-clone-input`: 用于音色克隆功能示例音频文件的上传。支持的格式包括`mp3、wav`。\n`user_data`: 用户文件的上传。支持的格式包括 `pptx,ppt,docx,doc,xlsx,xls,pdf`，限制每个用户最多存储 1T 文件。"
          }
        }
      },
      "FileObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "文件标识符"
          },
          "object": {
            "type": "string",
            "enum": [
              "file"
            ]
          },
          "bytes": {
            "type": "integer",
            "description": "文件大小（字节）"
          },
          "created_at": {
            "type": "integer",
            "description": "文件创建的`Unix`时间戳"
          },
          "filename": {
            "type": "string",
            "description": "文件名"
          },
          "purpose": {
            "type": "string",
            "description": "文件的预期用途"
          }
        }
      },
      "FileListResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileObject"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "是否有更多数据"
          }
        }
      },
      "BaseApiResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "响应码，`200`为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "BaseDeletedResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "删除的资源`ID`"
          },
          "object": {
            "type": "string",
            "description": "资源类型"
          },
          "deleted": {
            "type": "boolean",
            "description": "是否成功删除"
          }
        }
      },
      "FileDeletedResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseDeletedResponse"
          },
          {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "enum": [
                  "file"
                ]
              }
            }
          }
        ]
      },
      "RerankRequest": {
        "type": "object",
        "required": [
          "model",
          "query",
          "documents"
        ],
        "properties": {
          "model": {
            "type": "string",
            "example": "rerank",
            "description": "要调用的模型编码，默认为`rerank`。",
            "enum": [
              "rerank"
            ]
          },
          "query": {
            "type": "string",
            "example": "查询候选文本A",
            "description": "查询文本，用于与候选文本进行匹配`query`，最大长度为 `4096` 字符。"
          },
          "top_n": {
            "type": "integer",
            "description": "返回得分最高的前 `n` 条结果，默认`0`返回所有。"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "需要打分的候选文本A",
              "需要打分的候选文本B"
            ],
            "description": "需要打分的候选文本数组,最多容纳 `128` 条。单条最大长度为 `4096` 字符。"
          },
          "return_documents": {
            "type": "boolean",
            "description": "是否返回原始文本，默认值为`FALSE`。"
          },
          "return_raw_scores": {
            "type": "boolean",
            "description": "是否返回原始分数。默认 `FALSE`。"
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一`ID`"
          }
        }
      },
      "RerankResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "format": "int64",
            "example": 1732083164
          },
          "id": {
            "type": "string",
            "example": "20241120141244890ab4ee4af84acf",
            "description": "智谱开放平台生成的任务序号，调用请求结果接口时请使用此序号"
          },
          "request_id": {
            "type": "string",
            "example": "1111111111",
            "description": "用户在客户端请求时提交的任务编号或者平台生成的任务编号"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RerankResult"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/RerankUsage"
          }
        },
        "required": [
          "id",
          "results",
          "usage"
        ]
      },
      "RerankResult": {
        "type": "object",
        "properties": {
          "document": {
            "type": "string",
            "example": "Washington, D.C. is the capital of the United States.",
            "description": "原文本"
          },
          "index": {
            "type": "integer",
            "example": 1
          },
          "relevance_score": {
            "type": "number",
            "format": "float",
            "example": 0.99866986
          }
        },
        "required": [
          "document",
          "index",
          "relevance_score"
        ]
      },
      "RerankUsage": {
        "type": "object",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "example": 72
          },
          "total_tokens": {
            "type": "integer",
            "example": 72
          }
        },
        "required": [
          "prompt_tokens",
          "total_tokens"
        ]
      },
      "TokenizerRequest": {
        "type": "object",
        "required": [
          "model",
          "messages"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "调用的模型代码。",
            "example": "glm-5.3",
            "default": "glm-5.3",
            "enum": [
              "glm-5.3",
              "glm-5.2",
              "glm-5.1",
              "glm-5-turbo",
              "glm-5",
              "glm-4.7",
              "glm-4.6",
              "glm-4.6v",
              "glm-4.5",
              "glm-4.5-air"
            ]
          },
          "messages": {
            "type": "array",
            "description": "对话消息列表，包含当前对话的完整上下文信息。每条消息都有特定的角色和内容，模型会根据这些消息生成回复。消息按时间顺序排列，支持角色：`system`（系统消息，用于设定`AI`的行为和角色）、`user`（用户消息，来自用户的输入）、`assistant`（助手消息，来自`AI`的回复）。视觉模型支持纯文本和多模态内容（文本、图片、视频、文件）。注意不能只包含系统或助手消息。",
            "items": {
              "oneOf": [
                {
                  "title": "用户消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "user"
                      ],
                      "description": "消息作者的角色",
                      "default": "user"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "array",
                          "description": "多模态消息内容，支持文本、图片、文件、视频（可从上方切换至文本消息）",
                          "items": {
                            "$ref": "#/components/schemas/VisionMultimodalContentItem"
                          }
                        },
                        {
                          "type": "string",
                          "description": "文本消息内容（可从上方切换至多模态消息）",
                          "example": "What opportunities and challenges will the Chinese large model industry face in 2025?"
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "系统消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system"
                      ],
                      "description": "消息作者的角色",
                      "default": "system"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "消息文本内容",
                          "example": "You are a helpful assistant."
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "title": "助手消息",
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "assistant"
                      ],
                      "description": "消息作者的角色",
                      "default": "assistant"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string",
                          "description": "文本消息内容",
                          "example": "I'll help you with that analysis."
                        }
                      ]
                    }
                  },
                  "required": [
                    "role"
                  ]
                }
              ]
            },
            "minItems": 1
          },
          "tools": {
            "type": "array",
            "description": "模型可以调用的工具列表。支持函数调用、知识库检索和网络搜索。使用此参数提供模型可以生成 `JSON` 输入的函数列表或配置其他工具。最多支持 `128` 个函数。目前 `GLM-4` 系列已支持所有 `tools`，`GLM-4.5` 已支持 `web search` 和 `retrieval`。",
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionToolSchema"
                }
              }
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一`ID`"
          }
        }
      },
      "TokenizerResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "format": "int64",
            "example": 1727156815
          },
          "id": {
            "type": "string",
            "example": "20241120141244890ab4ee4af84acf",
            "description": "智谱开放平台生成的任务序号，调用请求结果接口时请使用此序号。"
          },
          "request_id": {
            "type": "string",
            "example": "1",
            "description": "请求发起时客户端提交的任务号或平台生成的任务号。"
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "number",
                "description": "本次输入的 prompt tokens"
              },
              "video_tokens": {
                "type": "number",
                "description": "本次输入的 video tokens"
              },
              "image_tokens": {
                "type": "number",
                "description": "本次输入的 image tokens"
              },
              "total_tokens": {
                "type": "number",
                "description": "本次输入的总 tokens"
              }
            }
          }
        },
        "required": [
          "id",
          "usage"
        ]
      },
      "LayoutParsingRequest": {
        "type": "object",
        "required": [
          "model",
          "file"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "模型编码：`glm-ocr`",
            "example": "glm-ocr",
            "enum": [
              "glm-ocr"
            ]
          },
          "file": {
            "type": "string",
            "description": "需要识别的图片或者`pdf`文档，支持`url`和`base64`。支持图片格式：`PDF`、`JPG`、`PNG`。单图`≤10MB`，PDF`≤50MB`，最大支持`100页`",
            "example": "https://cdn.bigmodel.cn/static/logo/introduction.png"
          },
          "return_crop_images": {
            "type": "boolean",
            "description": "是否需要截图信息",
            "default": false
          },
          "need_layout_visualization": {
            "type": "boolean",
            "description": "是否需要详细布局图片结果信息",
            "default": false
          },
          "start_page_id": {
            "type": "integer",
            "description": "传入`pdf`时，开始解析的页码",
            "minimum": 1
          },
          "end_page_id": {
            "type": "integer",
            "description": "传入`pdf`时，结束解析的页码",
            "minimum": 1
          },
          "request_id": {
            "type": "string",
            "description": "请求唯一标识符。由用户端传递，`ID`长度要求：最少`6`个字符，最多`64`个字符，建议使用`UUID`格式确保唯一性，若未提供平台将自动生成。",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户ID，用于滥用监控。长度：6-128字符",
            "minLength": 6,
            "maxLength": 128,
            "example": "user_123456"
          }
        }
      },
      "LayoutParsingResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "任务 `ID`",
            "example": "task_123456789"
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "请求创建时间，是以秒为单位的 `Unix` 时间戳",
            "example": 1727156815
          },
          "model": {
            "type": "string",
            "description": "模型名称",
            "example": "GLM-OCR"
          },
          "md_results": {
            "type": "string",
            "description": "`Markdown` 格式的识别结果",
            "example": "# 文档标题\n这是文档内容..."
          },
          "layout_details": {
            "type": "array",
            "description": "布局详细信息",
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/LayoutDetail"
              }
            }
          },
          "layout_visualization": {
            "type": "array",
            "description": "识别结果图片`url`",
            "items": {
              "type": "string"
            }
          },
          "data_info": {
            "$ref": "#/components/schemas/DataInfo"
          },
          "usage": {
            "type": "object",
            "description": "调用结束时返回的 `Token` 使用统计。",
            "properties": {
              "prompt_tokens": {
                "type": "number",
                "description": "用户输入的 `Token` 数量。"
              },
              "completion_tokens": {
                "type": "number",
                "description": "输出的 `Token` 数量"
              },
              "prompt_tokens_details": {
                "type": "object",
                "properties": {
                  "cached_tokens": {
                    "type": "number",
                    "description": "命中的缓存 `Token` 数量"
                  }
                }
              },
              "total_tokens": {
                "type": "integer",
                "description": "`Token` 总数"
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "请求`ID`",
            "example": "req_123456789"
          }
        },
        "required": [
          "id",
          "created",
          "model"
        ]
      },
      "LayoutDetail": {
        "type": "object",
        "description": "布局详情元素",
        "properties": {
          "index": {
            "type": "integer",
            "description": "元素序号",
            "example": 1
          },
          "label": {
            "type": "string",
            "description": "元素类型：`image`表示图像，`text`表示文本内容，`formula`表示行间公式，`table`表示表格",
            "enum": [
              "image",
              "text",
              "formula",
              "table"
            ],
            "example": "text"
          },
          "bbox_2d": {
            "type": "array",
            "description": "归一化的元素坐标 `[x1,y1,x2,y2]`",
            "items": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "minItems": 4,
            "maxItems": 4,
            "example": [
              0.1,
              0.1,
              0.5,
              0.3
            ]
          },
          "content": {
            "type": "string",
            "description": "元素内容（文本 / 图片 URL / 表格 HTML）",
            "example": "这是文本内容"
          },
          "height": {
            "type": "integer",
            "description": "页面高度",
            "example": 800
          },
          "width": {
            "type": "integer",
            "description": "页面宽度",
            "example": 600
          }
        },
        "required": [
          "index",
          "label"
        ]
      },
      "DataInfo": {
        "type": "object",
        "description": "文档基础信息",
        "properties": {
          "num_pages": {
            "type": "integer",
            "description": "文档总页数",
            "example": 5
          },
          "pages": {
            "type": "array",
            "description": "文档页面数量信息",
            "items": {
              "$ref": "#/components/schemas/PageInfo"
            }
          }
        },
        "required": [
          "num_pages"
        ]
      },
      "PageInfo": {
        "type": "object",
        "description": "页面尺寸信息",
        "properties": {
          "width": {
            "type": "integer",
            "description": "页面宽度",
            "example": 600
          },
          "height": {
            "type": "integer",
            "description": "页面高度",
            "example": 800
          }
        },
        "required": [
          "width",
          "height"
        ]
      },
      "AgentRequest": {
        "type": "object",
        "required": [
          "agent_id",
          "messages"
        ],
        "properties": {
          "agent_id": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "general_translation",
                  "slides_glm_agent",
                  "ai_drawing_agent",
                  "receipt_recognition_agent",
                  "clothes_recognition_agent",
                  "intelligent_education_solve_agent",
                  "vidu_template_agent"
                ],
                "description": "此处提供 通用翻译智能体 `general_translation` 的拓展参数模板作为示例，其他内嵌智能体需要参考文档在下方手动设置拓展参数。"
              }
            ],
            "description": "智能体 ID"
          },
          "stream": {
            "type": "boolean",
            "description": "是否选择流式输出。当一个 `agent` 提供流式与非流式两种输出方式时，可根据需求选择一种。",
            "default": false
          },
          "messages": {
            "type": "array",
            "description": "会话消息体列表。",
            "items": {
              "type": "object",
              "required": [
                "role",
                "content"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "description": "消息作者的角色。用户输入时 `role = user`。",
                  "enum": [
                    "system",
                    "user",
                    "assistant"
                  ],
                  "example": "user"
                },
                "content": {
                  "oneOf": [
                    {
                      "type": "string",
                      "description": "用户输入的文本内容。",
                      "example": "请帮我翻译这段文字：Hello World"
                    },
                    {
                      "type": "object",
                      "description": "单个多模态内容，用于只有一个元素的情况",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "内容类型，可以是文本、文件`ID`、文件链接或图片链接",
                          "enum": [
                            "text",
                            "file_id",
                            "file_url",
                            "image_url"
                          ]
                        },
                        "text": {
                          "type": "string",
                          "description": "当 `type` 为 `text` 时的文本内容",
                          "example": "请帮我翻译这段文字：Hello World"
                        },
                        "file_id": {
                          "type": "string",
                          "description": "当 `type` 为 `file_id` 时的文件唯一标识",
                          "example": "agent-1750681215-9b92722d788f4b32bab28cc333293584"
                        },
                        "file_url": {
                          "type": "string",
                          "description": "当 `type` 为 `file_url` 时的文件链接",
                          "example": "https://example.com/my_oss/document.pdf"
                        },
                        "image_url": {
                          "type": "string",
                          "description": "当 `type` 为 `image_url` 时的图片链接",
                          "example": "https://example.com/my_oss/image.png"
                        }
                      },
                      "required": [
                        "type"
                      ]
                    },
                    {
                      "type": "array",
                      "description": "多模态内容数组，支持文本、文件和图片",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "内容类型，可以是文本、文件`ID`、文件链接或图片链接",
                            "enum": [
                              "text",
                              "file_id",
                              "file_url",
                              "image_url"
                            ]
                          },
                          "text": {
                            "type": "string",
                            "description": "当 `type` 为 `text` 时的文本内容",
                            "example": "请帮我翻译这段文字：Hello World"
                          },
                          "file_id": {
                            "type": "string",
                            "description": "当 `type` 为 `file_id` 时的文件唯一标识",
                            "example": "agent-1750681215-9b92722d788f4b32bab28cc333293584"
                          },
                          "file_url": {
                            "type": "string",
                            "description": "当 `type` 为 `file_url` 时的文件链接",
                            "example": "https://example.com/my_oss/document.pdf"
                          },
                          "image_url": {
                            "type": "string",
                            "description": "当 `type` 为 `image_url` 时的图片链接",
                            "example": "https://example.com/my_oss/image.png"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      }
                    }
                  ]
                }
              }
            },
            "minItems": 1
          },
          "custom_variables": {
            "description": "智能体扩展参数。根据不同智能体的需求提供相应的参数配置。",
            "oneOf": [
              {
                "title": "通用翻译智能体",
                "$ref": "#/components/schemas/TranslationAgentCustomVariables"
              },
              {
                "title": "自定义智能体扩展",
                "$ref": "#/components/schemas/CustomAgentCustomVariables"
              }
            ]
          }
        }
      },
      "AgentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "请求唯一标识"
          },
          "agent_id": {
            "type": "string",
            "description": "智能体唯一标识"
          },
          "conversation_id": {
            "type": "string",
            "description": "对话唯一标识"
          },
          "async_id": {
            "type": "string",
            "description": "异步任务唯一标识（异步调用时出现）"
          },
          "choices": {
            "type": "array",
            "description": "智能体响应列表。",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "结果索引。"
                },
                "messages": {
                  "type": "array",
                  "description": "智能体生成的响应消息列表。",
                  "items": {
                    "type": "object",
                    "properties": {
                      "role": {
                        "type": "string",
                        "description": "响应角色，通常为 `assistant`。",
                        "example": "assistant"
                      },
                      "content": {
                        "oneOf": [
                          {
                            "type": "string",
                            "description": "智能体生成的响应内容（纯文本格式）。"
                          },
                          {
                            "type": "object",
                            "description": "单个多模态响应内容，用于响应只有一个元素的情况",
                            "properties": {
                              "type": {
                                "type": "string",
                                "description": "内容类型，可以是文本、文件、图片、音频或视频",
                                "enum": [
                                  "text",
                                  "file_url",
                                  "image_url",
                                  "audio_url",
                                  "video_url"
                                ]
                              },
                              "text": {
                                "type": "string",
                                "description": "当 `type` 为 `text` 时的文本内容"
                              },
                              "file_url": {
                                "type": "string",
                                "description": "当 `type` 为 `file_url` 时的文件链接"
                              },
                              "image_url": {
                                "type": "string",
                                "description": "当 `type` 为 `image_url` 时的图片链接"
                              },
                              "audio_url": {
                                "type": "string",
                                "description": "当 `type` 为 `audio_url` 时的音频链接"
                              },
                              "video_url": {
                                "type": "string",
                                "description": "当 `type` 为 `video_url` 时的视频链接"
                              }
                            },
                            "required": [
                              "type"
                            ]
                          },
                          {
                            "type": "array",
                            "description": "多模态响应内容数组，支持文本、文件、图片、音频和视频",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "description": "内容类型，可以是文本、文件、图片、音频或视频",
                                  "enum": [
                                    "text",
                                    "file_url",
                                    "image_url",
                                    "audio_url",
                                    "video_url"
                                  ]
                                },
                                "text": {
                                  "type": "string",
                                  "description": "当 `type` 为 `text` 时的文本内容"
                                },
                                "file_url": {
                                  "type": "string",
                                  "description": "当 `type` 为 `file_url` 时的文件链接"
                                },
                                "image_url": {
                                  "type": "string",
                                  "description": "当 `type` 为 `image_url` 时的图片链接"
                                },
                                "audio_url": {
                                  "type": "string",
                                  "description": "当 `type` 为 `audio_url` 时的音频链接"
                                },
                                "video_url": {
                                  "type": "string",
                                  "description": "当 `type` 为 `video_url` 时的视频链接"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "finish_reason": {
                  "type": "string",
                  "description": "响应结束原因。可能的取值为 正常结束-`stop`、长度达到上限-`length`、内容敏感-`sensitive` 或 网络错误-`network_error`。"
                }
              }
            }
          },
          "usage": {
            "$ref": "#/components/schemas/UsageStatistics"
          }
        }
      },
      "TranslationAgentCustomVariables": {
        "type": "object",
        "description": "当前为 [通用翻译智能体](/cn/guide/agents/translation) `general_translation` 扩展参数预设",
        "properties": {
          "source_lang": {
            "type": "string",
            "description": "待翻译文本的源语言代码，默认值为 `auto`",
            "default": "auto",
            "enum": [
              "auto",
              "zh-CN",
              "zh-TW",
              "wyw",
              "yue",
              "en",
              "ja",
              "ko",
              "fr",
              "de",
              "es",
              "ru",
              "pt",
              "it",
              "ar",
              "hi",
              "bg",
              "cs",
              "da",
              "el",
              "et",
              "fi",
              "hu",
              "id",
              "lt",
              "lv",
              "nl",
              "no",
              "pl",
              "ro",
              "sk",
              "sl",
              "sv",
              "th",
              "tr",
              "uk",
              "vi",
              "my",
              "ms",
              "Pinyin",
              "IPA"
            ]
          },
          "target_lang": {
            "type": "string",
            "description": "待翻译文本的目标语言代码，默认为 `zh-CN`",
            "default": "zh-CN",
            "enum": [
              "zh-CN",
              "zh-TW",
              "wyw",
              "yue",
              "en",
              "en-GB",
              "en-US",
              "ja",
              "ko",
              "fr",
              "de",
              "es",
              "ru",
              "pt",
              "it",
              "ar",
              "hi",
              "bg",
              "cs",
              "da",
              "el",
              "et",
              "fi",
              "hu",
              "id",
              "lt",
              "lv",
              "nl",
              "no",
              "pl",
              "ro",
              "sk",
              "sl",
              "sv",
              "th",
              "tr",
              "uk",
              "vi",
              "my",
              "ms",
              "Pinyin",
              "IPA"
            ]
          },
          "glossary": {
            "type": "string",
            "description": "术语表`id`"
          },
          "strategy": {
            "type": "string",
            "description": "翻译策略",
            "default": "general",
            "enum": [
              "general",
              "paraphrase",
              "two_step",
              "three_step",
              "reflection",
              "cot"
            ]
          },
          "strategy_config": {
            "type": "object",
            "description": "翻译策略对应的参数",
            "properties": {
              "general": {
                "type": "object",
                "description": "当翻译策略指定为`general`时生效",
                "properties": {
                  "suggestion": {
                    "type": "string",
                    "description": "翻译建议或风格要求，如术语对照、文体规范等"
                  }
                }
              },
              "cot": {
                "type": "object",
                "description": "当翻译策略指定为`cot`时生效",
                "properties": {
                  "reason_lang": {
                    "type": "string",
                    "description": "翻译理由的语言，取值 [\"from\"｜\"to\"]，默认 \"to\"",
                    "default": "to",
                    "enum": [
                      "from",
                      "to"
                    ]
                  }
                }
              }
            }
          }
        },
        "example": {
          "source_lang": "en",
          "target_lang": "zh-CN",
          "strategy": "general",
          "strategy_config": {
            "general": {
              "suggestion": "专业技术文档翻译风格"
            }
          }
        }
      },
      "CustomAgentCustomVariables": {
        "type": "object",
        "description": "自定义其它智能体的扩展参数，具体参数字段可参考对应的[智能体文档](/cn/guide/agents/translation)",
        "additionalProperties": true,
        "example": {
          "custom_param1": "value1",
          "custom_param2": 42,
          "options": {
            "detailed": true,
            "format": "json"
          }
        }
      },
      "AgentAsyncResultResponse": {
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "description": "智能体`ID`"
          },
          "async_id": {
            "type": "string",
            "description": "异步任务的`ID`"
          },
          "status": {
            "type": "string",
            "description": "任务状态，`success/failed/pending`",
            "enum": [
              "success",
              "failed",
              "pending"
            ]
          },
          "choices": {
            "type": "array",
            "description": "`agent`输出",
            "items": {
              "type": "object",
              "properties": {
                "messages": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "role": {
                        "type": "string",
                        "description": "用户的输入 `role = assistant`"
                      },
                      "content": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "description": "目前支持 `type=file_url`"
                            },
                            "file_url": {
                              "type": "string",
                              "description": "url链接"
                            },
                            "tag_cn": {
                              "type": "string",
                              "description": "中文描述"
                            },
                            "tag_en": {
                              "type": "string",
                              "description": "英文描述"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "total_tokens": {
                "type": "integer",
                "description": "消耗总`tokens`数"
              }
            }
          }
        }
      },
      "GlmSlideAgentConversationRequest": {
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "description": "智能体 `ID`"
          },
          "conversation_id": {
            "type": "string",
            "description": "对话 `ID`"
          },
          "custom_variables": {
            "type": "object",
            "description": "自定义参数",
            "properties": {
              "include_pdf": {
                "type": "boolean",
                "description": "是否导出 `pdf` 文件"
              },
              "pages": {
                "type": "array",
                "description": "`Slide` 页信息",
                "items": {
                  "type": "object",
                  "properties": {
                    "position": {
                      "type": "number",
                      "description": "`Slide` 页码"
                    },
                    "width": {
                      "type": "number",
                      "description": "`Slide` 宽度, 单位: `cm`"
                    },
                    "height": {
                      "type": "number",
                      "description": "`Slide` 高度, 单位: `cm`"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "GlmSlideAgentConversationResponse": {
        "type": "object",
        "properties": {
          "conversation_id": {
            "type": "string",
            "description": "对话 `ID`"
          },
          "agent_id": {
            "type": "string",
            "description": "智能体 `ID`"
          },
          "choices": {
            "type": "array",
            "description": "Agent output.",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "role": {
                        "type": "string",
                        "description": "智能体的角色 `role = assistant`"
                      },
                      "content": {
                        "type": "array",
                        "description": "智能体响应内容",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "description": "响应内容类型：文件下载链接-`file_url`、图片下载链接-`image_url`"
                            },
                            "tag_cn": {
                              "type": "string",
                              "description": "CN Tag."
                            },
                            "tag_en": {
                              "type": "string",
                              "description": "EN Tag."
                            },
                            "file_url": {
                              "type": "string",
                              "description": "如果 `type = file_url`，则这个字段给出文件的具体下载链接"
                            },
                            "image_url": {
                              "type": "string",
                              "description": "如果 `type = image_url`，则这个字段给出图片的具体下载链接"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code."
              },
              "message": {
                "type": "string",
                "description": "Error message."
              }
            }
          }
        }
      },
      "AssistantRequest": {
        "type": "object",
        "properties": {
          "assistant_id": {
            "type": "string",
            "title": "智能体选择",
            "description": "智能体ID，必需参数。请从下拉框选择智能体：\n\n• ChatGLM（官方）- 65940acff94777010aa6b796：嗨~ 我是清言，超开心遇见你！😺\n• 数据分析（官方）- 65a265419d72d299a9230616：分析数据并提供图表化\n• 复杂流程图（官方）- 664dd7bd5bb3a13ba0f81668：五秒钟做一张流程图\n• 思维导图 MindMap（官方）- 664e0cade018d633146de0d2：任何复杂概念秒变脑图\n• 提示词工程师（官方）- 6654898292788e88ce9e7f4c：超强结构化提示词专家\n• AI画图（官方）- 66437ef3d920bdc5c60f338e：专属绘画伙伴\n• AI搜索（官方）- 659e54b1b8006379b4b2abd6：连接全网内容，精准搜索\n• PPT助手（官方）- 65d2f07bb2c10188f885bd89：超实用的PPT生成器\n• arXiv论文速读（官方）- 663058948bb259b7e8a22730：深度解析论文\n• 程序员助手Sam（官方）- 65a393b3619c6f13586246cd：编程开发知识搜索引擎\n• 网文写手（官方）- 65b356af6924a59d52832e54：大神写作秘诀\n• 英语语法助手（官方）- 668fdd45405f2e3c9f71f832：检查语法和语法解释",
            "enum": [
              "65940acff94777010aa6b796",
              "65a265419d72d299a9230616",
              "664dd7bd5bb3a13ba0f81668",
              "664e0cade018d633146de0d2",
              "6654898292788e88ce9e7f4c",
              "66437ef3d920bdc5c60f338e",
              "659e54b1b8006379b4b2abd6",
              "65d2f07bb2c10188f885bd89",
              "663058948bb259b7e8a22730",
              "65a393b3619c6f13586246cd",
              "65b356af6924a59d52832e54",
              "668fdd45405f2e3c9f71f832"
            ],
            "x-enum-varnames": [
              "ChatGLM（官方）",
              "数据分析（官方）",
              "复杂流程图（官方）",
              "思维导图 MindMap（官方）",
              "提示词工程师（官方）",
              "AI画图（官方）",
              "AI搜索（官方）",
              "PPT助手（官方）",
              "arXiv论文速读（官方）",
              "程序员助手Sam（官方）",
              "网文写手（官方）",
              "英语语法助手（官方）"
            ],
            "x-enumNames": [
              "ChatGLM（官方）",
              "数据分析（官方）",
              "复杂流程图（官方）",
              "思维导图 MindMap（官方）",
              "提示词工程师（官方）",
              "AI画图（官方）",
              "AI搜索（官方）",
              "PPT助手（官方）",
              "arXiv论文速读（官方）",
              "程序员助手Sam（官方）",
              "网文写手（官方）",
              "英语语法助手（官方）"
            ],
            "x-enum-descriptions": [
              "ChatGLM（官方） - 嗨~ 我是清言，超开心遇见你！😺 你最近有什么好玩的事情想和我分享吗？",
              "数据分析（官方） - 通过分析用户上传文件或数据说明，帮助用户分析数据并提供图表化。也可通过简单的编码完成文件处理的工作。",
              "复杂流程图（官方） - 人人都能掌握的流程图工具，用五秒钟做一张流程图卷到同事。",
              "思维导图 MindMap（官方） - 告别整理烦恼，任何复杂概念秒变脑图。",
              "提示词工程师（官方） - 人人都是提示词工程师，超强结构化提示词专家，一键改写提示词。",
              "AI画图（官方） - 让想象力自由飞翔，你的专属绘画伙伴，画到停不下来。",
              "AI搜索（官方） - 连接全网内容，精准搜索，快速分析并总结的智能助手。",
              "PPT助手（官方） - 超实用的PPT生成器，支持手动编辑大纲、自动填充章节内容。",
              "arXiv论文速读（官方） - 深度解析arXiv论文，让你快速掌握研究动态，节省宝贵时间。",
              "程序员助手Sam（官方） - \"编程开发知识搜索引擎\"，能帮助程序员解决日常问题。",
              "网文写手（官方） - 大神写作秘诀：一套模板不断重复。",
              "英语语法助手（官方） - 输入单词查询；输入句子检查语法，和语法解释。"
            ],
            "default": "65940acff94777010aa6b796"
          },
          "conversation_id": {
            "type": "string",
            "description": "会话`ID`，可选参数，用于继续之前的对话"
          },
          "model": {
            "type": "string",
            "enum": [
              "glm-4-assistant",
              "glm-4-alltools"
            ],
            "description": "使用的模型名称",
            "default": "glm-4-assistant"
          },
          "messages": {
            "type": "array",
            "description": "对话消息列表",
            "items": {
              "type": "object",
              "required": [
                "role",
                "content"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "description": "消息作者的角色",
                  "enum": [
                    "user"
                  ],
                  "example": "user"
                },
                "content": {
                  "oneOf": [
                    {
                      "type": "string",
                      "description": "消息文本内容",
                      "example": "你好"
                    },
                    {
                      "type": "array",
                      "description": "多模态消息内容，支持文本、图片等",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "text",
                              "image_url"
                            ],
                            "description": "内容类型"
                          },
                          "text": {
                            "type": "string",
                            "description": "文本内容"
                          },
                          "image_url": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "description": "图片`URL`"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            },
            "minItems": 1
          },
          "stream": {
            "type": "boolean",
            "description": "是否启用流式响应",
            "default": true
          },
          "request_id": {
            "type": "string",
            "description": "请求任务`ID`，长度必须位于`6`到`64`位之间",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一`ID`，长度必须位于`6`到`128`位之间",
            "minLength": 6,
            "maxLength": 128
          },
          "do_sample": {
            "type": "boolean",
            "description": "是否稳定输出"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "附件列表"
          },
          "metadata": {
            "type": "object",
            "description": "元数据信息",
            "additionalProperties": true
          },
          "extra_parameters": {
            "type": "object",
            "description": "额外参数，用于特定智能体的扩展配置",
            "properties": {
              "translate": {
                "type": "object",
                "description": "翻译参数",
                "properties": {
                  "from": {
                    "type": "string",
                    "description": "源语言"
                  },
                  "to": {
                    "type": "string",
                    "description": "目标语言"
                  }
                }
              }
            }
          }
        },
        "required": [
          "assistant_id",
          "model",
          "messages"
        ]
      },
      "AssistantResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "响应`ID`"
          },
          "request_id": {
            "type": "string",
            "description": "请求`ID`"
          },
          "created": {
            "type": "integer",
            "description": "创建时间戳"
          },
          "model": {
            "type": "string",
            "description": "使用的模型"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "$ref": "#/components/schemas/ChatCompletionResponseMessage"
                },
                "finish_reason": {
                  "type": "string"
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "completion_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "AssistantListRequest": {
        "type": "object",
        "required": [
          "assistant_id_list"
        ],
        "properties": {
          "assistant_id_list": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "智能体`ID`列表，如果为空则查询所有可用智能体",
            "example": [
              "65940acff94777010aa6b796",
              "assistant_2"
            ],
            "default": []
          }
        }
      },
      "AssistantInfo": {
        "type": "object",
        "properties": {
          "assistant_id": {
            "type": "string",
            "description": "智能体`ID`",
            "example": "65940acff94777010aa6b796"
          },
          "name": {
            "type": "string",
            "description": "智能体名称",
            "example": "通用智能助手"
          },
          "avatar": {
            "type": "string",
            "description": "智能体头像URL",
            "example": "https://example.com/avatar.png"
          },
          "description": {
            "type": "string",
            "description": "智能体描述",
            "example": "一个通用的`AI`助手，可以回答各种问题"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "智能体支持的工具列表",
            "example": [
              "web_search",
              "code_interpreter"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "标签键",
                  "example": "category"
                },
                "label": {
                  "type": "string",
                  "description": "标签值",
                  "example": "通用助手"
                }
              }
            },
            "description": "智能体标签列表"
          },
          "status": {
            "type": "string",
            "description": "智能体状态",
            "example": "active"
          },
          "starter_prompts": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "智能体的起始提示语"
          },
          "created_at": {
            "type": "string",
            "description": "创建时间",
            "example": "2024-01-01T00:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "description": "更新时间",
            "example": "2024-01-01T00:00:00Z"
          }
        },
        "required": [
          "assistant_id",
          "name"
        ]
      },
      "ConversationListRequest": {
        "type": "object",
        "required": [
          "assistant_id"
        ],
        "properties": {
          "assistant_id": {
            "type": "string",
            "description": "智能体ID",
            "enum": [
              "65940acff94777010aa6b796",
              "65a265419d72d299a9230616",
              "664dd7bd5bb3a13ba0f81668",
              "664e0cade018d633146de0d2",
              "6654898292788e88ce9e7f4c",
              "66437ef3d920bdc5c60f338e",
              "659e54b1b8006379b4b2abd6",
              "65d2f07bb2c10188f885bd89",
              "663058948bb259b7e8a22730",
              "65a393b3619c6f13586246cd",
              "65b356af6924a59d52832e54",
              "668fdd45405f2e3c9f71f832"
            ],
            "x-enum-varnames": [
              "ChatGLM（官方）",
              "数据分析（官方）",
              "复杂流程图（官方）",
              "思维导图 MindMap（官方）",
              "提示词工程师（官方）",
              "AI画图（官方）",
              "AI搜索（官方）",
              "PPT助手（官方）",
              "arXiv论文速读（官方）",
              "程序员助手Sam（官方）",
              "网文写手（官方）",
              "英语语法助手（官方）"
            ],
            "x-enumNames": [
              "ChatGLM（官方）",
              "数据分析（官方）",
              "复杂流程图（官方）",
              "思维导图 MindMap（官方）",
              "提示词工程师（官方）",
              "AI画图（官方）",
              "AI搜索（官方）",
              "PPT助手（官方）",
              "arXiv论文速读（官方）",
              "程序员助手Sam（官方）",
              "网文写手（官方）",
              "英语语法助手（官方）"
            ],
            "x-enum-descriptions": [
              "ChatGLM（官方） - 嗨~ 我是清言，超开心遇见你！😺 你最近有什么好玩的事情想和我分享吗？",
              "数据分析（官方） - 通过分析用户上传文件或数据说明，帮助用户分析数据并提供图表化。也可通过简单的编码完成文件处理的工作。",
              "复杂流程图（官方） - 人人都能掌握的流程图工具，用五秒钟做一张流程图卷到同事。",
              "思维导图 MindMap（官方） - 告别整理烦恼，任何复杂概念秒变脑图。",
              "提示词工程师（官方） - 人人都是提示词工程师，超强结构化提示词专家，一键改写提示词。",
              "AI画图（官方） - 让想象力自由飞翔，你的专属绘画伙伴，画到停不下来。",
              "AI搜索（官方） - 连接全网内容，精准搜索，快速分析并总结的智能助手。",
              "PPT助手（官方） - 超实用的PPT生成器，支持手动编辑大纲、自动填充章节内容。",
              "arXiv论文速读（官方） - 深度解析arXiv论文，让你快速掌握研究动态，节省宝贵时间。",
              "程序员助手Sam（官方） - \"编程开发知识搜索引擎\"，能帮助程序员解决日常问题。",
              "网文写手（官方） - 大神写作秘诀：一套模板不断重复。",
              "英语语法助手（官方） - 输入单词查询；输入句子检查语法，和语法解释。"
            ],
            "default": "65940acff94777010aa6b796"
          },
          "page": {
            "type": "integer",
            "description": "页码，从1开始",
            "minimum": 1,
            "default": 1,
            "example": 1
          },
          "page_size": {
            "type": "integer",
            "description": "每页大小",
            "minimum": 1,
            "maximum": 100,
            "default": 5,
            "example": 10
          }
        }
      },
      "ConversationListResponse": {
        "type": "object",
        "properties": {
          "assistant_id": {
            "type": "string",
            "description": "智能体`ID`",
            "example": "65940acff94777010aa6b796"
          },
          "conversation_list": {
            "type": "array",
            "description": "会话列表",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "会话`ID`",
                  "example": "conv_123456"
                },
                "assistant_id": {
                  "type": "string",
                  "description": "智能体`ID`",
                  "example": "65940acff94777010aa6b796"
                },
                "create_time": {
                  "type": "string",
                  "description": "创建时间",
                  "example": "2024-01-01T10:00:00Z"
                },
                "update_time": {
                  "type": "string",
                  "description": "更新时间",
                  "example": "2024-01-01T10:30:00Z"
                },
                "usage": {
                  "type": "object",
                  "description": "使用统计",
                  "properties": {
                    "prompt_tokens": {
                      "type": "integer",
                      "description": "输入`token`数"
                    },
                    "completion_tokens": {
                      "type": "integer",
                      "description": "输出`token`数"
                    },
                    "total_tokens": {
                      "type": "integer",
                      "description": "总`token`数"
                    }
                  }
                }
              },
              "required": [
                "id",
                "assistant_id"
              ]
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "是否还有更多数据",
            "example": true
          }
        },
        "required": [
          "assistant_id",
          "conversation_list",
          "has_more"
        ]
      },
      "FileParseResultResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "processing",
              "succeeded",
              "failed"
            ],
            "description": "任务处理状态",
            "example": "succeeded"
          },
          "message": {
            "type": "string",
            "description": "结果状态描述",
            "example": "结果获取成功"
          },
          "content": {
            "type": "string",
            "description": "当`format_type=text`时返回的解析文本内容",
            "example": "这是解析后的文本内容...",
            "nullable": true
          },
          "task_id": {
            "type": "string",
            "description": "文件解析任务`ID`",
            "example": "task_123456789"
          },
          "parsing_result_url": {
            "type": "string",
            "description": "当`format_type=download_link`时返回的结果下载链接",
            "example": "https://example.com/download/result.zip",
            "nullable": true
          }
        },
        "required": [
          "status",
          "message",
          "task_id"
        ]
      },
      "OCRResultResponse": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string",
            "description": "OCR识别任务ID",
            "example": "ce2641ced3e34e67b47f3b0feeb25aee"
          },
          "message": {
            "type": "string",
            "description": "结果状态描述",
            "example": "成功"
          },
          "status": {
            "type": "string",
            "enum": [
              "succeeded",
              "failed"
            ],
            "description": "任务处理状态",
            "example": "succeeded"
          },
          "words_result_num": {
            "type": "integer",
            "description": "识别到的文本块/行数",
            "example": 4
          },
          "words_result": {
            "type": "array",
            "description": "每个识别文本块/行的详细结果",
            "items": {
              "type": "object",
              "properties": {
                "location": {
                  "type": "object",
                  "properties": {
                    "left": {
                      "type": "integer",
                      "example": 79
                    },
                    "top": {
                      "type": "integer",
                      "example": 122
                    },
                    "width": {
                      "type": "integer",
                      "example": 1483
                    },
                    "height": {
                      "type": "integer",
                      "example": 182
                    }
                  },
                  "required": [
                    "left",
                    "top",
                    "width",
                    "height"
                  ]
                },
                "words": {
                  "type": "string",
                  "description": "识别出的文本内容",
                  "example": "你好,世界!"
                },
                "probability": {
                  "type": "object",
                  "description": "置信度信息",
                  "properties": {
                    "average": {
                      "type": "number",
                      "example": 0.7320847511
                    },
                    "variance": {
                      "type": "number",
                      "example": 0.08768635988
                    },
                    "min": {
                      "type": "number",
                      "example": 0.3193874359
                    }
                  },
                  "required": [
                    "average",
                    "variance",
                    "min"
                  ]
                }
              },
              "required": [
                "location",
                "words",
                "probability"
              ]
            }
          }
        },
        "required": [
          "task_id",
          "message",
          "status",
          "words_result_num"
        ]
      },
      "BatchCreateRequest": {
        "type": "object",
        "properties": {
          "input_file_id": {
            "type": "string",
            "description": "上传文件的 `ID`，该文件包含`Batch`的请求。输入文件必须是 `.Jsonl` 格式，并且文件上传时的目的必须标记为\"batch\"。"
          },
          "endpoint": {
            "type": "string",
            "description": "`Batch` 中所有请求将使用的端点。目前支持 `/v4/chat/completions`。",
            "enum": [
              "/v4/chat/completions"
            ]
          },
          "auto_delete_input_file": {
            "type": "boolean",
            "description": "是否自动删除`batch`原始文件，默认为`True`：`True`：执行自动删除。`False`：保留原始`batch`文件。",
            "default": true
          },
          "metadata": {
            "type": "object",
            "nullable": true,
            "description": "用于存储与 `Batch` 相关的数据，如客户`I`D、描述或其他任务管理和跟踪所需的额外信息。可附加到对象上的键值对集合最多为 `16` 个。每个键的长度最多为 `64` 个字符，每个值的长度最多为 `512` 个字符。"
          }
        },
        "required": [
          "input_file_id",
          "endpoint"
        ]
      },
      "Batch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "批处理的唯一标识符。"
          },
          "object": {
            "type": "string",
            "description": "对象类型，这里为 `batch`。"
          },
          "endpoint": {
            "type": "string",
            "description": "批处理使用的 `API` 端点。"
          },
          "input_file_id": {
            "type": "string",
            "description": "批处理使用的输入文件的`ID`。"
          },
          "completion_window": {
            "type": "string",
            "description": "批处理应在此时间框架内完成的期限。"
          },
          "status": {
            "type": "string",
            "description": "批处理的当前状态。"
          },
          "output_file_id": {
            "type": "string",
            "description": "包含成功执行请求的输出的文件`ID`。"
          },
          "error_file_id": {
            "type": "string",
            "description": "包含出现错误的请求的输出的文件`ID`。"
          },
          "created_at": {
            "type": "integer",
            "description": "创建批处理的`Unix`时间戳（秒）。"
          },
          "in_progress_at": {
            "type": "integer",
            "description": "批处理开始处理的`Unix`时间戳（秒）。"
          },
          "expires_at": {
            "type": "integer",
            "description": "批处理将过期的`Unix`时间戳（秒）。"
          },
          "finalizing_at": {
            "type": "integer",
            "description": "批处理开始最终处理的`Unix`时间戳（秒）。"
          },
          "completed_at": {
            "type": "integer",
            "description": "批处理完成的`Unix`时间戳（秒）。"
          },
          "failed_at": {
            "type": "integer",
            "description": "批处理失败的`Unix`时间戳（秒）。"
          },
          "expired_at": {
            "type": "integer",
            "description": "批处理过期的`Unix`时间戳（秒）。"
          },
          "cancelling_at": {
            "type": "integer",
            "description": "批处理开始取消的`Unix`时间戳（秒）。"
          },
          "cancelled_at": {
            "type": "integer",
            "description": "批处理取消完成的`Unix`时间戳（秒）。"
          },
          "request_counts": {
            "type": "integer",
            "description": "batch 请求计数。"
          },
          "total": {
            "type": "integer",
            "description": "批处理中的请求总数。"
          },
          "completed": {
            "type": "integer",
            "description": "批处理中已成功完成的请求数量。"
          },
          "failed": {
            "type": "integer",
            "description": "批处理中失败的请求数量。"
          },
          "metadata": {
            "type": "object",
            "description": "可附加到对象上的 `16` 个键值对的集合。这有助于以结构化格式存储对象的附加信息。键的长度最多为 `64` 个字符，值的长度最多为 `512` 个字符。"
          }
        }
      },
      "BatchListResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Batch"
            }
          },
          "first_id": {
            "type": "string",
            "description": "第一个`ID`"
          },
          "last_id": {
            "type": "string",
            "description": "最后一个`ID`"
          },
          "has_more": {
            "type": "boolean",
            "description": "是否有更多数据"
          }
        }
      },
      "KnowledgeRetrieveRequest": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "请求唯一id，用于定位日志"
          },
          "query": {
            "type": "string",
            "description": "查询内容，限制在1000字以内"
          },
          "knowledge_ids": {
            "type": "array",
            "description": "知识库ID列表",
            "items": {
              "type": "string"
            }
          },
          "document_ids": {
            "type": "array",
            "description": "文档ID列表",
            "items": {
              "type": "string"
            }
          },
          "top_k": {
            "type": "integer",
            "description": "最终召回数量，取值范围为[1~20]，默认为8"
          },
          "top_n": {
            "type": "integer",
            "description": "初始召回数量，取值范围为[1~100]，默认为10"
          },
          "recall_method": {
            "type": "string",
            "enum": [
              "embedding",
              "keyword",
              "mixed"
            ],
            "default": "mixed",
            "description": "检索类型 \n- embedding: 向量化检索\n- keyword:关键词检索\n- mixed: 混合检索（默认）"
          },
          "recall_ratio": {
            "type": "integer",
            "default": 80,
            "description": "混合检索中向量检索的权重，取值范围(0~100)，默认为80"
          },
          "rerank_status": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "是否开启重排，0: 不开启，1: 开启，默认不开启"
          },
          "rerank_model": {
            "type": "string",
            "enum": [
              "rerank",
              "rerank-pro"
            ],
            "description": "重排模型，支持rerank、rerank-pro"
          },
          "fractional_threshold": {
            "type": "number",
            "description": "相似度阈值，低于该阈值的切片会被过滤，取值范围为(0~1)"
          }
        },
        "required": [
          "query",
          "knowledge_ids"
        ]
      },
      "KnowledgeRetrieveResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "description": "检索结果列表",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string",
                  "description": "切片内容"
                },
                "score": {
                  "type": "number",
                  "description": "相似度分数"
                },
                "metadata": {
                  "type": "object",
                  "description": "切片元数据",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "description": "切片ID"
                    },
                    "knowledge_id": {
                      "type": "string",
                      "description": "知识库ID"
                    },
                    "doc_id": {
                      "type": "string",
                      "description": "文档ID"
                    },
                    "doc_name": {
                      "type": "string",
                      "description": "文档名称"
                    },
                    "doc_url": {
                      "type": "string",
                      "description": "文档URL"
                    },
                    "contextual_text": {
                      "type": "string",
                      "description": "上下文增强内容，不开启上下文增强则为空"
                    }
                  }
                }
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "ZragRetrieveRequest": {
        "type": "object",
        "properties": {
          "multimodal": {
            "type": "boolean",
            "default": true,
            "description": "是否走多模态路径检索，默认值为true"
          },
          "knows": {
            "type": "array",
            "description": "查询的知识库列表",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "知识库ID"
                },
                "doc_ids": {
                  "type": "array",
                  "description": "知识库下的文档ID列表",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id"
              ]
            }
          },
          "query": {
            "type": "string",
            "description": "文本查询内容，与多模态查询内容必须传入其中之一"
          },
          "multimodal_parts": {
            "type": "array",
            "description": "多模态查询内容，与文本查询内容必须传入其中之一",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "image_url"
                  ],
                  "description": "仅支持图片类型：image_url"
                },
                "url": {
                  "type": "string",
                  "description": "图片URL链接"
                }
              },
              "required": [
                "type",
                "url"
              ]
            }
          },
          "top_k": {
            "type": "integer",
            "default": 8,
            "description": "最终召回数量，默认为8"
          },
          "top_n": {
            "type": "integer",
            "default": 10,
            "description": "初始召回数量，默认为10"
          },
          "recall_method": {
            "type": "string",
            "enum": [
              "embedding",
              "keyword",
              "mixed"
            ],
            "default": "mixed",
            "description": "文本检索方式：embedding（向量检索）、keyword（关键词检索）、mixed（混合检索）"
          },
          "recall_ratio": {
            "type": "number",
            "default": 0.8,
            "description": "混合检索中向量检索的权重，取值范围0~1"
          },
          "enable_rerank": {
            "type": "boolean",
            "default": false,
            "description": "是否开启重排，默认不开启"
          },
          "enable_rewrite": {
            "type": "boolean",
            "default": false,
            "description": "是否开启查询重写，可配合messages参数实现多轮对话改写，默认不开启"
          },
          "enable_expansion": {
            "type": "boolean",
            "default": false,
            "description": "是否开启扩召，默认不开启"
          },
          "similarity_threshold": {
            "type": "number",
            "default": 0.2,
            "description": "相似度阈值，低于该阈值的切片会被过滤"
          },
          "messages": {
            "type": "array",
            "description": "当前对话消息列表，用于多轮对话改写",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "assistant"
                  ]
                },
                "content": {
                  "type": "string",
                  "description": "消息内容，仅支持文本"
                }
              },
              "required": [
                "role",
                "content"
              ]
            }
          },
          "search_filters": {
            "type": "object",
            "description": "过滤条件",
            "properties": {
              "index_types": {
                "type": "array",
                "description": "索引列表",
                "items": {
                  "type": "object",
                  "properties": {
                    "know_id": {
                      "type": "string",
                      "description": "知识库ID"
                    },
                    "index_type_id": {
                      "type": "integer",
                      "description": "索引ID"
                    }
                  },
                  "required": [
                    "know_id",
                    "index_type_id"
                  ]
                }
              },
              "tags": {
                "type": "array",
                "description": "标签列表",
                "items": {
                  "type": "object",
                  "properties": {
                    "tag_id": {
                      "type": "string",
                      "description": "标签ID"
                    },
                    "value_type": {
                      "type": "string",
                      "enum": [
                        "fixed",
                        "ref"
                      ],
                      "description": "固定值：fixed，引用变量：ref"
                    },
                    "filter_type": {
                      "type": "integer",
                      "enum": [
                        1,
                        2,
                        3,
                        4
                      ],
                      "description": "过滤类型：1: >=，2: <=，3: 包含，4: 不包含"
                    },
                    "filter_value": {
                      "type": "string",
                      "description": "日期/文本/引用值"
                    },
                    "multiple_value": {
                      "type": "array",
                      "description": "选项值列表",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "tag_id",
                    "value_type",
                    "filter_type",
                    "filter_value",
                    "multiple_value"
                  ]
                }
              },
              "qa_intervention": {
                "type": "object",
                "description": "QA干预配置",
                "properties": {
                  "qa_similarity_threshold": {
                    "type": "number",
                    "default": 0.6,
                    "description": "QA干预相似度阈值"
                  },
                  "qa_intervention_ids": {
                    "type": "array",
                    "description": "QA知识库ID列表",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "qa_similarity_threshold",
                  "qa_intervention_ids"
                ]
              }
            }
          }
        },
        "required": [
          "knows"
        ]
      },
      "ZragRetrieveResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "contents": {
                "type": "array",
                "description": "检索结果列表",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "切片ID（UUID）"
                    },
                    "know_id": {
                      "type": "string",
                      "description": "知识库ID"
                    },
                    "doc_id": {
                      "type": "string",
                      "description": "文档ID"
                    },
                    "text": {
                      "type": "string",
                      "description": "文本内容"
                    },
                    "medias": {
                      "type": "array",
                      "description": "文本中的媒体文件",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "图片ID"
                          },
                          "url": {
                            "type": "string",
                            "description": "图片URL"
                          },
                          "description": {
                            "type": "string",
                            "description": "图片描述"
                          }
                        }
                      }
                    },
                    "image_url": {
                      "type": "object",
                      "description": "图像URL",
                      "properties": {
                        "url": {
                          "type": "string",
                          "description": "URL"
                        }
                      }
                    },
                    "video_url": {
                      "type": "object",
                      "description": "视频URL",
                      "properties": {
                        "url": {
                          "type": "string",
                          "description": "URL"
                        }
                      }
                    },
                    "index": {
                      "type": "integer",
                      "description": "召回位次"
                    },
                    "score": {
                      "type": "number",
                      "description": "召回分数"
                    },
                    "rerank_index": {
                      "type": "integer",
                      "description": "重排位次"
                    },
                    "rerank_score": {
                      "type": "number",
                      "description": "重排分数"
                    },
                    "metadata": {
                      "type": "object",
                      "description": "元数据",
                      "properties": {
                        "doc_type": {
                          "type": "string",
                          "description": "文档类型，如 pdf、docx、jpeg、png、mp4、mp3 等"
                        },
                        "doc_name": {
                          "type": "string",
                          "description": "文档名称"
                        },
                        "doc_url": {
                          "type": "string",
                          "description": "文档URL"
                        },
                        "index": {
                          "type": "integer",
                          "description": "切片下标"
                        },
                        "page_index": {
                          "type": "integer",
                          "description": "文档页码"
                        },
                        "clip_index": {
                          "type": "integer",
                          "description": "视频切片下标"
                        },
                        "start_time": {
                          "type": "integer",
                          "description": "首帧时间戳"
                        },
                        "end_time": {
                          "type": "integer",
                          "description": "尾帧时间戳"
                        },
                        "duration": {
                          "type": "integer",
                          "description": "视频切片时长"
                        },
                        "frames": {
                          "type": "array",
                          "description": "关键帧列表",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "rewritten_query": {
                "type": "object",
                "description": "查询重写结果",
                "properties": {
                  "original_query": {
                    "type": "string",
                    "description": "原始查询"
                  },
                  "multi_queries": {
                    "type": "array",
                    "description": "备选查询列表",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "elapsed_ms": {
                "type": "integer",
                "description": "请求耗时（毫秒）"
              },
              "total_tokens": {
                "type": "integer",
                "description": "消耗的token数量"
              },
              "request_id": {
                "type": "string",
                "description": "请求ID"
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "错误码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "错误信息"
          }
        }
      },
      "KnowledgeCreateRequest": {
        "type": "object",
        "properties": {
          "embedding_id": {
            "type": "integer",
            "enum": [
              3,
              11,
              12
            ],
            "description": "知识库绑定的向量化模型ID。可选值：\n- 3: Embedding-2\n- 11: Embedding-3\n- 12: Embedding-3-pro"
          },
          "embedding_model": {
            "type": "string",
            "enum": [
              "Embedding-2",
              "Embedding-3",
              "Embedding-3-pro"
            ],
            "description": "知识库绑定的向量化模型code。可选值：\n- Embedding-2\n- Embedding-3\n- Embedding-3-pro"
          },
          "contextual": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "是否开启上下文增强"
          },
          "name": {
            "type": "string",
            "description": "知识库名称"
          },
          "description": {
            "type": "string",
            "description": "知识库描述"
          },
          "background": {
            "type": "string",
            "description": "背景颜色，可选：blue, red, orange, purple, sky, green, yellow，默认blue"
          },
          "icon": {
            "type": "string",
            "description": "知识库图标，可选：question, book, seal, wrench, tag, horn, house，默认question"
          }
        },
        "required": [
          "embedding_id",
          "name"
        ]
      },
      "KnowledgeCreateResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "生成的知识库唯一id"
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "KnowledgeEditRequest": {
        "type": "object",
        "properties": {
          "embedding_id": {
            "type": "integer",
            "enum": [
              3,
              11,
              12
            ],
            "description": "知识库绑定的向量化模型ID。可选值：\n- 3: Embedding-2\n- 11: Embedding-3\n- 12: Embedding-3-pro"
          },
          "embedding_model": {
            "type": "string",
            "enum": [
              "Embedding-2",
              "Embedding-3",
              "Embedding-3-pro"
            ],
            "description": "知识库绑定的向量化模型code。可选值：\n- Embedding-2\n- Embedding-3\n- Embedding-3-pro"
          },
          "contextual": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "是否开启上下文增强"
          },
          "name": {
            "type": "string",
            "description": "知识库名称"
          },
          "description": {
            "type": "string",
            "description": "知识库描述"
          },
          "background": {
            "type": "string",
            "description": "背景颜色，可选：blue, red, orange, purple, sky, green, yellow"
          },
          "icon": {
            "type": "string",
            "description": "知识库图标，可选：question, book, seal, wrench, tag, horn, house"
          },
          "callback_url": {
            "type": "string",
            "description": "回调地址（若修改向量模型，则需要重新构建知识，由客户决定是否单独配置回调）"
          },
          "callback_header": {
            "type": "object",
            "description": "回调时header携带的k-v（若修改向量模型，则需要重新构建知识，由客户决定是否单独配置回调）"
          }
        }
      },
      "KnowledgeEditResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "KnowledgeListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "list": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/KnowledgeListItem"
                },
                "description": "知识库列表"
              },
              "total": {
                "type": "integer",
                "description": "知识库总数量"
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "KnowledgeListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "知识库id"
          },
          "embedding_id": {
            "type": "integer",
            "description": "向量化模型id"
          },
          "name": {
            "type": "string",
            "description": "知识库名称"
          },
          "description": {
            "type": "string",
            "description": "知识库描述"
          },
          "contextual": {
            "type": "integer",
            "description": "是否开启上下文增强"
          },
          "background": {
            "type": "string",
            "description": "背景颜色"
          },
          "icon": {
            "type": "string",
            "description": "知识库图标"
          },
          "document_size": {
            "type": "integer",
            "description": "文档数量"
          },
          "length": {
            "type": "integer",
            "description": "分词后总长度"
          },
          "word_num": {
            "type": "integer",
            "description": "总字数"
          }
        }
      },
      "KnowledgeDetailResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeListItem"
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "KnowledgeDeleteResponse": {
        "$ref": "#/components/schemas/BaseApiResponse"
      },
      "KnowledgeCapacityResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "used": {
                "$ref": "#/components/schemas/KnowledgeCapacityItem"
              },
              "total": {
                "$ref": "#/components/schemas/KnowledgeCapacityItem"
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "KnowledgeCapacityItem": {
        "type": "object",
        "properties": {
          "word_num": {
            "type": "integer",
            "description": "字数"
          },
          "length": {
            "type": "integer",
            "description": "字节数"
          }
        }
      },
      "DocumentUploadRequest": {
        "type": "object",
        "properties": {
          "files": {
            "type": "string",
            "format": "binary",
            "description": "文件"
          },
          "knowledge_type": {
            "type": "integer",
            "description": "文档类型，不传则动态解析。\n1: 按标题段落切：支持txt,doc,pdf,url,docx,ppt,pptx,md\n2: 按问答对切片：支持txt,doc,pdf,url,docx,ppt,pptx,md\n3: 按行切片：支持xls,xlsx,csv\n5: 自定义切片：支持txt,doc,pdf,url,docx,ppt,pptx,md\n6: 按页切片：支持pdf,ppt,pptx\n7: 按单个切片：支持xls,xlsx,csv"
          },
          "custom_separator": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "自定义切片规则，knowledge_type=5时传，默认\n"
          },
          "sentence_size": {
            "type": "integer",
            "description": "自定义切片大小，knowledge_type=5时传，20-2000，默认300"
          },
          "parse_image": {
            "type": "boolean",
            "description": "是否解析图片，默认不解析"
          },
          "callback_url": {
            "type": "string",
            "description": "回调地址"
          },
          "callback_header": {
            "type": "object",
            "description": "回调时header携带的k-v"
          },
          "word_num_limit": {
            "type": "string",
            "description": "文档字数上限，必须为数字"
          },
          "req_id": {
            "type": "string",
            "description": "请求唯一id"
          }
        },
        "required": [
          "files"
        ]
      },
      "DocumentUploadResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "successInfos": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DocumentUploadSuccessInfo"
                },
                "description": "上传成功的文件"
              },
              "failedInfos": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DocumentUploadFailedInfo"
                },
                "description": "上传失败的文件"
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "DocumentUploadSuccessInfo": {
        "type": "object",
        "properties": {
          "documentId": {
            "type": "string",
            "description": "文档ID"
          },
          "fileName": {
            "type": "string",
            "description": "文件名"
          }
        }
      },
      "DocumentUploadFailedInfo": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "description": "文件名"
          },
          "failReason": {
            "type": "string",
            "description": "失败原因"
          }
        }
      },
      "UsageStatistics": {
        "type": "object",
        "description": "调用结束时返回的 `Token` 使用统计。",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "description": "用户输入的 `Token` 数量"
          },
          "completion_tokens": {
            "type": "integer",
            "description": "输出的 `Token` 数量"
          },
          "total_tokens": {
            "type": "integer",
            "description": "`Token` 总数"
          }
        }
      },
      "CreateImageRequest": {
        "type": "object",
        "required": [
          "model",
          "prompt"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "模型编码",
            "enum": [
              "glm-image",
              "cogview-4-250304",
              "cogview-4",
              "cogview-3-flash"
            ],
            "example": "glm-image"
          },
          "prompt": {
            "type": "string",
            "description": "所需图像的文本描述",
            "example": "一只可爱的小猫咪"
          },
          "quality": {
            "type": "string",
            "description": "生成图像的质量，`glm-image` 默认为 `hd`, 其它默认为 `standard`。`hd`: 生成更精细、细节更丰富的图像，整体一致性更高，耗时约`20`秒；`standard`: 快速生成图像，适合对生成速度有较高要求的场景，耗时约`5-10`秒。`glm-image` 仅支持 `hd`。",
            "enum": [
              "hd",
              "standard"
            ],
            "default": "hd"
          },
          "size": {
            "type": "string",
            "description": "图片尺寸，`glm-image` 推荐枚举值：`1280x1280` (默认), `1568×1056`, `1056×1568`, `1472×1088`, `1088×1472`, `1728×960`, `960×1728`。自定义参数:长宽推荐设置在`1024px-2048px`范围内,并保证最大像素数不超过`2^22px`;长宽均需为`32`的整数倍。\n 其它模型推荐枚举值：`1024x1024` (默认), `768x1344`, `864x1152`, `1344x768`, `1152x864`, `1440x720`, `720x1440`。自定义参数：长宽均需满足`512px-2048px`之间，需被`16`整除，并保证最大像素数不超过`2^21px`。",
            "default": "1280x1280",
            "example": "1280x1280"
          },
          "watermark_enabled": {
            "type": "boolean",
            "description": "控制`AI`生成图片时是否添加水印。\n - `true`: 默认启用`AI`生成的显式水印及隐式数字水印，符合政策要求。\n - `false`: 关闭所有水印，仅允许已签署免责声明的客户使用，签署路径：个人中心-安全管理-去水印管理",
            "example": true
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一`ID`，协助平台对终端用户的违规行为、生成违法及不良信息或其他滥用行为进行干预。`ID`长度要求：最少`6`个字符，最多`128`个字符。",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "AsyncCreateImageRequest": {
        "type": "object",
        "required": [
          "model",
          "prompt"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "模型编码",
            "enum": [
              "glm-image"
            ],
            "example": "glm-image"
          },
          "prompt": {
            "type": "string",
            "description": "所需图像的文本描述",
            "example": "一只可爱的小猫咪"
          },
          "quality": {
            "type": "string",
            "description": "生成图像的质量。`hd`: 生成更精细、细节更丰富的图像，整体一致性更高，耗时约`20`秒；",
            "enum": [
              "hd"
            ],
            "default": "hd"
          },
          "size": {
            "type": "string",
            "description": "图片尺寸，推荐枚举值：`1280x1280` (默认), `1568×1056`, `1056×1568`, `1472×1088`, `1088×1472`, `1728×960`, `960×1728`。\n自定义参数:长宽推荐设置在`1024px-2048px`范围内,并保证最大像素数不超过`2^22px`;长宽均需为`32`的整数倍。",
            "default": "1280x1280",
            "example": "1280x1280"
          },
          "watermark_enabled": {
            "type": "boolean",
            "description": "控制`AI`生成图片时是否添加水印。\n - `true`: 默认启用`AI`生成的显式水印及隐式数字水印，符合政策要求。\n - `false`: 关闭所有水印，仅允许已签署免责声明的客户使用，签署路径：个人中心-安全管理-去水印管理",
            "example": true
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一`ID`，协助平台对终端用户的违规行为、生成违法及不良信息或其他滥用行为进行干预。`ID`长度要求：最少`6`个字符，最多`128`个字符。",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "ImageGenerationResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "description": "请求创建时间，是以秒为单位的`Unix`时间戳"
          },
          "data": {
            "type": "array",
            "description": "数组，包含生成的图片`URL`。目前数组中只包含一张图片。",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "图片链接。图片的临时链接有效期为`30`天，请及时转存图片。"
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "content_filter": {
            "type": "array",
            "description": "返回内容安全的相关信息",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "description": "安全生效环节，包括 `role = assistant` 模型推理，`role = user` 用户输入，`role = history` 历史上下文",
                  "enum": [
                    "assistant",
                    "user",
                    "history"
                  ]
                },
                "level": {
                  "type": "integer",
                  "description": "严重程度 `level 0-3`，`level 0`表示最严重，`3`表示轻微",
                  "minimum": 0,
                  "maximum": 3
                }
              }
            }
          }
        }
      },
      "AsyncVideoGenerationResponse": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "模型名称。"
          },
          "task_status": {
            "type": "string",
            "description": "任务处理状态，`PROCESSING`（处理中），`SUCCESS`（成功），`FAIL`（失败） 注：处理中状态需通过查询获取结果"
          },
          "video_result": {
            "type": "array",
            "description": "数组，包含生成的视频`URL`。",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "视频链接。"
                },
                "cover_image_url": {
                  "type": "string",
                  "description": "视频封面链接。"
                }
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "标识此次请求的唯一`ID`，可由用户在客户端请求时提交或平台自动生成。"
          }
        }
      },
      "AsyncImageGenerationResponse": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "模型名称。"
          },
          "task_status": {
            "type": "string",
            "description": "任务处理状态，`PROCESSING`（处理中），`SUCCESS`（成功），`FAIL`（失败） 注：处理中状态需通过查询获取结果"
          },
          "image_result": {
            "type": "array",
            "description": "数组，包含生成的图片`URL`。",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "图片链接。图片的临时链接有效期为`30`天，请及时转存图片。"
                }
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "标识此次请求的唯一`ID`，可由用户在客户端请求时提交或平台自动生成。"
          }
        }
      },
      "BadRequestData": {},
      "UnauthorizedData": {},
      "NotFoundData": {},
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "required": [
              "code",
              "message"
            ],
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "RError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "msg": {
            "type": "string"
          }
        }
      },
      "LlmApplicationError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "KeyValuePair": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "变量id"
          },
          "name": {
            "type": "string",
            "description": "变量名称"
          },
          "type": {
            "type": "string",
            "description": "变量类型 Input: 文本输入 selection_list: 下拉框 upload_file: 文件上传 upload_image: 图片上传 upload_video: 视频上传 upload_audio: 音频上传"
          },
          "tips": {
            "type": "string",
            "description": "提示词"
          },
          "allowed_values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "下拉框选项, 当type = selection_list, 会有此值"
          },
          "input_template": {
            "$ref": "#/components/schemas/InputTemplate"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "tips",
          "allowed_values",
          "input_template"
        ]
      },
      "InputTemplate": {
        "type": "object",
        "properties": {
          "options": {
            "type": "array",
            "items": {},
            "description": "可选项"
          }
        },
        "required": [
          "options"
        ]
      },
      "ApplicationVariablesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyValuePair"
            },
            "description": "变量列表"
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationFileUploadSuccessInfo": {
        "type": "object",
        "properties": {
          "file_id": {
            "type": "string",
            "description": "文件id"
          },
          "file_name": {
            "type": "string",
            "description": "文件名"
          }
        },
        "required": [
          "file_id",
          "file_name"
        ]
      },
      "ApplicationFileUploadFailInfo": {
        "type": "object",
        "properties": {
          "file_name": {
            "type": "string",
            "description": "文件名"
          },
          "fail_reason": {
            "type": "string",
            "description": "失败原因"
          }
        },
        "required": [
          "file_name",
          "fail_reason"
        ]
      },
      "ApplicationFileUploadResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "success_info": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApplicationFileUploadSuccessInfo"
                },
                "description": "上传成功的文件"
              },
              "fail_info": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApplicationFileUploadFailInfo"
                },
                "description": "上传失败的文件"
              }
            },
            "required": [
              "success_info",
              "fail_info"
            ]
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationConversationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "conversation_id": {
                "type": "string",
                "description": "会话id"
              }
            },
            "required": [
              "conversation_id"
            ]
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationInvokeRequest": {
        "type": "object",
        "properties": {
          "app_id": {
            "type": "string",
            "description": "应用id"
          },
          "conversation_id": {
            "type": "string",
            "description": "会话id, 未传则默认创建新会话"
          },
          "third_request_id": {
            "type": "string",
            "description": "三方请求id(调用插件时传入, 用于链路排查问题)"
          },
          "stream": {
            "type": "boolean",
            "description": "默认true，false时为同步调用"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeMessage"
            },
            "description": "用户输入列表"
          },
          "role": {
            "type": "string",
            "description": "对话类应用请求必传：user（用户输入）， assistant（模型返回）"
          },
          "send_log_event": {
            "type": "boolean",
            "description": "是否实时推送过程日志，默认false"
          }
        },
        "required": [
          "app_id",
          "messages"
        ]
      },
      "ApplicationInvokeMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "角色 user/assistant"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeContent"
            },
            "description": "具体内容"
          }
        },
        "required": [
          "content"
        ]
      },
      "ApplicationInvokeContent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "内容类型 input/upload_file/upload_image/upload_video/selection_list"
          },
          "value": {
            "type": "string",
            "description": "用户输入/下拉选项/文件ID/图片视频url"
          },
          "key": {
            "type": "string",
            "description": "字段名称(文本类应用请求时必须传该字段)"
          }
        },
        "required": [
          "type",
          "value"
        ]
      },
      "ApplicationInvokeResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "请求id"
          },
          "conversation_id": {
            "type": "string",
            "description": "会话id"
          },
          "app_id": {
            "type": "string",
            "description": "应用id"
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeChoice"
            },
            "description": "增量返回的信息"
          },
          "usage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeUsage"
            },
            "description": "本次调用的 tokens 数量统计"
          }
        }
      },
      "ApplicationInvokeChoice": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "description": "结果下标"
          },
          "finish_reason": {
            "type": "string",
            "description": "stop: 正常结束 error: 执行失败"
          },
          "error_msg": {
            "type": "object",
            "description": "异常信息",
            "properties": {
              "code": {
                "type": "integer"
              },
              "msg": {
                "type": "string"
              }
            }
          },
          "delta": {
            "$ref": "#/components/schemas/ApplicationInvokeDelta"
          },
          "messages": {
            "$ref": "#/components/schemas/ApplicationInvokeMessages"
          }
        }
      },
      "ApplicationInvokeDelta": {
        "type": "object",
        "properties": {
          "content": {
            "$ref": "#/components/schemas/MessageData"
          },
          "event": {
            "$ref": "#/components/schemas/ApplicationInvokeEvent"
          },
          "tool_calls": {
            "$ref": "#/components/schemas/ToolCallsData"
          }
        }
      },
      "ApplicationInvokeMessages": {
        "type": "object",
        "properties": {
          "content": {
            "$ref": "#/components/schemas/MessageData"
          },
          "event": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeEvent"
            }
          }
        }
      },
      "ApplicationInvokeEvent": {
        "type": "object",
        "properties": {
          "node_id": {
            "type": "string",
            "description": "节点id"
          },
          "node_name": {
            "type": "string",
            "description": "节点名称"
          },
          "type": {
            "type": "string",
            "description": "事件类型 node_processing/tool_processing/tool_finish/node_finish"
          },
          "content": {
            "type": "string",
            "description": "输入输出内容"
          },
          "time": {
            "type": "integer",
            "description": "毫秒"
          },
          "tool_calls": {
            "$ref": "#/components/schemas/ToolCallsData"
          }
        }
      },
      "ToolCallsData": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "function/retrieval/web_search"
          },
          "tool_calls_data": {
            "type": "object",
            "description": "工具消息体/日志体"
          }
        }
      },
      "MessageData": {
        "type": "object",
        "properties": {
          "msg": {
            "type": "string",
            "description": "推理内容/文本/图片/视频/工具等"
          },
          "type": {
            "type": "string",
            "description": "text/image/video/all_tools"
          },
          "code": {
            "type": "string",
            "description": "代码（all_tools时）"
          },
          "file": {
            "type": "string",
            "description": "文件URL（all_tools时）"
          },
          "url": {
            "type": "string",
            "description": "图片/视频url"
          },
          "coverUrl": {
            "type": "string",
            "description": "视频封面url"
          }
        }
      },
      "ApplicationInvokeUsage": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "推理model"
          },
          "nodeName": {
            "type": "string",
            "description": "节点名称"
          },
          "inputTokenCount": {
            "type": "integer",
            "description": "输入的 tokens 数量"
          },
          "outputTokenCount": {
            "type": "integer",
            "description": "输出的 tokens 数量"
          },
          "totalTokenCount": {
            "type": "integer",
            "description": "总 tokens 数量"
          }
        }
      },
      "ApplicationSliceInfoRequest": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "创建对话或文本请求接口返回的id"
          },
          "node_id": {
            "type": "string",
            "description": "节点id"
          }
        },
        "required": [
          "request_id",
          "node_id"
        ]
      },
      "ApplicationSliceInfoResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "document_slices": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DocumentSlices"
                },
                "description": "文档切片信息"
              },
              "has_old_document": {
                "type": "boolean",
                "description": "是否存在没有切片位置的历史文档"
              }
            },
            "required": [
              "document_slices",
              "has_old_document"
            ]
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "DocumentSlices": {
        "type": "object",
        "properties": {
          "document": {
            "$ref": "#/components/schemas/DocumentInfo"
          },
          "slice_info": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SliceInfo"
            },
            "description": "切片信息"
          },
          "hide_positions": {
            "type": "boolean",
            "description": "是否存在历史文档切片没有位置信息"
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SliceImage"
            },
            "description": "图片列表"
          }
        },
        "required": [
          "document",
          "slice_info",
          "hide_positions"
        ]
      },
      "SliceImage": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "图片名称"
          },
          "cos_url": {
            "type": "string",
            "description": "图片地址"
          }
        },
        "required": [
          "text",
          "cos_url"
        ]
      },
      "DocumentInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "文档ID"
          },
          "name": {
            "type": "string",
            "description": "文档名称"
          },
          "url": {
            "type": "string",
            "description": "文档URL"
          },
          "dtype": {
            "type": "integer",
            "description": "文档类型"
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "dtype"
        ]
      },
      "SliceInfo": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "文档ID"
          },
          "position": {
            "$ref": "#/components/schemas/SlicePosition"
          },
          "line": {
            "type": "integer",
            "description": "sheet行号"
          },
          "sheet_name": {
            "type": "string",
            "description": "sheet名称"
          },
          "text": {
            "type": "string",
            "description": "切片内容"
          }
        },
        "required": [
          "document_id",
          "text"
        ]
      },
      "SlicePosition": {
        "type": "object",
        "properties": {
          "x0": {
            "type": "number",
            "format": "float",
            "description": "左侧到行左侧的距离"
          },
          "x1": {
            "type": "number",
            "format": "float",
            "description": "字符顶部到顶部距离"
          },
          "top": {
            "type": "number",
            "format": "float",
            "description": "字符顶部到顶部距离"
          },
          "bottom": {
            "type": "number",
            "format": "float",
            "description": "字符底部到顶部距离"
          },
          "page": {
            "type": "integer",
            "description": "所在页"
          },
          "height": {
            "type": "number",
            "format": "float",
            "description": "所在页高"
          },
          "width": {
            "type": "number",
            "format": "float",
            "description": "所在页宽度"
          }
        },
        "required": [
          "x0",
          "x1",
          "top",
          "bottom",
          "page",
          "height",
          "width"
        ]
      },
      "HistorySessionRecordResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "problems": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "推荐问题列表"
              }
            },
            "required": [
              "problems"
            ]
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationFileStatRequest": {
        "type": "object",
        "properties": {
          "app_id": {
            "type": "string",
            "description": "智能体（应用）id"
          },
          "file_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "文件id列表"
          }
        },
        "required": [
          "app_id",
          "file_ids"
        ]
      },
      "ApplicationFileStatResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationFileStatItem"
            },
            "description": "文件解析状态列表"
          },
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationFileStatItem": {
        "type": "object",
        "properties": {
          "file_id": {
            "type": "string",
            "description": "文件id"
          },
          "code": {
            "type": "integer",
            "description": "文档解析状态码"
          },
          "msg": {
            "type": "string",
            "description": "描述"
          }
        },
        "required": [
          "file_id",
          "code",
          "msg"
        ]
      },
      "EditKnowledgeRequest": {
        "type": "object",
        "properties": {
          "knowledge_type": {
            "type": "integer",
            "description": "文档切片类型。1.按标题段落切；2.按问答对切片；3.按行切片；5.自定义切片；6.按页切片；7.按单个切片。"
          },
          "custom_separator": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "自定义切片分隔符，仅 knowledge_type=5 时生效，默认 \n"
          },
          "sentence_size": {
            "type": "integer",
            "description": "自定义切片字数，仅 knowledge_type=5 时生效，20-2000，默认300"
          },
          "callback_url": {
            "type": "string",
            "description": "回调地址"
          },
          "callback_header": {
            "type": "object",
            "description": "回调时 header 携带的 k-v 对象"
          }
        },
        "required": [
          "knowledge_type"
        ]
      },
      "EditKnowledgeResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "状态码"
          },
          "message": {
            "type": "string",
            "description": "返回信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "时间戳"
          }
        }
      },
      "KnowledgeDocumentListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "list": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/KnowledgeDocumentItem"
                }
              },
              "total": {
                "type": "integer",
                "description": "总数"
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "状态码"
          },
          "message": {
            "type": "string",
            "description": "返回信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "时间戳"
          }
        }
      },
      "KnowledgeDocumentItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "文档id"
          },
          "knowledge_type": {
            "type": "integer",
            "description": "文档切片类型"
          },
          "custom_separator": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "自定义分隔符"
          },
          "sentence_size": {
            "type": "integer",
            "description": "切片字数"
          },
          "length": {
            "type": "integer",
            "description": "文档长度"
          },
          "word_num": {
            "type": "integer",
            "description": "字数"
          },
          "name": {
            "type": "string",
            "description": "文档名称"
          },
          "url": {
            "type": "string",
            "description": "文档URL"
          },
          "embedding_stat": {
            "type": "integer",
            "description": "向量化状态"
          },
          "failInfo": {
            "$ref": "#/components/schemas/KnowledgeDocumentFailInfo"
          }
        }
      },
      "KnowledgeDocumentFailInfo": {
        "type": "object",
        "properties": {
          "embedding_code": {
            "type": "integer",
            "description": "向量化失败状态码"
          },
          "embedding_msg": {
            "type": "string",
            "description": "向量化失败信息"
          }
        }
      },
      "KnowledgeDocumentDetailResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeDocumentItem"
          },
          "code": {
            "type": "integer",
            "description": "状态码"
          },
          "message": {
            "type": "string",
            "description": "返回信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "时间戳"
          }
        }
      },
      "DeleteKnowledgeResponse": {
        "$ref": "#/components/schemas/BaseApiResponse"
      },
      "UploadUrlKnowledgeRequest": {
        "type": "object",
        "properties": {
          "upload_detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UrlData"
            },
            "description": "url列表"
          },
          "knowledge_id": {
            "type": "string",
            "description": "知识库id"
          }
        },
        "required": [
          "upload_detail",
          "knowledge_id"
        ]
      },
      "UrlData": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "url"
          },
          "knowledge_type": {
            "type": "integer",
            "description": "文档切片类型"
          },
          "custom_separator": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "自定义切片分隔符，仅 knowledge_type=5 时生效，默认 \n"
          },
          "sentence_size": {
            "type": "integer",
            "description": "自定义切片字数，仅 knowledge_type=5 时生效，20-2000，默认300"
          },
          "callback_url": {
            "type": "string",
            "description": "回调地址"
          },
          "callback_header": {
            "type": "object",
            "description": "回调header k-v"
          }
        },
        "required": [
          "url",
          "knowledge_type"
        ]
      },
      "UploadUrlKnowledgeResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "successInfos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "documentId": {
                      "type": "string",
                      "description": "文档id"
                    },
                    "url": {
                      "type": "string",
                      "description": "url"
                    }
                  }
                }
              },
              "failedInfos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "url"
                    },
                    "failReason": {
                      "type": "string",
                      "description": "失败原因"
                    }
                  }
                }
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "状态码"
          },
          "message": {
            "type": "string",
            "description": "返回信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "时间戳"
          }
        }
      },
      "ReEmbeddingRequest": {
        "type": "object",
        "properties": {
          "callback_url": {
            "type": "string",
            "description": "回调地址"
          },
          "callback_header": {
            "type": "object",
            "description": "回调header k-v"
          }
        }
      },
      "ReEmbeddingResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "状态码"
          },
          "message": {
            "type": "string",
            "description": "返回信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "时间戳"
          }
        }
      },
      "KnowledgeImageListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "图片序号文本"
                    },
                    "cos_url": {
                      "type": "string",
                      "description": "图片链接"
                    }
                  }
                }
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "状态码"
          },
          "message": {
            "type": "string",
            "description": "返回信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "时间戳"
          }
        }
      },
      "AgentChatRequest": {
        "type": "object",
        "required": [
          "messages",
          "retrieval"
        ],
        "properties": {
          "messages": {
            "type": "array",
            "description": "当前消息列表，支持多模态内容",
            "items": {
              "$ref": "#/components/schemas/AgentMessage"
            }
          },
          "model": {
            "type": "string",
            "default": "glm-5v-turbo",
            "description": "LLM 模型名称，默认为 glm-5v-turbo"
          },
          "temperature": {
            "type": "number",
            "default": 0.7,
            "description": "采样温度，默认为 0.7"
          },
          "max_steps": {
            "type": "integer",
            "default": 10,
            "description": "最大推理步数，默认为 10"
          },
          "retrieval": {
            "$ref": "#/components/schemas/AgentRetrieval"
          },
          "enable_thinking": {
            "type": "boolean",
            "default": false,
            "description": "是否启用思考模式。启用后模型输出推理过程，通过 reasoning 事件流式返回"
          }
        }
      },
      "AgentRetrieval": {
        "type": "object",
        "description": "检索预设参数。预设后 LLM 仅决定是否调用检索，无需自行填写参数",
        "properties": {
          "know_ids": {
            "type": "array",
            "description": "知识库 ID 列表",
            "items": {
              "type": "string"
            }
          },
          "top_k": {
            "type": "integer",
            "description": "检索数量",
            "default": 8
          },
          "top_n": {
            "type": "integer",
            "description": "召回数量",
            "default": 10
          },
          "enable_rerank": {
            "type": "boolean",
            "description": "是否启用重排序",
            "default": false
          },
          "similarity_threshold": {
            "type": "number",
            "description": "相似度阈值",
            "default": 0.2
          }
        },
        "required": [
          "know_ids"
        ]
      },
      "AgentMessage": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user"
            ],
            "description": "角色：user"
          },
          "content": {
            "description": "消息内容。纯文本用 String，多模态用 ContentPart 数组",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AgentContentPart"
                }
              }
            ]
          }
        }
      },
      "AgentContentPart": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image_url"
            ],
            "description": "内容类型"
          },
          "text": {
            "type": "string",
            "description": "文本内容（type=text 时）"
          },
          "image_url": {
            "type": "object",
            "description": "图片 URL（type=image_url 时）",
            "properties": {
              "url": {
                "type": "string",
                "description": "图片链接地址"
              }
            }
          }
        }
      },
      "AgentToolCallMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "工具调用 ID"
          },
          "type": {
            "type": "string",
            "description": "类型，固定为 function"
          },
          "function": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "工具名称"
              },
              "arguments": {
                "type": "string",
                "description": "工具调用参数（JSON 字符串）"
              }
            }
          }
        }
      },
      "AgentStreamEvent": {
        "type": "object",
        "description": "SSE 事件流中的单个事件对象",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "session_created",
              "reasoning",
              "thought",
              "tool_call",
              "tool_result",
              "answer",
              "done",
              "error"
            ],
            "description": "事件类型"
          },
          "sessionId": {
            "type": "string",
            "description": "会话 ID"
          },
          "messageId": {
            "type": "string",
            "description": "消息 ID（仅 done 事件）"
          },
          "data": {
            "description": "事件负载，结构取决于 type",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/AgentToolCallData"
              },
              {
                "$ref": "#/components/schemas/AgentToolResultData"
              },
              {
                "$ref": "#/components/schemas/AgentErrorData"
              }
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/AgentUsage"
          }
        }
      },
      "AgentToolCallData": {
        "type": "object",
        "description": "type=tool_call 时的 data 结构",
        "properties": {
          "callId": {
            "type": "string",
            "description": "工具调用 ID"
          },
          "toolName": {
            "type": "string",
            "description": "工具名称"
          },
          "arguments": {
            "type": "object",
            "description": "工具调用参数",
            "additionalProperties": true
          }
        }
      },
      "AgentToolResultData": {
        "type": "object",
        "description": "type=tool_result 时的 data 结构",
        "properties": {
          "callId": {
            "type": "string",
            "description": "工具调用 ID"
          },
          "toolName": {
            "type": "string",
            "description": "工具名称"
          },
          "result": {
            "description": "执行结果",
            "additionalProperties": true
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "error"
            ],
            "description": "执行状态"
          },
          "durationMs": {
            "type": "integer",
            "format": "int64",
            "description": "执行耗时（毫秒）"
          }
        }
      },
      "AgentErrorData": {
        "type": "object",
        "description": "type=error 时的 data 结构",
        "properties": {
          "message": {
            "type": "string",
            "description": "错误描述"
          }
        }
      },
      "AgentUsage": {
        "type": "object",
        "description": "Token 用量信息（仅 done 事件）",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "description": "输入 Token 数"
          },
          "completion_tokens": {
            "type": "integer",
            "description": "输出 Token 数"
          },
          "total_tokens": {
            "type": "integer",
            "description": "总 Token 数"
          },
          "total_calls": {
            "type": "integer",
            "description": "工具调用总次数"
          },
          "prompt_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer",
                "description": "缓存命中 Token 数"
              }
            }
          },
          "completion_tokens_details": {
            "type": "object",
            "properties": {
              "reasoning_tokens": {
                "type": "integer",
                "description": "推理 Token 数"
              }
            }
          }
        }
      },
      "ManagedAgentsErrorResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request_error",
                  "authentication_error",
                  "permission_error",
                  "not_found_error",
                  "request_too_large",
                  "rate_limit_error",
                  "api_error",
                  "timeout_error",
                  "overloaded_error",
                  "memory_path_conflict_error",
                  "memory_precondition_failed_error",
                  "conflict_error"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "type",
              "message"
            ],
            "additionalProperties": false
          },
          "request_id": {
            "type": "string",
            "example": "req_01J..."
          }
        },
        "required": [
          "type",
          "error",
          "request_id"
        ],
        "additionalProperties": false
      },
      "ManagedMetadata": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        },
        "description": "客户端自定义元数据；省略时默认为空对象。最多 16 个键，键名长度不超过 64 字符，值必须是长度不超过 512 字符的字符串。",
        "maxProperties": 16
      },
      "ManagedMetadataPatch": {
        "type": "object",
        "properties": {},
        "nullable": true,
        "maxProperties": 16,
        "additionalProperties": {
          "type": "string",
          "nullable": true
        },
        "description": "元数据补丁；省略整个字段时保持不变，键值为 null 时删除对应键。最多 16 个键，键名长度不超过 64 字符，字符串值不超过 512 字符。"
      },
      "ManagedModelInput": {
        "title": "Managed Agents 模型",
        "example": "glm-5.3",
        "default": "glm-5.3",
        "oneOf": [
          {
            "title": "模型 ID",
            "type": "string",
            "enum": [
              "glm-5.3",
              "glm-5.3-flash",
              "glm-5.3-flashx"
            ],
            "example": "glm-5.3",
            "default": "glm-5.3"
          },
          {
            "title": "模型配置",
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "enum": [
                  "glm-5.3",
                  "glm-5.3-flash",
                  "glm-5.3-flashx"
                ],
                "example": "glm-5.3",
                "default": "glm-5.3"
              },
              "effort": {
                "oneOf": [
                  {
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "max"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "low",
                          "high",
                          "max"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  }
                ],
                "nullable": true,
                "description": "输入兼容字符串/对象/null；glm-5.3 默认 max，flash/flashx 默认 high。"
              },
              "speed": {
                "type": "string",
                "nullable": true,
                "enum": [
                  "standard"
                ],
                "default": "standard",
                "description": "当前仅支持 standard；省略或传 null 时也使用 standard。"
              }
            },
            "required": [
              "id"
            ],
            "additionalProperties": false
          }
        ],
        "description": "模型 ID，或包含推理强度与速度的模型配置。当前支持 glm-5.3、glm-5.3-flash 与 glm-5.3-flashx。使用字符串简写时，服务端按模型补齐默认 effort，并将 speed 补为 standard。"
      },
      "ManagedModelResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "glm-5.3"
          },
          "effort": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "max"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "string",
                "enum": [
                  "low",
                  "high",
                  "max"
                ]
              }
            ],
            "description": "新协议返回 {type:档位}，旧协议返回字符串。"
          },
          "speed": {
            "type": "string",
            "enum": [
              "standard"
            ],
            "example": "standard"
          }
        },
        "required": [
          "id",
          "speed"
        ],
        "additionalProperties": false
      },
      "ManagedPermissionPolicy": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "always_allow",
              "always_ask"
            ],
            "description": "工具调用权限策略。always_allow 表示无需确认；always_ask 表示每次调用前请求确认。"
          }
        },
        "required": [
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedToolDefaultConfigInput": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "nullable": true,
            "default": true,
            "description": "工具集默认是否启用；省略或传 null 时为 true。"
          },
          "permission_policy": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedPermissionPolicy"
              }
            ],
            "nullable": true,
            "default": {
              "type": "always_allow"
            },
            "description": "工具集默认权限策略；省略或传 null 时为 always_allow。"
          }
        },
        "additionalProperties": false
      },
      "ManagedToolDefaultConfigResponse": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "permission_policy": {
            "$ref": "#/components/schemas/ManagedPermissionPolicy"
          }
        },
        "required": [
          "enabled",
          "permission_policy"
        ],
        "additionalProperties": false
      },
      "ManagedBuiltinToolConfigInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "read",
                  "write",
                  "edit",
                  "bash",
                  "grep",
                  "find",
                  "ls"
                ]
              },
              "enabled": {
                "type": "boolean",
                "nullable": true,
                "description": "覆盖当前工具的 enabled；省略或传 null 时继承 default_config。"
              },
              "permission_policy": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedPermissionPolicy"
                  }
                ],
                "nullable": true,
                "description": "覆盖当前工具的权限策略；省略或传 null 时继承 default_config。"
              },
              "type": {
                "type": "string",
                "enum": [
                  "read",
                  "write",
                  "edit",
                  "bash",
                  "grep",
                  "find",
                  "ls"
                ],
                "description": "可选，若提供必须等于 name。"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false,
            "title": "沙箱工具",
            "description": "type/name 若同时提供必须相等。"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "web_search"
                ]
              },
              "enabled": {
                "type": "boolean",
                "nullable": true,
                "description": "覆盖当前工具的 enabled；省略或传 null 时继承 default_config。"
              },
              "permission_policy": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedPermissionPolicy"
                  }
                ],
                "nullable": true,
                "description": "覆盖当前工具的权限策略；省略或传 null 时继承 default_config。"
              },
              "type": {
                "type": "string",
                "enum": [
                  "web_search"
                ]
              },
              "user_location": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "approximate"
                    ]
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}$"
                  },
                  "timezone": {
                    "type": "string"
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false,
                "nullable": true
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false,
            "title": "web_search",
            "description": "allowed_domains/blocked_domains 暂不接受：配置时 400，不是静默失效。"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "web_fetch"
                ]
              },
              "enabled": {
                "type": "boolean",
                "nullable": true,
                "description": "覆盖当前工具的 enabled；省略或传 null 时继承 default_config。"
              },
              "permission_policy": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedPermissionPolicy"
                  }
                ],
                "nullable": true,
                "description": "覆盖当前工具的权限策略；省略或传 null 时继承 default_config。"
              },
              "type": {
                "type": "string",
                "enum": [
                  "web_fetch"
                ]
              },
              "max_content_tokens": {
                "type": "integer",
                "minimum": 1,
                "nullable": true
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false,
            "title": "web_fetch",
            "description": "allowed_domains/blocked_domains 暂不接受：配置时 400，不是静默失效。"
          }
        ]
      },
      "ManagedMcpToolConfigInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "MCP Server 实际公开的工具名；同一 configs 数组内不得重复。"
          },
          "enabled": {
            "type": "boolean",
            "nullable": true,
            "description": "覆盖当前 MCP 工具的 enabled；省略或传 null 时继承 default_config。"
          },
          "permission_policy": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedPermissionPolicy"
              }
            ],
            "nullable": true,
            "description": "覆盖当前 MCP 工具的权限策略；省略或传 null 时继承 default_config。"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ManagedBuiltinToolConfigResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "read",
                  "write",
                  "edit",
                  "bash",
                  "grep",
                  "find",
                  "ls"
                ]
              },
              "enabled": {
                "type": "boolean"
              },
              "permission_policy": {
                "$ref": "#/components/schemas/ManagedPermissionPolicy"
              },
              "type": {
                "type": "string",
                "enum": [
                  "read",
                  "write",
                  "edit",
                  "bash",
                  "grep",
                  "find",
                  "ls"
                ]
              }
            },
            "required": [
              "name",
              "enabled",
              "permission_policy",
              "type"
            ],
            "additionalProperties": false,
            "title": "沙箱工具",
            "description": "type/name 若同时提供必须相等。"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "web_search"
                ]
              },
              "enabled": {
                "type": "boolean"
              },
              "permission_policy": {
                "$ref": "#/components/schemas/ManagedPermissionPolicy"
              },
              "type": {
                "type": "string",
                "enum": [
                  "web_search"
                ]
              },
              "user_location": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "approximate"
                    ]
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "region": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}$"
                  },
                  "timezone": {
                    "type": "string"
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false,
                "nullable": true
              }
            },
            "required": [
              "name",
              "enabled",
              "permission_policy",
              "type"
            ],
            "additionalProperties": false,
            "title": "web_search",
            "description": "allowed_domains/blocked_domains 暂不接受：配置时 400，不是静默失效。"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "web_fetch"
                ]
              },
              "enabled": {
                "type": "boolean"
              },
              "permission_policy": {
                "$ref": "#/components/schemas/ManagedPermissionPolicy"
              },
              "type": {
                "type": "string",
                "enum": [
                  "web_fetch"
                ]
              },
              "max_content_tokens": {
                "type": "integer",
                "minimum": 1,
                "nullable": true
              },
              "url_sources": {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ],
                "description": "新协议恒为 null；目前不接受对应输入配置。"
              }
            },
            "required": [
              "name",
              "enabled",
              "permission_policy",
              "type"
            ],
            "additionalProperties": false,
            "title": "web_fetch",
            "description": "allowed_domains/blocked_domains 暂不接受：配置时 400，不是静默失效。"
          }
        ]
      },
      "ManagedMcpToolConfigResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "permission_policy": {
            "$ref": "#/components/schemas/ManagedPermissionPolicy"
          }
        },
        "required": [
          "name",
          "enabled",
          "permission_policy"
        ],
        "additionalProperties": false
      },
      "ManagedCustomToolInputSchema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "object"
            ],
            "description": "固定为 object。"
          },
          "properties": {
            "type": "object",
            "additionalProperties": true,
            "description": "工具输入字段的 JSON Schema；省略时表示未声明属性。"
          },
          "required": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "必填输入字段名；省略时无必填字段。"
          }
        },
        "required": [
          "type"
        ],
        "additionalProperties": true
      },
      "ManagedAgentToolsetInput": {
        "oneOf": [
          {
            "title": "agent_toolset_20260601",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "agent_toolset_20260601"
                ]
              },
              "default_config": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedToolDefaultConfigInput"
                  }
                ],
                "nullable": true,
                "default": null,
                "description": "工具集默认配置；省略或传 null 时 enabled=true、permission_policy=always_allow。"
              },
              "configs": {
                "type": "array",
                "maxItems": 128,
                "default": [],
                "description": "逐工具覆盖；省略时为空，name 不得重复。",
                "items": {
                  "$ref": "#/components/schemas/ManagedBuiltinToolConfigInput"
                }
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "mcp_toolset",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "mcp_toolset"
                ]
              },
              "mcp_server_name": {
                "type": "string",
                "minLength": 1,
                "description": "必须精确匹配 mcp_servers 中唯一一个 Server 的 name。"
              },
              "default_config": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedToolDefaultConfigInput"
                  }
                ],
                "nullable": true,
                "default": null,
                "description": "MCP 工具集默认配置；省略或传 null 时 enabled=true、permission_policy=always_allow。"
              },
              "configs": {
                "type": "array",
                "maxItems": 128,
                "default": [],
                "description": "逐 MCP 工具覆盖；省略时为空，name 不得重复。",
                "items": {
                  "$ref": "#/components/schemas/ManagedMcpToolConfigInput"
                }
              }
            },
            "required": [
              "type",
              "mcp_server_name"
            ],
            "additionalProperties": false
          },
          {
            "title": "custom",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "custom"
                ]
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_-]+$",
                "description": "自定义工具名；仅允许字母、数字、下划线和连字符，不得以 mcp__ 开头，且同一配置内不得重复。"
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "input_schema": {
                "$ref": "#/components/schemas/ManagedCustomToolInputSchema"
              }
            },
            "required": [
              "type",
              "name",
              "description",
              "input_schema"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedAgentToolsetResponse": {
        "oneOf": [
          {
            "title": "agent_toolset_20260601",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "agent_toolset_20260601"
                ]
              },
              "default_config": {
                "$ref": "#/components/schemas/ManagedToolDefaultConfigResponse"
              },
              "configs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ManagedBuiltinToolConfigResponse"
                }
              }
            },
            "required": [
              "type",
              "default_config",
              "configs"
            ],
            "additionalProperties": false
          },
          {
            "title": "mcp_toolset",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "mcp_toolset"
                ]
              },
              "mcp_server_name": {
                "type": "string"
              },
              "default_config": {
                "$ref": "#/components/schemas/ManagedToolDefaultConfigResponse"
              },
              "configs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ManagedMcpToolConfigResponse"
                }
              }
            },
            "required": [
              "type",
              "mcp_server_name",
              "default_config",
              "configs"
            ],
            "additionalProperties": false
          },
          {
            "title": "custom",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "custom"
                ]
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "input_schema": {
                "$ref": "#/components/schemas/ManagedCustomToolInputSchema"
              }
            },
            "required": [
              "type",
              "name",
              "description",
              "input_schema"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedSkillReference": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "custom",
              "zai"
            ],
            "description": "custom 表示当前所有者创建的 Skill；zai 表示平台内置 Skill。"
          },
          "skill_id": {
            "type": "string",
            "minLength": 1,
            "description": "Skill ID；必须存在且当前身份可访问。"
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "description": "可省略/null/latest。新协议在 Session 创建/Deployment 触发时固定，旧协议每次沙箱启动解析；具体 ID 固定对应版本。",
            "nullable": true,
            "example": "latest"
          }
        },
        "required": [
          "type",
          "skill_id"
        ],
        "additionalProperties": false
      },
      "ManagedMcpServer": {
        "type": "object",
        "description": "远程 MCP Server。name 在同一配置内必须唯一，并且必须与 tools 中恰好一个 mcp_toolset.mcp_server_name 相同。",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "url"
            ],
            "description": "当前只支持 url。"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Server 名称，长度 1–255；同一 mcp_servers 数组内不得重复。"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "maxLength": 2048,
            "description": "公开 HTTPS Streamable HTTP URL；不得包含凭据、fragment、空 query 或旧式 SSE 路径。"
          }
        },
        "required": [
          "type",
          "name",
          "url"
        ],
        "additionalProperties": false,
        "example": {
          "type": "url",
          "name": "knowledge-base",
          "url": "https://mcp.example.com/mcp"
        }
      },
      "ManagedAgent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Agent ID。",
            "example": "agent_01911111-1111-7111-8111-111111111111"
          },
          "type": {
            "type": "string",
            "enum": [
              "agent"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "用途说明。"
          },
          "model": {
            "$ref": "#/components/schemas/ManagedModelResponse"
          },
          "system": {
            "type": "string",
            "nullable": true,
            "description": "系统提示词。"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentToolsetResponse"
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSkillReference"
            }
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedMcpServer"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          },
          "multiagent": {
            "$ref": "#/components/schemas/ManagedMultiagent"
          },
          "archived_at": {
            "type": "string",
            "nullable": true,
            "description": "归档时间；未归档时为 null。"
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "model",
          "system",
          "description",
          "tools",
          "skills",
          "mcp_servers",
          "metadata",
          "version",
          "created_at",
          "updated_at",
          "archived_at"
        ],
        "additionalProperties": false,
        "example": {
          "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
        }
      },
      "ManagedAgentCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Agent 名称，长度 1–256 个字符。"
          },
          "model": {
            "$ref": "#/components/schemas/ManagedModelInput"
          },
          "system": {
            "type": "string",
            "nullable": true,
            "maxLength": 100000,
            "default": null,
            "description": "系统提示词；省略或传 null 时不设置。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 2048,
            "default": null,
            "description": "Agent 用途说明；省略或传 null 时不设置。"
          },
          "tools": {
            "type": "array",
            "maxItems": 128,
            "default": [],
            "description": "工具集列表；省略时为空。MCP Server 必须与 mcp_toolset 按名称一一对应；配置 Skill 时必须包含 agent_toolset_20260601。",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentToolsetInput"
            }
          },
          "skills": {
            "type": "array",
            "maxItems": 20,
            "default": [],
            "uniqueItems": true,
            "description": "Skill 引用；省略时为空。version 省略或传 null 时跟随 latest，传具体版本号时固定版本；同一 skill_id 与生效 version 组合不得重复。配置 Skill 时必须同时配置 agent_toolset_20260601。",
            "items": {
              "$ref": "#/components/schemas/ManagedSkillReference"
            }
          },
          "mcp_servers": {
            "type": "array",
            "maxItems": 20,
            "default": [],
            "description": "MCP Server 列表；省略时为空。名称必须唯一，并且每个 Server 必须恰好对应一个同名 mcp_toolset。",
            "items": {
              "$ref": "#/components/schemas/ManagedMcpServer"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "multiagent": {
            "$ref": "#/components/schemas/ManagedMultiagent"
          }
        },
        "required": [
          "name",
          "model"
        ],
        "additionalProperties": false,
        "example": {
          "name": "support-agent",
          "model": "glm-5.3",
          "system": "你是一个专业的客户支持助手。",
          "tools": [
            {
              "type": "agent_toolset_20260601"
            }
          ]
        }
      },
      "ManagedAgentUpdateRequest": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number",
            "minimum": 1,
            "description": "可选。带上当前版本号时，若期间配置已被他人改过则返回 409；省略则按本次提交覆盖。须为正整数。"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "替换 Agent 名称；省略时保持不变。"
          },
          "model": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedModelInput"
              }
            ],
            "description": "替换完整模型配置；省略时保持不变。"
          },
          "system": {
            "type": "string",
            "nullable": true,
            "maxLength": 100000,
            "description": "替换系统提示词；null 表示清空，省略时保持不变。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 2048,
            "description": "替换用途说明；null 表示清空，省略时保持不变。"
          },
          "tools": {
            "type": "array",
            "nullable": true,
            "maxItems": 128,
            "description": "整体替换工具列表；null 或空数组表示清空，省略时保持不变。若包含 mcp_toolset，必须同时提交 mcp_servers。",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentToolsetInput"
            }
          },
          "skills": {
            "type": "array",
            "nullable": true,
            "maxItems": 20,
            "uniqueItems": true,
            "description": "整体替换 Skill 列表；null 或空数组表示清空，省略时保持不变。有效配置必须包含 agent_toolset_20260601。",
            "items": {
              "$ref": "#/components/schemas/ManagedSkillReference"
            }
          },
          "mcp_servers": {
            "type": "array",
            "nullable": true,
            "maxItems": 20,
            "description": "整体替换 MCP Server 列表；仅能与 tools 同时提交，null 或空数组表示清空。最终配置必须与 mcp_toolset 按名称一一对应。",
            "items": {
              "$ref": "#/components/schemas/ManagedMcpServer"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadataPatch"
          },
          "multiagent": {
            "$ref": "#/components/schemas/ManagedMultiagent"
          }
        },
        "additionalProperties": false
      },
      "ManagedEnvironmentPackagesInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "packages"
            ],
            "description": "可选判别字段；提供时只能为 packages。"
          },
          "apt": {
            "type": "array",
            "nullable": true,
            "maxItems": 200,
            "default": [],
            "description": "最多 200 个不同包名；null/省略视为空数组，重复项会去重。每项 trim 后不能为空、不能包含空白或控制字符，也不能以 - 开头。",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "cargo": {
            "type": "array",
            "nullable": true,
            "maxItems": 200,
            "default": [],
            "description": "最多 200 个不同包名；null/省略视为空数组，重复项会去重。每项 trim 后不能为空、不能包含空白或控制字符，也不能以 - 开头。",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "gem": {
            "type": "array",
            "nullable": true,
            "maxItems": 200,
            "default": [],
            "description": "最多 200 个不同包名；null/省略视为空数组，重复项会去重。每项 trim 后不能为空、不能包含空白或控制字符，也不能以 - 开头。",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "go": {
            "type": "array",
            "nullable": true,
            "maxItems": 200,
            "default": [],
            "description": "最多 200 个不同包名；null/省略视为空数组，重复项会去重。每项 trim 后不能为空、不能包含空白或控制字符，也不能以 - 开头。",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "npm": {
            "type": "array",
            "nullable": true,
            "maxItems": 200,
            "default": [],
            "description": "最多 200 个不同包名；null/省略视为空数组，重复项会去重。每项 trim 后不能为空、不能包含空白或控制字符，也不能以 - 开头。",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "pip": {
            "type": "array",
            "nullable": true,
            "maxItems": 200,
            "default": [],
            "description": "最多 200 个不同包名；null/省略视为空数组，重复项会去重。每项 trim 后不能为空、不能包含空白或控制字符，也不能以 - 开头。",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        },
        "additionalProperties": false,
        "description": "声明需要预装的包；六类包管理器均可省略，省略或 null 会规范化为空数组。"
      },
      "ManagedEnvironmentPackagesResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "packages"
            ]
          },
          "apt": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cargo": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gem": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "go": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "npm": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pip": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "type",
          "apt",
          "cargo",
          "gem",
          "go",
          "npm",
          "pip"
        ],
        "additionalProperties": false
      },
      "ManagedEnvironmentNetworkingInput": {
        "oneOf": [
          {
            "title": "unrestricted",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "unrestricted"
                ]
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "limited",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "limited"
                ]
              },
              "allowed_hosts": {
                "type": "array",
                "nullable": true,
                "maxItems": 256,
                "default": [],
                "description": "最多 256 个不同 host；null/省略视为空数组，重复项会去重。只接受 hostname 或 *.example.com 通配形式，不得包含协议、端口或路径。",
                "items": {
                  "type": "string",
                  "maxLength": 255
                }
              },
              "allow_package_managers": {
                "type": "boolean",
                "nullable": true,
                "default": false,
                "description": "是否允许包管理器联网；省略或传 null 时为 false。limited 模式声明 packages 时必须显式设为 true。"
              },
              "allow_mcp_servers": {
                "type": "boolean",
                "nullable": true,
                "default": false,
                "description": "是否允许已配置的 MCP Server 联网；省略或传 null 时为 false。"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          }
        ],
        "description": "网络策略。省略整个 networking 时默认为 unrestricted；所有模式的出站端口均限 HTTP/HTTPS 80/443。"
      },
      "ManagedEnvironmentNetworkingResponse": {
        "oneOf": [
          {
            "title": "unrestricted",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "unrestricted"
                ]
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "limited",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "limited"
                ]
              },
              "allowed_hosts": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "allow_package_managers": {
                "type": "boolean"
              },
              "allow_mcp_servers": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "allowed_hosts",
              "allow_package_managers",
              "allow_mcp_servers"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedEnvironmentConfigInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cloud"
            ],
            "description": "当前只支持 cloud；self_hosted 会被拒绝。"
          },
          "packages": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedEnvironmentPackagesInput"
              }
            ],
            "nullable": true,
            "default": null,
            "description": "包声明；省略或传 null 时六类包列表均为空。"
          },
          "networking": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedEnvironmentNetworkingInput"
              }
            ],
            "nullable": true,
            "default": null,
            "description": "网络策略；省略或传 null 时为 unrestricted。"
          }
        },
        "required": [
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedEnvironmentConfigResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cloud"
            ]
          },
          "packages": {
            "$ref": "#/components/schemas/ManagedEnvironmentPackagesResponse"
          },
          "networking": {
            "$ref": "#/components/schemas/ManagedEnvironmentNetworkingResponse"
          }
        },
        "required": [
          "type",
          "packages",
          "networking"
        ],
        "additionalProperties": false
      },
      "ManagedEnvironment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Environment ID。",
            "example": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
          },
          "type": {
            "type": "string",
            "enum": [
              "environment"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "用途说明。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "config": {
            "$ref": "#/components/schemas/ManagedEnvironmentConfigResponse"
          },
          "scope": {
            "type": "string",
            "enum": [
              "organization"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "archived_at": {
            "type": "string",
            "nullable": true,
            "description": "归档时间。"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "description",
          "metadata",
          "config",
          "scope",
          "state",
          "archived_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ManagedEnvironmentCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Environment 名称，长度 1–256 个字符。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 1024,
            "default": null,
            "description": "用途说明；省略或传 null 时不设置。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "scope": {
            "type": "string",
            "nullable": true,
            "enum": [
              "organization"
            ],
            "default": "organization",
            "description": "公开 API 仅支持 organization；省略或传 null 时也使用 organization。"
          },
          "config": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedEnvironmentConfigInput"
              }
            ],
            "nullable": true,
            "default": null,
            "description": "运行环境配置；省略或传 null 时使用 cloud、空 packages、unrestricted networking。"
          }
        },
        "required": [
          "name"
        ],
        "description": "创建 Environment。config 内出现未支持的字段时请求会被拒绝。"
      },
      "ManagedEnvironmentUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "替换名称；省略时保持不变。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 1024,
            "description": "替换用途说明；null 表示清空，省略时保持不变。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadataPatch"
          },
          "scope": {
            "type": "string",
            "nullable": true,
            "enum": [
              "organization"
            ],
            "description": "只能为 organization；null 或省略不会改变现有作用域。"
          },
          "config": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedEnvironmentConfigInput"
              }
            ],
            "nullable": true,
            "description": "替换完整配置；null 表示恢复默认 cloud 配置，省略时保持不变。"
          }
        }
      },
      "ManagedTextBlock": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text"
            ],
            "description": "固定为 text。"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "description": "非空文本内容。"
          }
        },
        "required": [
          "type",
          "text"
        ]
      },
      "ManagedImageSource": {
        "description": "图片来源为 base64、url 或 file。每事件最多 50 张，单张最多 50 MiB；1–20 张时宽高各不超过 8000 px，21–50 张时各不超过 2000 px。图片 Base64 总量最多 112 MiB，带图请求体最多 128 MiB。",
        "oneOf": [
          {
            "title": "base64",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedImageBase64Source"
              }
            ]
          },
          {
            "title": "url",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedImageUrlSource"
              }
            ]
          },
          {
            "title": "file",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedImageFileSource"
              }
            ]
          }
        ]
      },
      "ManagedImageBlock": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image"
            ],
            "description": "固定为 image。"
          },
          "source": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedImageSource"
              }
            ],
            "description": "base64、HTTPS URL 或 File ID 图片来源，需使用支持图片输入的模型。"
          }
        },
        "required": [
          "type",
          "source"
        ],
        "additionalProperties": false
      },
      "ManagedTextDocumentSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text"
            ],
            "description": "固定为 text。"
          },
          "media_type": {
            "type": "string",
            "enum": [
              "text/plain"
            ],
            "description": "当前仅支持 text/plain。"
          },
          "data": {
            "type": "string",
            "description": "内联纯文本内容。"
          }
        },
        "required": [
          "type",
          "media_type",
          "data"
        ],
        "additionalProperties": false
      },
      "ManagedFileDocumentSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "file"
            ],
            "description": "固定为 file。"
          },
          "file_id": {
            "type": "string",
            "minLength": 1,
            "description": "当前身份可访问的 File ID。"
          }
        },
        "required": [
          "type",
          "file_id"
        ],
        "additionalProperties": false
      },
      "ManagedDocumentBlock": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "document"
            ],
            "description": "固定为 document；Deployment 与 Session 创建时的 initial_events 不允许该 block。"
          },
          "source": {
            "oneOf": [
              {
                "title": "text",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedTextDocumentSource"
                  }
                ]
              },
              {
                "title": "file",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedFileDocumentSource"
                  }
                ]
              }
            ],
            "description": "内联纯文本或已上传的 File。"
          },
          "title": {
            "type": "string",
            "nullable": true,
            "description": "可选文档标题。"
          },
          "context": {
            "type": "string",
            "nullable": true,
            "description": "当前实现接受该字段，但持久化事件会将其规范化为 null。"
          }
        },
        "required": [
          "type",
          "source"
        ],
        "additionalProperties": false
      },
      "ManagedInitialContentBlock": {
        "oneOf": [
          {
            "title": "text",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedTextBlock"
              }
            ]
          },
          {
            "title": "image",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedImageBlock"
              }
            ]
          }
        ]
      },
      "ManagedContentBlock": {
        "oneOf": [
          {
            "title": "text",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedTextBlock"
              }
            ]
          },
          {
            "title": "image",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedImageBlock"
              }
            ]
          },
          {
            "title": "document",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedDocumentBlock"
              }
            ]
          }
        ]
      },
      "ManagedUserMessageEventInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "user.message"
            ],
            "description": "固定为 user.message。"
          },
          "content": {
            "type": "array",
            "minItems": 1,
            "description": "非空内容块数组，允许 text、image 或 document；图片最多 50 张，总量受请求体限制。",
            "items": {
              "$ref": "#/components/schemas/ManagedContentBlock"
            }
          }
        },
        "required": [
          "type",
          "content"
        ]
      },
      "ManagedInitialUserMessageEventInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "user.message"
            ],
            "description": "固定为 user.message。"
          },
          "content": {
            "type": "array",
            "minItems": 1,
            "description": "非空内容块数组；初始消息允许 text/image，普通消息还允许 document。图片最多 50 张；总量受请求体限制。",
            "items": {
              "$ref": "#/components/schemas/ManagedInitialContentBlock"
            }
          }
        },
        "required": [
          "type",
          "content"
        ]
      },
      "ManagedEventInput": {
        "oneOf": [
          {
            "title": "user.message",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedUserMessageEventInput"
              }
            ]
          },
          {
            "title": "user.interrupt",
            "type": "object",
            "description": "请求停止当前工作。平台会主动停止当前模型响应和运行中的命令；请求入队后接口立即返回，会话完成收尾后以 session.status_idle(end_turn) 结束本轮。",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user.interrupt"
                ]
              },
              "session_thread_id": {
                "type": "string",
                "description": "可选，只打断该线程；省略打断全部活跃线程。"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "title": "user.tool_confirmation",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user.tool_confirmation"
                ]
              },
              "tool_use_id": {
                "type": "string",
                "minLength": 1
              },
              "result": {
                "type": "string",
                "enum": [
                  "allow",
                  "deny"
                ]
              },
              "deny_message": {
                "type": "string",
                "nullable": true,
                "description": "仅 result=deny 时可提供拒绝原因。"
              }
            },
            "required": [
              "type",
              "tool_use_id",
              "result"
            ],
            "additionalProperties": false
          },
          {
            "title": "user.custom_tool_result",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user.custom_tool_result"
                ]
              },
              "custom_tool_use_id": {
                "type": "string",
                "minLength": 1
              },
              "content": {
                "type": "array",
                "maxItems": 20,
                "items": {
                  "$ref": "#/components/schemas/ManagedContentBlock"
                }
              },
              "is_error": {
                "type": "boolean",
                "nullable": true
              }
            },
            "required": [
              "type",
              "custom_tool_use_id"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedPersistedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "agent.custom_tool_use",
              "agent.mcp_tool_result",
              "agent.mcp_tool_use",
              "agent.message",
              "agent.thinking",
              "agent.thread_context_compacted",
              "agent.thread_message_received",
              "agent.thread_message_sent",
              "agent.tool_result",
              "agent.tool_use",
              "session.deleted",
              "session.error",
              "session.status_idle",
              "session.status_rescheduled",
              "session.status_running",
              "session.status_terminated",
              "session.thread_created",
              "session.thread_status_idle",
              "session.thread_status_rescheduled",
              "session.thread_status_running",
              "session.thread_status_terminated",
              "session.updated",
              "session.usage",
              "span.model_request_end",
              "span.model_request_start",
              "span.outcome_evaluation_end",
              "span.outcome_evaluation_ongoing",
              "span.outcome_evaluation_start",
              "system.message",
              "user.custom_tool_result",
              "user.define_outcome",
              "user.interrupt",
              "user.message",
              "user.tool_confirmation",
              "user.tool_result"
            ]
          },
          "processed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "事件被平台处理时写入，不保证唯一。排队中的 user.message / user.interrupt 在历史接口中可能省略或为 null；公共 SSE 会在平台接手后携带 processed_at 推送。"
          },
          "session_thread_id": {
            "type": "string",
            "description": "Session 面子线程 cross-post 的来源归属；Thread ID，不是第三类资源。"
          },
          "from_session_thread_id": {
            "type": "string"
          },
          "from_agent_name": {
            "type": "string"
          },
          "to_session_thread_id": {
            "type": "string"
          },
          "to_agent_name": {
            "type": "string"
          },
          "stop_details": {
            "type": "object",
            "nullable": true,
            "enum": [
              null
            ]
          },
          "workflow_run_id": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "消息/Thinking 内容或工具结果块。Search 使用 search_result，Fetch 使用 document；agent.thinking 的 content 仅新协议下输出。"
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer"
              },
              "cache_read_input_tokens": {
                "type": "integer"
              },
              "server_tool_use": {
                "type": "object",
                "properties": {
                  "web_search_requests": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "web_fetch_requests": {
                    "type": "integer",
                    "enum": [
                      0
                    ]
                  }
                },
                "required": [
                  "web_search_requests",
                  "web_fetch_requests"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "input_tokens",
              "output_tokens",
              "cache_read_input_tokens"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": true,
        "description": "持久化事件。不同 type 的其余字段由对应事件载荷决定；此枚举直接来自 master 的 ManagedSessionEventTypes。"
      },
      "ManagedSendEventsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedPersistedEvent"
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryStoreResourceInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "memory_store"
            ],
            "description": "固定为 memory_store。"
          },
          "memory_store_id": {
            "type": "string",
            "minLength": 1,
            "description": "已存在且可访问的 Memory Store ID。"
          },
          "access": {
            "type": "string",
            "nullable": true,
            "enum": [
              "read_only",
              "read_write"
            ],
            "default": "read_write",
            "description": "挂载权限；省略或传 null 时由 Memory 服务按 read_write 处理。"
          },
          "instructions": {
            "type": "string",
            "nullable": true,
            "maxLength": 4096,
            "description": "提供给 Agent 的使用说明；省略或传 null 时不设置。"
          }
        },
        "required": [
          "type",
          "memory_store_id"
        ]
      },
      "ManagedDeploymentMemoryStoreResourceInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "memory_store"
            ],
            "description": "固定为 memory_store。"
          },
          "memory_store_id": {
            "type": "string",
            "minLength": 1,
            "description": "Agent 所有者名下处于 active 状态的 Memory Store ID。"
          },
          "access": {
            "type": "string",
            "enum": [
              "read_only",
              "read_write"
            ],
            "default": "read_write",
            "description": "挂载权限；省略时由 Memory 服务按 read_write 处理。"
          },
          "instructions": {
            "type": "string",
            "description": "提供给 Agent 的使用说明；省略时不设置。"
          }
        },
        "required": [
          "type",
          "memory_store_id"
        ]
      },
      "ManagedMemoryStoreResourceResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "memory_store"
            ]
          },
          "memory_store_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "access": {
            "type": "string",
            "enum": [
              "read_only",
              "read_write"
            ]
          },
          "instructions": {
            "type": "string",
            "nullable": true
          },
          "mount_path": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "memory_store_id",
          "name",
          "description",
          "access",
          "instructions",
          "mount_path"
        ],
        "additionalProperties": false
      },
      "ManagedFileResourceInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "file"
            ],
            "description": "固定为 file。"
          },
          "file_id": {
            "type": "string",
            "minLength": 1,
            "description": "已存在且归当前资源所有者所有的 File ID。"
          },
          "mount_path": {
            "type": "string",
            "nullable": true,
            "description": "沙箱内挂载路径；省略或传 null 时默认为 /mnt/session/uploads/{file_id}。路径会归一化到 /mnt/session/uploads 下，不能逃逸该目录，UTF-8 总长度不超过 1024 字节。"
          }
        },
        "required": [
          "type",
          "file_id"
        ],
        "additionalProperties": false
      },
      "ManagedFileResourceResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "file"
            ]
          },
          "file_id": {
            "type": "string"
          },
          "mount_path": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          }
        },
        "required": [
          "id",
          "type",
          "file_id",
          "mount_path",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ManagedSessionResourceInput": {
        "oneOf": [
          {
            "title": "memory_store",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedMemoryStoreResourceInput"
              }
            ]
          },
          {
            "title": "file",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedFileResourceInput"
              }
            ]
          },
          {
            "$ref": "#/components/schemas/ManagedGithubRepositoryInput",
            "title": "github_repository"
          }
        ]
      },
      "ManagedDeploymentResourceInput": {
        "oneOf": [
          {
            "title": "memory_store",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedDeploymentMemoryStoreResourceInput"
              }
            ]
          },
          {
            "title": "file",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedFileResourceInput"
              }
            ]
          }
        ]
      },
      "ManagedSessionResourceResponse": {
        "oneOf": [
          {
            "title": "memory_store",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedMemoryStoreResourceResponse"
              }
            ]
          },
          {
            "title": "file",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedFileResourceResponse"
              }
            ]
          },
          {
            "$ref": "#/components/schemas/ManagedGithubRepositoryResponse",
            "title": "github_repository"
          }
        ]
      },
      "ManagedAgentReferenceInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "agent"
            ],
            "description": "固定为 agent。"
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Agent ID。"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "固定使用的 Agent 版本；省略时固定创建请求时的当前版本。"
          }
        },
        "required": [
          "type",
          "id"
        ]
      },
      "ManagedAgentWithOverridesInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "agent_with_overrides"
            ],
            "description": "固定为 agent_with_overrides。"
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Agent ID。"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "基准 Agent 版本；省略时固定创建请求时的当前版本。"
          },
          "model": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedModelInput"
              }
            ],
            "description": "覆盖完整模型配置；省略时继承 Agent 版本。"
          },
          "system": {
            "type": "string",
            "nullable": true,
            "maxLength": 100000,
            "description": "覆盖系统提示词；null 表示清空，省略时继承 Agent 版本。"
          },
          "tools": {
            "type": "array",
            "nullable": true,
            "maxItems": 128,
            "description": "整体覆盖工具列表；null 或空数组表示清空，省略时继承 Agent 版本。MCP 映射约束在合并后的最终配置上校验。",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentToolsetInput"
            }
          },
          "skills": {
            "type": "array",
            "nullable": true,
            "maxItems": 20,
            "uniqueItems": true,
            "description": "整体覆盖 Skill 列表；null 或空数组表示清空，省略时继承 Agent 版本。最终配置含 Skill 时必须含 agent_toolset_20260601。",
            "items": {
              "$ref": "#/components/schemas/ManagedSkillReference"
            }
          },
          "mcp_servers": {
            "type": "array",
            "nullable": true,
            "maxItems": 20,
            "description": "整体覆盖 MCP Server；null 或空数组表示清空，省略时继承 Agent 版本。最终配置必须与 mcp_toolset 一一对应。",
            "items": {
              "$ref": "#/components/schemas/ManagedMcpServer"
            }
          }
        },
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false
      },
      "ManagedSessionAgentInput": {
        "oneOf": [
          {
            "title": "Agent ID",
            "type": "string",
            "minLength": 1
          },
          {
            "title": "agent",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedAgentReferenceInput"
              }
            ]
          },
          {
            "title": "agent_with_overrides",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedAgentWithOverridesInput"
              }
            ]
          }
        ],
        "description": "可传 Agent ID 字符串、固定版本引用，或带会话级覆盖的 Agent 引用。"
      },
      "ManagedSessionAgentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "agent"
            ]
          },
          "name": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ManagedModelResponse"
          },
          "system": {
            "type": "string",
            "nullable": true,
            "description": "解析后的系统提示词。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Agent 描述。"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentToolsetResponse"
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSkillReference"
            }
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedMcpServer"
            }
          },
          "multiagent": {
            "type": "object",
            "nullable": true,
            "enum": [
              null
            ],
            "description": "Session 内嵌快照当前为 null，成员 Agent 列表 从对应 Agent 版本读取。"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "model",
          "system",
          "description",
          "tools",
          "skills",
          "mcp_servers",
          "version"
        ],
        "additionalProperties": false
      },
      "ManagedSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Session ID。",
            "example": "sess_01J..."
          },
          "type": {
            "type": "string",
            "enum": [
              "session"
            ]
          },
          "agent": {
            "$ref": "#/components/schemas/ManagedSessionAgentResponse"
          },
          "environment_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "idle",
              "running",
              "rescheduling",
              "terminated"
            ]
          },
          "title": {
            "type": "string",
            "nullable": true,
            "description": "Session 标题。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSessionResourceResponse"
            }
          },
          "vault_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "outcome_evaluations": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "stats": {
            "type": "object",
            "properties": {
              "active_seconds": {
                "type": "number"
              },
              "duration_seconds": {
                "type": "number"
              }
            },
            "required": [
              "duration_seconds"
            ]
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer"
              },
              "cache_read_input_tokens": {
                "type": "integer"
              },
              "server_tool_use": {
                "type": "object",
                "properties": {
                  "web_search_requests": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "web_fetch_requests": {
                    "type": "integer",
                    "enum": [
                      0
                    ]
                  }
                },
                "required": [
                  "web_search_requests",
                  "web_fetch_requests"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "input_tokens",
              "output_tokens",
              "cache_read_input_tokens"
            ]
          },
          "budget": {
            "type": "object",
            "nullable": true,
            "enum": [
              null
            ],
            "description": "当前不支持会话级消费上限，固定为 null。"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          },
          "archived_at": {
            "type": "string",
            "nullable": true,
            "description": "归档时间。"
          }
        },
        "required": [
          "id",
          "type",
          "agent",
          "environment_id",
          "status",
          "title",
          "metadata",
          "resources",
          "outcome_evaluations",
          "stats",
          "usage",
          "vault_ids",
          "created_at",
          "updated_at",
          "archived_at"
        ],
        "additionalProperties": false
      },
      "ManagedSessionCreateRequest": {
        "type": "object",
        "properties": {
          "agent": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedSessionAgentInput"
              }
            ],
            "description": "Agent 配置；必填。仅为兼容旧调用时可改用 agent_id。"
          },
          "agent_id": {
            "type": "string",
            "minLength": 1,
            "description": "兼容字段；agent 缺失时使用。"
          },
          "environment_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^env_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
            "description": "必填的 Environment ID；必须存在、未归档并可由当前 Agent 使用。",
            "example": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
          },
          "title": {
            "type": "string",
            "nullable": true,
            "maxLength": 256,
            "default": null,
            "description": "会话标题；省略或传 null 时不设置。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "initial_events": {
            "type": "array",
            "maxItems": 50,
            "default": [],
            "description": "创建后立即写入并唤醒执行的 user.message 事件；省略时为空。仅允许文本与图片（base64、url 或 file 来源），图片要求生效模型支持图片输入。",
            "items": {
              "$ref": "#/components/schemas/ManagedInitialUserMessageEventInput"
            }
          },
          "resources": {
            "type": "array",
            "default": [],
            "description": "file ≤500、memory_store ≤8；github_repository 只在创建 Session 时声明。仓库凭据可轮换，不支持后续新增或删除仓库。",
            "items": {
              "$ref": "#/components/schemas/ManagedSessionResourceInput"
            }
          },
          "vault_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true,
            "default": [],
            "description": "挂载的 Vault ID；省略时为空，最多 20 个且不得重复。"
          }
        },
        "required": [
          "agent",
          "environment_id"
        ],
        "description": "必须提供 agent 与 environment_id。未传 agent 时，服务端仍接受兼容字段 agent_id。",
        "anyOf": [
          {
            "title": "agent",
            "required": [
              "agent"
            ]
          },
          {
            "title": "agent_id",
            "required": [
              "agent_id"
            ]
          }
        ]
      },
      "ManagedSessionUpdateRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true,
            "maxLength": 256,
            "description": "替换标题；null 表示清空，省略时保持不变。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadataPatch"
          },
          "agent": {
            "type": "object",
            "description": "只允许覆盖 tools 与 mcp_servers，且至少提供一个字段；两者涉及 MCP 时须一起提交并保持一一对应。",
            "properties": {
              "tools": {
                "type": "array",
                "nullable": true,
                "maxItems": 128,
                "description": "整体替换会话的工具覆盖；null 或空数组表示清空。若包含 mcp_toolset，必须同时提交 mcp_servers。",
                "items": {
                  "$ref": "#/components/schemas/ManagedAgentToolsetInput"
                }
              },
              "mcp_servers": {
                "type": "array",
                "nullable": true,
                "maxItems": 20,
                "description": "整体替换会话的 MCP Server 覆盖；仅能与 tools 同时提交，最终配置必须与 mcp_toolset 一一对应。",
                "items": {
                  "$ref": "#/components/schemas/ManagedMcpServer"
                }
              }
            },
            "additionalProperties": false,
            "minProperties": 1
          }
        },
        "additionalProperties": false,
        "minProperties": 1
      },
      "ManagedSendEventsRequest": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "description": "一次提交 1–10 个事件，按数组顺序处理。",
            "items": {
              "$ref": "#/components/schemas/ManagedEventInput"
            }
          }
        },
        "required": [
          "events"
        ]
      },
      "ManagedFile": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "file"
            ]
          },
          "id": {
            "type": "string",
            "description": "File ID。",
            "example": "file_01911111-1111-7111-8111-111111111111"
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "downloadable": {
            "type": "boolean",
            "description": "上传文件为 false，不可再下载；写入 /mnt/session/outputs 后编目的会话产物为 true。"
          },
          "scope": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "session"
                ]
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false,
            "description": "仅会话范围文件在列出或获取时返回；组织级上传文件和上传响应不含此字段。"
          },
          "expires_at": {
            "type": "string",
            "nullable": true,
            "enum": [
              null
            ],
            "example": null,
            "description": "新协议固定为 null，不设自动过期时间；旧协议省略此字段。"
          }
        },
        "required": [
          "type",
          "id",
          "size_bytes",
          "created_at",
          "filename",
          "mime_type",
          "downloadable"
        ],
        "additionalProperties": false,
        "example": {
          "type": "file",
          "id": "file_01911111-1111-7111-8111-222222222222",
          "size_bytes": 1024,
          "created_at": "2026-10-15T08:00:00.000Z",
          "filename": "report.txt",
          "mime_type": "text/plain",
          "downloadable": true,
          "expires_at": null,
          "scope": {
            "type": "session",
            "id": "sess_01911111-1111-7111-8111-111111111111"
          }
        }
      },
      "ManagedMemoryStore": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Memory Store ID。",
            "example": "memstore_01J..."
          },
          "type": {
            "type": "string",
            "enum": [
              "memory_store"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "archived_at": {
            "type": "string",
            "nullable": true,
            "description": "归档时间。"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "description",
          "metadata",
          "created_at",
          "updated_at",
          "archived_at"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryStoreCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Memory Store 名称，1–255 个 Unicode 字符；不能包含控制字符或格式字符。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 1024,
            "default": null,
            "description": "用途说明；省略或传 null 时不设置。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryStoreUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "maxLength": 255,
            "description": "替换名称；省略或传 null 时保持不变。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 1024,
            "description": "替换用途说明；null 表示清空，省略时保持不变。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadataPatch"
          }
        },
        "additionalProperties": false
      },
      "ManagedMemory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Memory ID。",
            "example": "mem_01J..."
          },
          "type": {
            "type": "string",
            "enum": [
              "memory"
            ]
          },
          "memory_store_id": {
            "type": "string"
          },
          "memory_version_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "content_sha256": {
            "type": "string"
          },
          "content_size_bytes": {
            "type": "integer"
          },
          "content": {
            "type": "string",
            "nullable": true,
            "description": "view=full 时返回内容。"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          }
        },
        "required": [
          "id",
          "type",
          "memory_store_id",
          "memory_version_id",
          "path",
          "content_sha256",
          "content_size_bytes",
          "content",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryPrefix": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "memory_prefix"
            ]
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "path"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryListItem": {
        "oneOf": [
          {
            "title": "memory",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedMemory"
              }
            ]
          },
          {
            "title": "memory_prefix",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedMemoryPrefix"
              }
            ]
          }
        ]
      },
      "ManagedMemoryCreateRequest": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 2,
            "description": "NFC 路径，以 / 开头，不允许空、. 或 .. 路径段；UTF-8 最多 1024 字节。"
          },
          "content": {
            "type": "string",
            "description": "UTF-8 内容，默认上限 102400 字节；部署可通过平台限制调整。"
          }
        },
        "required": [
          "path",
          "content"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryUpdateRequest": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "nullable": true,
            "description": "新路径必须满足创建时的路径规则；null 与省略均表示保持路径不变。"
          },
          "content": {
            "type": "string",
            "nullable": true,
            "description": "新内容受平台 maxMemoryBytes 限制，默认 102400 UTF-8 字节；null 与省略均表示保持内容不变。"
          },
          "precondition": {
            "type": "object",
            "description": "可选。要求当前内容哈希一致才更新；省略则不检查。",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "content_sha256"
                ]
              },
              "content_sha256": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "期望的当前内容 SHA-256，必须是 64 位小写十六进制；不匹配时拒绝更新。"
              }
            },
            "required": [
              "type",
              "content_sha256"
            ],
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "ManagedMemoryActor": {
        "oneOf": [
          {
            "title": "session_actor",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "session_actor"
                ]
              },
              "session_id": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "session_id"
            ],
            "additionalProperties": false
          },
          {
            "title": "user_actor",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user_actor"
                ]
              },
              "user_id": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "user_id"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedMemoryVersion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "memory_version"
            ]
          },
          "memory_store_id": {
            "type": "string"
          },
          "memory_id": {
            "type": "string"
          },
          "operation": {
            "type": "string",
            "enum": [
              "created",
              "modified",
              "deleted"
            ]
          },
          "path": {
            "type": "string",
            "nullable": true
          },
          "content_sha256": {
            "type": "string",
            "nullable": true
          },
          "content_size_bytes": {
            "type": "integer",
            "nullable": true
          },
          "content": {
            "type": "string",
            "nullable": true,
            "description": "view=full 时返回内容；basic、deleted 或 redacted 时为 null。"
          },
          "created_by": {
            "$ref": "#/components/schemas/ManagedMemoryActor"
          },
          "redacted_at": {
            "type": "string",
            "nullable": true,
            "description": "脱敏时间。"
          },
          "redacted_by": {
            "$ref": "#/components/schemas/ManagedMemoryActor"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          }
        },
        "required": [
          "id",
          "type",
          "memory_store_id",
          "memory_id",
          "operation",
          "path",
          "content_sha256",
          "content_size_bytes",
          "content",
          "created_by",
          "redacted_at",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ManagedVault": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "vault"
            ]
          },
          "id": {
            "type": "string",
            "description": "Vault ID。",
            "example": "vlt_01J..."
          },
          "display_name": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          },
          "archived_at": {
            "type": "string",
            "nullable": true,
            "description": "归档时间。"
          }
        },
        "required": [
          "type",
          "id",
          "display_name",
          "metadata",
          "created_at",
          "updated_at",
          "archived_at"
        ],
        "additionalProperties": false
      },
      "ManagedVaultCreateRequest": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Vault 显示名称，长度 1–255 个字符。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          }
        },
        "required": [
          "display_name"
        ],
        "description": "创建 Vault；metadata 省略时默认为空对象。"
      },
      "ManagedVaultUpdateRequest": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "maxLength": 255,
            "description": "替换显示名称；null 表示清为空字符串，省略时保持不变。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadataPatch"
          }
        }
      },
      "ManagedVaultNetworking": {
        "oneOf": [
          {
            "title": "unrestricted",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "unrestricted"
                ]
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "limited",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "limited"
                ]
              },
              "allowed_hosts": {
                "type": "array",
                "maxItems": 16,
                "description": "允许注入凭据的目标 host，最多 16 个；支持 IPv4、hostname 或 *.example.com 通配形式，不得包含协议、端口或路径。",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "type",
              "allowed_hosts"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedVaultInjectionLocationInput": {
        "type": "object",
        "properties": {
          "header": {
            "type": "boolean",
            "default": true,
            "description": "是否允许注入到请求头；省略时为 true。"
          },
          "body": {
            "type": "boolean",
            "enum": [
              false
            ],
            "default": false,
            "description": "当前不支持请求体注入，只能为 false；省略时为 false。"
          }
        },
        "additionalProperties": false
      },
      "ManagedVaultInjectionLocationResponse": {
        "type": "object",
        "properties": {
          "header": {
            "type": "boolean"
          },
          "body": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        },
        "required": [
          "header",
          "body"
        ],
        "additionalProperties": false
      },
      "ManagedTokenEndpointAuthCreate": {
        "oneOf": [
          {
            "title": "none",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "none"
                ]
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "client_secret",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "client_secret_basic",
                  "client_secret_post"
                ]
              },
              "client_secret": {
                "type": "string",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "required": [
              "type",
              "client_secret"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedTokenEndpointAuthUpdate": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "client_secret_basic",
              "client_secret_post"
            ],
            "description": "必须与已有 Token Endpoint 认证类型一致。"
          },
          "client_secret": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "writeOnly": true,
            "description": "轮换 Client Secret；null 或省略时保留现有 secret。"
          }
        },
        "required": [
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedOAuthRefreshCreate": {
        "type": "object",
        "properties": {
          "token_endpoint": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "description": "HTTPS URL；不得包含凭据或 fragment。"
          },
          "client_id": {
            "type": "string",
            "minLength": 1,
            "description": "OAuth Client ID。"
          },
          "scope": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "default": null,
            "description": "可选 OAuth scope；省略或传 null 时不设置。"
          },
          "resource": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "default": null,
            "description": "可选 OAuth resource 参数；省略或传 null 时不设置，创建后不可修改。"
          },
          "refresh_token": {
            "type": "string",
            "minLength": 1,
            "writeOnly": true,
            "description": "用于刷新访问令牌的非空 secret，不会在响应中返回。"
          },
          "token_endpoint_auth": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedTokenEndpointAuthCreate"
              }
            ],
            "description": "Token Endpoint 认证方式。"
          }
        },
        "required": [
          "token_endpoint",
          "client_id",
          "refresh_token",
          "token_endpoint_auth"
        ],
        "additionalProperties": false
      },
      "ManagedOAuthRefreshUpdate": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "description": "替换 scope；null 表示清空，省略时保持不变。"
          },
          "refresh_token": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "writeOnly": true,
            "description": "轮换 refresh token；null 或省略时保留现有 secret。"
          },
          "token_endpoint_auth": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedTokenEndpointAuthUpdate"
              }
            ],
            "description": "更新 Token Endpoint 认证 secret；结构字段不可更改。"
          }
        },
        "additionalProperties": false
      },
      "ManagedOAuthRefreshResponse": {
        "type": "object",
        "properties": {
          "token_endpoint": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "description": "HTTPS URL；不得包含凭据或 fragment。"
          },
          "client_id": {
            "type": "string"
          },
          "token_endpoint_auth": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "none",
                  "client_secret_basic",
                  "client_secret_post"
                ]
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          "scope": {
            "type": "string",
            "nullable": true
          },
          "resource": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "token_endpoint",
          "client_id",
          "token_endpoint_auth",
          "scope",
          "resource"
        ],
        "additionalProperties": false
      },
      "ManagedCredentialAuthCreate": {
        "oneOf": [
          {
            "title": "mcp_oauth",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "mcp_oauth"
                ]
              },
              "mcp_server_url": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://",
                "maxLength": 2048,
                "description": "公开 HTTPS Streamable HTTP URL；不得包含凭据、fragment、空 query 或旧式 SSE 路径。"
              },
              "access_token": {
                "type": "string",
                "minLength": 1,
                "writeOnly": true
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "refresh": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedOAuthRefreshCreate"
                  }
                ],
                "nullable": true
              }
            },
            "required": [
              "type",
              "mcp_server_url",
              "access_token"
            ],
            "additionalProperties": false
          },
          {
            "title": "static_bearer",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "static_bearer"
                ]
              },
              "mcp_server_url": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://",
                "maxLength": 2048,
                "description": "公开 HTTPS Streamable HTTP URL；不得包含凭据、fragment、空 query 或旧式 SSE 路径。"
              },
              "token": {
                "type": "string",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "required": [
              "type",
              "mcp_server_url",
              "token"
            ],
            "additionalProperties": false
          },
          {
            "title": "oauth",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "oauth"
                ]
              },
              "host": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://[^/?#]+/?$",
                "description": "HTTPS origin；不得包含路径、query、fragment 或凭据。"
              },
              "access_token": {
                "type": "string",
                "minLength": 1,
                "writeOnly": true
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "refresh": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedOAuthRefreshCreate"
                  }
                ],
                "nullable": true
              }
            },
            "required": [
              "type",
              "host",
              "access_token"
            ],
            "additionalProperties": false
          },
          {
            "title": "bearer",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "bearer"
                ]
              },
              "host": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://[^/?#]+/?$",
                "description": "HTTPS origin；不得包含路径、query、fragment 或凭据。"
              },
              "token": {
                "type": "string",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "required": [
              "type",
              "host",
              "token"
            ],
            "additionalProperties": false
          },
          {
            "title": "environment_variable",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "environment_variable"
                ]
              },
              "secret_name": {
                "type": "string",
                "minLength": 1
              },
              "secret_value": {
                "type": "string",
                "minLength": 1,
                "writeOnly": true
              },
              "networking": {
                "$ref": "#/components/schemas/ManagedVaultNetworking"
              },
              "injection_location": {
                "$ref": "#/components/schemas/ManagedVaultInjectionLocationInput"
              }
            },
            "required": [
              "type",
              "secret_name",
              "secret_value",
              "networking"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedCredentialAuthUpdate": {
        "oneOf": [
          {
            "title": "mcp_oauth",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "mcp_oauth"
                ]
              },
              "access_token": {
                "type": "string",
                "nullable": true,
                "minLength": 1,
                "writeOnly": true
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "refresh": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedOAuthRefreshUpdate"
                  }
                ],
                "nullable": true
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "static_bearer",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "static_bearer"
                ]
              },
              "token": {
                "type": "string",
                "nullable": true,
                "minLength": 1,
                "writeOnly": true
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "oauth",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "oauth"
                ]
              },
              "access_token": {
                "type": "string",
                "nullable": true,
                "minLength": 1,
                "writeOnly": true
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "refresh": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedOAuthRefreshUpdate"
                  }
                ],
                "nullable": true
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "bearer",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "bearer"
                ]
              },
              "token": {
                "type": "string",
                "nullable": true,
                "minLength": 1,
                "writeOnly": true
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "environment_variable",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "environment_variable"
                ]
              },
              "secret_value": {
                "type": "string",
                "nullable": true,
                "minLength": 1,
                "writeOnly": true
              },
              "networking": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedVaultNetworking"
                  }
                ],
                "nullable": true
              },
              "injection_location": {
                "$ref": "#/components/schemas/ManagedVaultInjectionLocationInput"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedCredentialAuthResponse": {
        "oneOf": [
          {
            "title": "mcp_oauth",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "mcp_oauth"
                ]
              },
              "mcp_server_url": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://",
                "maxLength": 2048,
                "nullable": true,
                "description": "公开 HTTPS Streamable HTTP URL；不得包含凭据、fragment、空 query 或旧式 SSE 路径。"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "refresh": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedOAuthRefreshResponse"
                  }
                ],
                "nullable": true
              }
            },
            "required": [
              "type",
              "mcp_server_url",
              "expires_at",
              "refresh"
            ],
            "additionalProperties": false
          },
          {
            "title": "static_bearer",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "static_bearer"
                ]
              },
              "mcp_server_url": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://",
                "maxLength": 2048,
                "nullable": true,
                "description": "公开 HTTPS Streamable HTTP URL；不得包含凭据、fragment、空 query 或旧式 SSE 路径。"
              }
            },
            "required": [
              "type",
              "mcp_server_url"
            ],
            "additionalProperties": false
          },
          {
            "title": "oauth",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "oauth"
                ]
              },
              "host": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://[^/?#]+/?$",
                "nullable": true,
                "description": "HTTPS origin；不得包含路径、query、fragment 或凭据。"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "refresh": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedOAuthRefreshResponse"
                  }
                ],
                "nullable": true
              }
            },
            "required": [
              "type",
              "host",
              "expires_at",
              "refresh"
            ],
            "additionalProperties": false
          },
          {
            "title": "bearer",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "bearer"
                ]
              },
              "host": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://[^/?#]+/?$",
                "nullable": true,
                "description": "HTTPS origin；不得包含路径、query、fragment 或凭据。"
              }
            },
            "required": [
              "type",
              "host"
            ],
            "additionalProperties": false
          },
          {
            "title": "environment_variable",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "environment_variable"
                ]
              },
              "secret_name": {
                "type": "string",
                "nullable": true
              },
              "networking": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedVaultNetworking"
                  }
                ],
                "nullable": true
              },
              "injection_location": {
                "$ref": "#/components/schemas/ManagedVaultInjectionLocationResponse"
              }
            },
            "required": [
              "type",
              "secret_name",
              "networking",
              "injection_location"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedCredential": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "vault_credential"
            ]
          },
          "id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "vault_id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "auth": {
            "$ref": "#/components/schemas/ManagedCredentialAuthResponse"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          },
          "archived_at": {
            "type": "string",
            "nullable": true,
            "description": "归档时间。"
          }
        },
        "required": [
          "type",
          "id",
          "display_name",
          "vault_id",
          "metadata",
          "auth",
          "created_at",
          "updated_at",
          "archived_at"
        ],
        "additionalProperties": false
      },
      "ManagedCredentialCreateRequest": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "maxLength": 255,
            "default": "",
            "description": "Credential 显示名称；省略时为空字符串，最长 255 个字符。"
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedMetadata"
              }
            ],
            "description": "可选元数据；省略时为空。"
          },
          "auth": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedCredentialAuthCreate"
              }
            ],
            "description": "凭据类型及 secret。secret 字段仅写入，不会在响应中返回。"
          }
        },
        "required": [
          "auth"
        ]
      },
      "ManagedCredentialUpdateRequest": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "maxLength": 255,
            "description": "替换显示名称；null 表示清为空字符串，省略时保持不变。"
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedMetadataPatch"
              }
            ],
            "description": "元数据补丁；整个字段为 null 时清空，省略时保持不变。"
          },
          "auth": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedCredentialAuthUpdate"
              }
            ],
            "description": "轮换 secret 或可变认证参数；auth type、host、mcp_server_url、secret_name、token_endpoint、client_id 与 resource 均不可修改。"
          }
        }
      },
      "ManagedCapturedHttpResponse": {
        "type": "object",
        "properties": {
          "status_code": {
            "type": "integer"
          },
          "content_type": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "body_truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "status_code",
          "content_type",
          "body",
          "body_truncated"
        ],
        "additionalProperties": false
      },
      "ManagedCredentialValidation": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "vault_credential_validation"
            ]
          },
          "credential_id": {
            "type": "string"
          },
          "vault_id": {
            "type": "string"
          },
          "validated_at": {
            "type": "string",
            "format": "date-time",
            "description": "验证时间。"
          },
          "has_refresh_token": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "valid",
              "invalid",
              "unknown"
            ]
          },
          "mcp_probe": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "initialize"
                ]
              },
              "http_response": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedCapturedHttpResponse"
                  }
                ],
                "nullable": true
              }
            },
            "required": [
              "method",
              "http_response"
            ],
            "additionalProperties": false
          },
          "refresh": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "succeeded",
                  "failed",
                  "connect_error",
                  "no_refresh_token"
                ]
              },
              "http_response": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ManagedCapturedHttpResponse"
                  }
                ],
                "nullable": true
              }
            },
            "required": [
              "status",
              "http_response"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "credential_id",
          "vault_id",
          "validated_at",
          "has_refresh_token",
          "status",
          "mcp_probe",
          "refresh"
        ],
        "additionalProperties": false
      },
      "ManagedSkill": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ManagedSkillCurrent"
          },
          {
            "$ref": "#/components/schemas/ManagedSkillLegacy"
          }
        ]
      },
      "ManagedSkillVersion": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ManagedSkillVersionCurrent"
          },
          {
            "$ref": "#/components/schemas/ManagedSkillVersionLegacy"
          }
        ]
      },
      "ManagedScheduleInput": {
        "type": "object",
        "description": "Cron 调度配置。表达式必须是合法的五段 cron，且相邻执行时间需满足平台配置的最小间隔；当前仅支持 Asia/Shanghai 时区。",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cron"
            ],
            "description": "固定为 cron。"
          },
          "expression": {
            "type": "string",
            "minLength": 1,
            "description": "五段 cron 表达式；trim 后不能为空，必须存在未来触发时间，且相邻触发间隔不得小于平台配置值。",
            "example": "0 9 * * 1-5"
          },
          "timezone": {
            "type": "string",
            "nullable": true,
            "enum": [
              "Asia/Shanghai"
            ],
            "default": "Asia/Shanghai",
            "description": "当前仅支持 Asia/Shanghai；省略或传 null 时使用该值。"
          }
        },
        "required": [
          "type",
          "expression"
        ]
      },
      "ManagedScheduleResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cron"
            ]
          },
          "expression": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "enum": [
              "Asia/Shanghai"
            ]
          },
          "last_run_at": {
            "type": "string",
            "nullable": true,
            "description": "上次运行时间。"
          },
          "upcoming_runs_at": {
            "type": "array",
            "description": "即将触发的计划时间。下次运行看数组第一项；manual-only 时整个 schedule 为 null。",
            "items": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "required": [
          "type",
          "expression",
          "timezone",
          "last_run_at",
          "upcoming_runs_at"
        ],
        "additionalProperties": false
      },
      "ManagedDeploymentAgent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "agent"
            ]
          },
          "id": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "type",
          "id",
          "version"
        ],
        "additionalProperties": false
      },
      "ManagedDeploymentInitialEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ManagedInitialUserMessageEventInput"
          }
        ],
        "description": "Deployment 每次运行时注入的初始用户消息。仅支持 `user.message`，内容块仅支持文本和图片（base64、url 或 file 来源），不支持 document；图片要求生效模型支持图片输入。"
      },
      "ManagedDeploymentPausedReason": {
        "oneOf": [
          {
            "title": "manual",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "manual"
                ]
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "title": "error",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "error"
                ]
              },
              "error": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "environment_archived_error",
                      "environment_not_found_error",
                      "file_not_found_error",
                      "memory_store_archived_error",
                      "vault_archived_error",
                      "vault_not_found_error"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "error"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ManagedDeployment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "deployment"
            ]
          },
          "name": {
            "type": "string"
          },
          "agent": {
            "$ref": "#/components/schemas/ManagedDeploymentAgent"
          },
          "environment_id": {
            "type": "string",
            "description": "Deployment 绑定的 Environment ID。旧数据缺失该字段时可能返回内部兼容值 `env_default`。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "用途说明。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedDeploymentResourceInput"
            }
          },
          "schedule": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedScheduleResponse"
              }
            ],
            "nullable": true
          },
          "initial_events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedDeploymentInitialEvent"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused"
            ]
          },
          "paused_reason": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedDeploymentPausedReason"
              }
            ],
            "nullable": true,
            "description": "暂停原因。手动暂停返回 `manual`；因资源失效自动暂停时返回对应错误类型。"
          },
          "vault_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "archived_at": {
            "type": "string",
            "nullable": true,
            "description": "归档时间。"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "agent",
          "environment_id",
          "description",
          "metadata",
          "resources",
          "schedule",
          "initial_events",
          "status",
          "paused_reason",
          "vault_ids",
          "archived_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ManagedDeploymentCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Deployment 名称；trim 后不能为空。"
          },
          "agent": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedSessionAgentInput"
              }
            ],
            "description": "要固定的 Agent 版本或带覆盖的 Agent 引用；创建后每次运行都使用该固定配置。"
          },
          "environment_id": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^env_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
            "description": "必填的 Environment ID。Environment 必须存在、未归档，并归属于 Agent 所有者。",
            "example": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
          },
          "schedule": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedScheduleInput"
              }
            ],
            "nullable": true,
            "default": null,
            "description": "Cron 调度；省略或传 null 时为仅手动运行。"
          },
          "initial_events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "description": "每次运行时注入的 1–50 条 user.message；内容仅允许文本或图片（base64、url 或 file 来源），图片要求生效模型支持图片输入。",
            "items": {
              "$ref": "#/components/schemas/ManagedDeploymentInitialEvent"
            }
          },
          "description": {
            "type": "string",
            "nullable": true,
            "default": null,
            "description": "用途说明；省略或传 null 时不设置。"
          },
          "metadata": {
            "$ref": "#/components/schemas/ManagedMetadata"
          },
          "vault_ids": {
            "type": "array",
            "maxItems": 20,
            "default": [],
            "description": "挂载到每次运行 Session 的 Vault ID；省略时为空，最多 20 个且不得重复。",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "resources": {
            "type": "array",
            "nullable": true,
            "default": [],
            "description": "挂载到每次运行 Session 的资源；省略或传 null 时为空。默认平台上限为 500 个 file 与 8 个 memory_store，实际上限可调整；文件 mount_path 不得重叠。",
            "items": {
              "$ref": "#/components/schemas/ManagedDeploymentResourceInput"
            }
          }
        },
        "required": [
          "name",
          "agent",
          "environment_id",
          "initial_events"
        ]
      },
      "ManagedDeploymentUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "替换名称；trim 后不能为空，省略时保持不变。"
          },
          "agent": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedSessionAgentInput"
              }
            ],
            "description": "重新固定同一个 Agent 的版本或覆盖配置；不得切换到其他 Agent。"
          },
          "environment_id": {
            "type": "string",
            "nullable": true,
            "maxLength": 64,
            "pattern": "^env_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
            "description": "重新绑定 Environment。字符串值必须指向 Agent 所有者名下未归档的 Environment；传 `null` 会保留原值。"
          },
          "schedule": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedScheduleInput"
              }
            ],
            "nullable": true,
            "description": "替换调度；null 表示改为仅手动运行，省略时保持不变。"
          },
          "initial_events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "description": "整体替换每次运行的初始消息；必须含 1–50 条 user.message。",
            "items": {
              "$ref": "#/components/schemas/ManagedDeploymentInitialEvent"
            }
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "替换用途说明；非字符串值（包括 null）会清空，省略时保持不变。"
          },
          "metadata": {
            "type": "object",
            "nullable": true,
            "maxProperties": 16,
            "description": "整体替换 metadata；null 表示清空，省略时保持不变。键名不超过 64 字符，值为不超过 512 字符的字符串。",
            "additionalProperties": {
              "type": "string"
            }
          },
          "vault_ids": {
            "type": "array",
            "maxItems": 20,
            "uniqueItems": true,
            "description": "整体替换 Vault ID；省略时保持不变。",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "resources": {
            "type": "array",
            "nullable": true,
            "description": "整体替换资源；null 表示清空，省略时保持不变。",
            "items": {
              "$ref": "#/components/schemas/ManagedDeploymentResourceInput"
            }
          }
        },
        "additionalProperties": false,
        "minProperties": 1
      },
      "ManagedDeploymentRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "deployment_run"
            ]
          },
          "deployment_id": {
            "type": "string"
          },
          "trigger_context": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "schedule",
                  "manual"
                ]
              },
              "scheduled_at": {
                "type": "string",
                "format": "date-time",
                "description": "计划触发时间；仅定时触发的 Run 返回。"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          "session_id": {
            "type": "string",
            "nullable": true,
            "description": "该次运行创建的会话 ID。刚返回时可能为 null，通常数秒后填上。"
          },
          "error": {
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "file_not_found_error",
                      "environment_archived_error",
                      "environment_not_found_error",
                      "memory_store_archived_error",
                      "vault_archived_error",
                      "vault_not_found_error",
                      "session_rate_limited_error",
                      "session_creation_rejected_error",
                      "customer_rate_limited",
                      "unknown_error"
                    ]
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "message"
                ],
                "additionalProperties": false
              }
            ],
            "nullable": true
          },
          "agent": {
            "$ref": "#/components/schemas/ManagedDeploymentAgent"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          }
        },
        "required": [
          "id",
          "type",
          "deployment_id",
          "trigger_context",
          "session_id",
          "error",
          "agent",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ManagedAgentPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedAgent"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedEnvironmentPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedEnvironment"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedSessionPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSession"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          },
          "prev_page": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedEventPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedPersistedEvent"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryStorePage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedMemoryStore"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedMemoryListItem"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryVersionPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedMemoryVersion"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedVaultPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedVault"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedCredentialPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedCredential"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedSkillPage": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ManagedSkillPageCurrent"
          },
          {
            "$ref": "#/components/schemas/ManagedSkillPageLegacy"
          }
        ]
      },
      "ManagedSkillVersionPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSkillVersion"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedDeploymentPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedDeployment"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedDeploymentRunPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedDeploymentRun"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedSessionResourcePage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSessionResourceResponse"
            }
          },
          "next_page": {
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "ManagedFilePage": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ManagedFilePageCurrent"
          },
          {
            "$ref": "#/components/schemas/ManagedFilePageLegacy"
          }
        ]
      },
      "ManagedEnvironmentDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "environment_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedSessionDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "session_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedSessionResourceDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "session_resource_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedFileDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "file_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryStoreDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "memory_store_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "memory_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedVaultDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "vault_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedCredentialDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "vault_credential_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedSkillDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "skill_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ManagedSkillVersionDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "skill_version_deleted"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "ForwardAgentErrorResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "authentication_error",
                  "permission_error",
                  "invalid_request_error",
                  "not_found_error",
                  "conflict_error",
                  "rate_limit_error",
                  "api_error"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "type",
              "message",
              "details"
            ],
            "additionalProperties": false
          },
          "request_id": {
            "type": "string",
            "example": "req_xxx"
          }
        },
        "required": [
          "type",
          "error",
          "request_id"
        ],
        "additionalProperties": false
      },
      "ForwardChannelAgentInput": {
        "oneOf": [
          {
            "type": "string",
            "minLength": 1,
            "description": "Agent ID；Create 会解析并固定当前版本。",
            "example": "agent_01911111-1111-7111-8111-111111111111"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "agent"
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "已存在且可访问的 Managed Agent ID。",
                "example": "agent_01911111-1111-7111-8111-111111111111"
              },
              "version": {
                "type": "integer",
                "minimum": 1,
                "description": "可选；省略时固定当前 Agent version。",
                "example": 3
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ForwardChannelAgent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "agent"
            ]
          },
          "id": {
            "type": "string",
            "example": "agent_xxx"
          },
          "version": {
            "type": "integer",
            "example": 3
          }
        },
        "required": [
          "type",
          "id",
          "version"
        ],
        "additionalProperties": false
      },
      "ForwardChannelTemplateInput": {
        "type": "object",
        "properties": {
          "agent": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ForwardChannelAgentInput"
              }
            ],
            "description": "Channel 使用的 Managed Agent；创建时固定版本。"
          },
          "environment_id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^env_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
            "description": "创建 Session 时使用的有效 Environment ID。",
            "example": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
          },
          "vault_ids": {
            "type": "array",
            "maxItems": 20,
            "uniqueItems": true,
            "default": [],
            "items": {
              "type": "string"
            },
            "description": "每个 Channel Session 挂载的 Vault ID；省略时为空，最多 20 个。"
          },
          "file_ids": {
            "type": "array",
            "maxItems": 20,
            "default": [],
            "items": {
              "type": "string"
            },
            "description": "创建 Channel 时复制到模板中的 File ID；省略时为空，最多 20 个。"
          },
          "memory_stores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForwardChannelMemoryStore"
            },
            "maxItems": 8,
            "description": "共享 Memory Store；ID 不可重复，与自动创建的私有 Store 合计最多挂载 8 个。",
            "default": []
          }
        },
        "required": [
          "agent",
          "environment_id"
        ],
        "additionalProperties": false,
        "description": "创建 Managed Session 的 inline 固定快照；不是可独立管理的 Template 实体，不接受 MCP、Tools 或 Skills override。"
      },
      "ForwardChannelTemplate": {
        "type": "object",
        "properties": {
          "agent": {
            "$ref": "#/components/schemas/ForwardChannelAgent"
          },
          "environment_id": {
            "type": "string",
            "example": "env_xxx"
          },
          "vault_ids": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string"
            },
            "example": [
              "vault_xxx"
            ]
          },
          "file_ids": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string"
            },
            "example": [
              "file_xxx"
            ]
          },
          "memory_stores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForwardChannelMemoryStore"
            },
            "maxItems": 8,
            "description": "共享 Memory Store；ID 不可重复，与自动创建的私有 Store 合计最多挂载 8 个。"
          }
        },
        "required": [
          "agent",
          "environment_id",
          "vault_ids",
          "file_ids",
          "memory_stores"
        ],
        "additionalProperties": false
      },
      "ForwardFeishuCredentials": {
        "type": "object",
        "properties": {
          "app_id": {
            "type": "string",
            "minLength": 1,
            "description": "飞书自建应用的 App ID。",
            "example": "cli_xxx"
          },
          "app_secret": {
            "type": "string",
            "minLength": 1,
            "writeOnly": true,
            "description": "飞书自建应用的 App Secret；仅写入，不在响应中返回。",
            "example": "<app-secret>"
          }
        },
        "required": [
          "app_id",
          "app_secret"
        ],
        "additionalProperties": false
      },
      "ForwardChannelResponseOptionsInput": {
        "type": "object",
        "properties": {
          "include_tool_calls": {
            "type": "boolean",
            "default": false,
            "description": "执行中展示工具调用进度；不展示工具原始结果或 Thinking，终态移除过程面板。"
          },
          "include_process": {
            "type": "boolean",
            "default": false,
            "description": "执行中展示公开过程正文；不展示 Thinking，最终回复仍只使用当轮最后一条非空 agent.message。"
          },
          "card_output": {
            "type": "boolean",
            "default": true,
            "description": "飞书使用卡片输出；false 只发送最终普通文本，不展示过程或工具面板。"
          }
        },
        "additionalProperties": false
      },
      "ForwardChannelResponseOptions": {
        "type": "object",
        "properties": {
          "include_tool_calls": {
            "type": "boolean",
            "default": false,
            "description": "执行中展示工具调用进度；不展示工具原始结果或 Thinking，终态移除过程面板。"
          },
          "include_process": {
            "type": "boolean",
            "default": false,
            "description": "执行中展示公开过程正文；不展示 Thinking，最终回复仍只使用当轮最后一条非空 agent.message。"
          },
          "card_output": {
            "type": "boolean",
            "default": true,
            "description": "飞书使用卡片输出；false 只发送最终普通文本，不展示过程或工具面板。"
          }
        },
        "additionalProperties": false,
        "required": [
          "include_tool_calls",
          "include_process",
          "card_output"
        ]
      },
      "ForwardChannelConfigInput": {
        "type": "object",
        "properties": {
          "credentials": {
            "$ref": "#/components/schemas/ForwardFeishuCredentials"
          },
          "response_options": {
            "$ref": "#/components/schemas/ForwardChannelResponseOptionsInput"
          },
          "private_memory_store_enabled": {
            "type": "boolean",
            "default": false,
            "description": "是否为渠道私聊用户或群自动创建并挂载私有 Memory Store；创建后不能更新。"
          },
          "group_prompt_template": {
            "type": "string",
            "nullable": true,
            "maxLength": 4096,
            "description": "群聊 Prompt 模板；{{context_note}} 与 {{messages}} 必须各出现一次。null 使用默认模板；只影响新准备的群聊消息。"
          }
        },
        "additionalProperties": false,
        "required": [
          "credentials"
        ]
      },
      "ForwardChannelConfig": {
        "type": "object",
        "properties": {
          "response_options": {
            "$ref": "#/components/schemas/ForwardChannelResponseOptions"
          },
          "private_memory_store_enabled": {
            "type": "boolean"
          },
          "group_prompt_template": {
            "type": "string",
            "nullable": true,
            "maxLength": 4096,
            "description": "群聊 Prompt 模板；{{context_note}} 与 {{messages}} 必须各出现一次。null 使用默认模板；只影响新准备的群聊消息。"
          }
        },
        "additionalProperties": false,
        "required": [
          "response_options",
          "private_memory_store_enabled",
          "group_prompt_template"
        ]
      },
      "ForwardChannelCreateRequest": {
        "type": "object",
        "properties": {
          "channel_type": {
            "type": "string",
            "enum": [
              "feishu"
            ],
            "description": "当前公开接入使用 feishu；不要提前使用尚未公开开放的渠道类型。"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "必填；trim 后长度为 1–128。",
            "example": "Support Feishu channel"
          },
          "template": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ForwardChannelTemplateInput"
              }
            ],
            "description": "收到消息后创建 Managed Session 所用的固定模板。"
          },
          "channel_config": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ForwardChannelConfigInput"
              }
            ],
            "description": "飞书凭据、输出选项、私有记忆和群聊 Prompt 模板。"
          }
        },
        "required": [
          "channel_type",
          "name",
          "template",
          "channel_config"
        ],
        "additionalProperties": false,
        "example": {
          "channel_type": "feishu",
          "name": "Support Feishu channel",
          "template": {
            "agent": {
              "type": "agent",
              "id": "agent_01911111-1111-7111-8111-111111111111",
              "version": 3
            },
            "environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
          },
          "channel_config": {
            "credentials": {
              "app_id": "cli_xxx",
              "app_secret": "<app-secret>"
            },
            "response_options": {
              "include_tool_calls": false,
              "include_process": false,
              "card_output": true
            },
            "private_memory_store_enabled": false
          }
        }
      },
      "ForwardChannel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "channel_xxx"
          },
          "type": {
            "type": "string",
            "enum": [
              "channel"
            ]
          },
          "channel_type": {
            "type": "string",
            "enum": [
              "feishu"
            ],
            "description": "当前对外文档开放飞书；微信、企微等渠道近期支持。"
          },
          "name": {
            "type": "string",
            "example": "Support Feishu channel"
          },
          "template": {
            "$ref": "#/components/schemas/ForwardChannelTemplate"
          },
          "enabled": {
            "type": "boolean",
            "description": "新建 Channel 固定为 true。",
            "example": true
          },
          "binding_status": {
            "type": "string",
            "description": "Channel 绑定状态。",
            "example": "bound"
          },
          "connection_status": {
            "type": "string",
            "description": "由取得 listener lease 的 Channel worker 异步推进。",
            "example": "connected"
          },
          "channel_config": {
            "$ref": "#/components/schemas/ForwardChannelConfig"
          },
          "last_error": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "example": null
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          }
        },
        "required": [
          "id",
          "type",
          "channel_type",
          "name",
          "template",
          "enabled",
          "binding_status",
          "connection_status",
          "channel_config",
          "last_error",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "example": {
          "id": "channel_xxx",
          "type": "channel",
          "channel_type": "feishu",
          "name": "Support Feishu channel",
          "template": {
            "agent": {
              "type": "agent",
              "id": "agent_xxx",
              "version": 3
            },
            "environment_id": "env_xxx",
            "vault_ids": [
              "vault_xxx"
            ],
            "file_ids": [
              "file_xxx"
            ],
            "memory_stores": []
          },
          "enabled": true,
          "binding_status": "bound",
          "connection_status": "connected",
          "channel_config": {
            "response_options": {
              "include_tool_calls": false,
              "include_process": false,
              "card_output": true
            },
            "group_prompt_template": null,
            "private_memory_store_enabled": false
          },
          "last_error": null,
          "created_at": "2026-09-01T00:00:00.000Z",
          "updated_at": "2026-09-01T00:00:00.000Z"
        }
      },
      "ForwardChannelPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForwardChannel"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true,
            "description": "下一页 opaque cursor；没有下一页时为 null。"
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false,
        "example": {
          "data": [
            {
              "id": "channel_xxx",
              "type": "channel",
              "channel_type": "feishu",
              "name": "Support Feishu channel",
              "template": {
                "agent": {
                  "type": "agent",
                  "id": "agent_xxx",
                  "version": 3
                },
                "environment_id": "env_xxx",
                "vault_ids": [
                  "vault_xxx"
                ],
                "file_ids": [
                  "file_xxx"
                ],
                "memory_stores": []
              },
              "enabled": true,
              "binding_status": "bound",
              "connection_status": "connected",
              "channel_config": {
                "response_options": {
                  "include_tool_calls": false,
                  "include_process": false,
                  "card_output": true
                },
                "group_prompt_template": null,
                "private_memory_store_enabled": false
              },
              "last_error": null,
              "created_at": "2026-09-01T00:00:00.000Z",
              "updated_at": "2026-09-01T00:00:00.000Z"
            }
          ],
          "next_page": null
        }
      },
      "ForwardChannelDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "channel_xxx"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "id",
          "deleted"
        ],
        "additionalProperties": false,
        "example": {
          "id": "channel_xxx",
          "deleted": true
        }
      },
      "ManagedMultiagentEntry": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "agent"
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1
              },
              "version": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false,
            "title": "已有 Agent"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "self"
                ]
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false,
            "title": "自身副本"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "advisor"
                ]
              },
              "model": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "type",
              "model"
            ],
            "additionalProperties": false,
            "title": "顾问咨询"
          }
        ]
      },
      "ManagedMultiagent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "coordinator"
            ]
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedMultiagentEntry"
            },
            "description": "按 Agent ID 计最多 20 个唯一成员；Advisor 至多一个；成员不得携带自己的 Agent 列表。"
          }
        },
        "required": [
          "type",
          "agents"
        ],
        "additionalProperties": false,
        "nullable": true,
        "description": "可选，Multi Agent 主配置。null 清空，创建/更新时固定成员版本；Session override 不支持改 Agent 列表。"
      },
      "ManagedSkillLegacy": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "skill"
            ]
          },
          "display_title": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "enum": [
              "custom",
              "zai"
            ]
          },
          "latest_version": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间。"
          }
        },
        "required": [
          "id",
          "type",
          "display_title",
          "source",
          "latest_version",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "title": "2026-05-26 兼容形态"
      },
      "ManagedSkillVersionLegacy": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "skill_version"
            ]
          },
          "skill_id": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "旧协议：SKILL.md 名称；新协议 name 是目录 slug。"
          },
          "description": {
            "type": "string"
          },
          "directory": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          }
        },
        "required": [
          "id",
          "type",
          "skill_id",
          "version",
          "name",
          "description",
          "directory",
          "created_at"
        ],
        "additionalProperties": false,
        "title": "2026-05-26 兼容形态"
      },
      "ManagedSkillPageLegacy": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSkill"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "next_page",
          "has_more"
        ],
        "additionalProperties": false,
        "title": "2026-05-26 兼容形态"
      },
      "ManagedFilePageLegacy": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedFile"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "first_id": {
            "type": "string"
          },
          "last_id": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "additionalProperties": false,
        "title": "2026-05-26 兼容形态"
      },
      "ManagedSkillCurrent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "skill"
            ]
          },
          "display_name": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "custom",
                  "zai"
                ]
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          "latest_version_id": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "type",
          "display_name",
          "source",
          "latest_version_id",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "title": "2026-09-22 Skill"
      },
      "ManagedSkillVersionCurrent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "custom 使用 skver_版本串；内置使用对应版本 ID"
          },
          "type": {
            "type": "string",
            "enum": [
              "skill_version"
            ]
          },
          "skill_id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "固定目录 slug"
          },
          "description": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "type",
          "skill_id",
          "name",
          "description",
          "created_at"
        ],
        "additionalProperties": false,
        "title": "2026-09-22 SkillVersion"
      },
      "ManagedSkillPageCurrent": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSkillCurrent"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false,
        "title": "2026-09-22 Skill 列表"
      },
      "ManagedFilePageCurrent": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedFile"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false,
        "title": "2026-09-22 Files 列表"
      },
      "ManagedThreadAgent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "agent"
            ]
          },
          "name": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ManagedModelResponse"
          },
          "system": {
            "type": "string",
            "nullable": true,
            "description": "解析后的系统提示词。"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Agent 描述。"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentToolsetResponse"
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSkillReference"
            }
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedMcpServer"
            }
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "model",
          "system",
          "description",
          "tools",
          "skills",
          "mcp_servers",
          "version"
        ],
        "additionalProperties": false
      },
      "ManagedThread": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^sthr_"
          },
          "type": {
            "type": "string",
            "enum": [
              "session_thread"
            ]
          },
          "session_id": {
            "type": "string"
          },
          "parent_thread_id": {
            "type": "string",
            "nullable": true
          },
          "agent": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ManagedThreadAgent"
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "advisor"
                    ]
                  },
                  "model": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "model"
                ],
                "additionalProperties": false,
                "title": "顾问线程"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "idle",
              "rescheduling",
              "terminated"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "archived_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "workflow_run_id": {
            "type": "string",
            "nullable": true,
            "description": "新协议恒 null；旧协议省略，当前无 Workflow Run。"
          },
          "stats": {
            "type": "object",
            "properties": {
              "startup_seconds": {
                "type": "number"
              },
              "active_seconds": {
                "type": "number"
              },
              "duration_seconds": {
                "type": "number"
              }
            },
            "required": [
              "startup_seconds",
              "active_seconds",
              "duration_seconds"
            ],
            "additionalProperties": false,
            "nullable": true
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer"
              },
              "cache_read_input_tokens": {
                "type": "integer"
              },
              "active_seconds": {
                "type": "number"
              }
            },
            "required": [
              "input_tokens",
              "output_tokens",
              "cache_read_input_tokens",
              "active_seconds"
            ],
            "additionalProperties": false,
            "nullable": true
          }
        },
        "required": [
          "id",
          "type",
          "session_id",
          "parent_thread_id",
          "agent",
          "status",
          "created_at",
          "updated_at",
          "archived_at",
          "stats",
          "usage"
        ],
        "additionalProperties": false
      },
      "ManagedThreadPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedThread"
            }
          },
          "next_page": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_page"
        ],
        "additionalProperties": false
      },
      "ManagedRepositoryCheckout": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "branch"
                ]
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "required": [
              "type",
              "name"
            ],
            "additionalProperties": false,
            "title": "分支"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "commit"
                ]
              },
              "sha": {
                "type": "string",
                "minLength": 6,
                "pattern": "^[0-9a-fA-F]+$"
              }
            },
            "required": [
              "type",
              "sha"
            ],
            "additionalProperties": false,
            "title": "Commit"
          }
        ],
        "nullable": true
      },
      "ManagedGithubRepositoryInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "github_repository"
            ]
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "pattern": "^https://github.com/[^/]+/[^/]+$",
            "description": "不含 .git 后缀"
          },
          "authorization_token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "writeOnly": true
          },
          "mount_path": {
            "type": "string",
            "maxLength": 4096,
            "nullable": true,
            "description": "在 /workspace 下，默认 /workspace/仓库名"
          },
          "checkout": {
            "$ref": "#/components/schemas/ManagedRepositoryCheckout"
          }
        },
        "required": [
          "type",
          "url",
          "authorization_token"
        ],
        "additionalProperties": false
      },
      "ManagedGithubRepositoryResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "github_repository"
            ]
          },
          "url": {
            "type": "string"
          },
          "mount_path": {
            "type": "string"
          },
          "checkout": {
            "$ref": "#/components/schemas/ManagedRepositoryCheckout"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "type",
          "url",
          "mount_path",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ManagedEventsPage": {
        "$ref": "#/components/schemas/ManagedEventPage"
      },
      "ManagedRepositoryTokenRotation": {
        "type": "object",
        "properties": {
          "authorization_token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "writeOnly": true
          }
        },
        "required": [
          "authorization_token"
        ],
        "additionalProperties": false
      },
      "ForwardChannelMemoryStore": {
        "type": "object",
        "properties": {
          "memory_store_id": {
            "type": "string",
            "minLength": 1
          },
          "access": {
            "type": "string",
            "enum": [
              "read_only",
              "read_write"
            ],
            "default": "read_write"
          }
        },
        "additionalProperties": false,
        "required": [
          "memory_store_id"
        ]
      },
      "ForwardChannelPatchRequest": {
        "type": "object",
        "properties": {
          "channel_config": {
            "type": "object",
            "properties": {
              "group_prompt_template": {
                "type": "string",
                "nullable": true,
                "maxLength": 4096,
                "description": "群聊 Prompt 模板；{{context_note}} 与 {{messages}} 必须各出现一次。null 使用默认模板；只影响新准备的群聊消息。"
              }
            },
            "additionalProperties": false,
            "required": [
              "group_prompt_template"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "channel_config"
        ],
        "description": "仅修改群聊 Prompt 模板；不支持修改凭据、Agent、Environment、名称、回复选项或私有记忆开关。"
      },
      "ManagedUploadedFile": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "file"
            ]
          },
          "id": {
            "type": "string",
            "description": "File ID。",
            "example": "file_01911111-1111-7111-8111-111111111111"
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间。"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "downloadable": {
            "type": "boolean",
            "description": "上传文件为 false，不可再下载；写入 /mnt/session/outputs 后编目的会话产物为 true。",
            "enum": [
              false
            ],
            "example": false
          },
          "expires_at": {
            "type": "string",
            "nullable": true,
            "enum": [
              null
            ],
            "example": null,
            "description": "新协议固定为 null，不设自动过期时间；旧协议省略此字段。"
          }
        },
        "required": [
          "type",
          "id",
          "size_bytes",
          "created_at",
          "filename",
          "mime_type",
          "downloadable"
        ],
        "additionalProperties": false,
        "example": {
          "type": "file",
          "id": "file_01911111-1111-7111-8111-111111111111",
          "size_bytes": 1024,
          "created_at": "2026-10-15T08:00:00.000Z",
          "filename": "report.txt",
          "mime_type": "text/plain",
          "downloadable": false,
          "expires_at": null
        }
      },
      "ManagedImageBase64Source": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "base64"
            ],
            "description": "内联 Base64 图片。"
          },
          "media_type": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/png",
              "image/gif",
              "image/webp"
            ],
            "description": "图片 MIME 类型。"
          },
          "data": {
            "type": "string",
            "description": "标准 Base64 字符串；单张解码后不超过 50 MiB，且须满足像素与请求总量限制。"
          }
        },
        "required": [
          "type",
          "media_type",
          "data"
        ],
        "additionalProperties": false,
        "title": "base64"
      },
      "ManagedImageUrlSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "url"
            ]
          },
          "url": {
            "type": "string",
            "description": "可从平台访问的公网 HTTPS 图片地址；抓取受账号网络策略限制，建议优先使用 file_id。",
            "format": "uri"
          }
        },
        "required": [
          "type",
          "url"
        ],
        "additionalProperties": false,
        "title": "url"
      },
      "ManagedImageFileSource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "file"
            ]
          },
          "file_id": {
            "type": "string",
            "description": "通过 Files API 上传的、当前调用身份有权访问的图片文件 ID。"
          }
        },
        "required": [
          "type",
          "file_id"
        ],
        "additionalProperties": false,
        "title": "file"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "标准的 HTTP Bearer 认证方式，在 [API Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。"
      }
    }
  }
}
