{
  "openapi": "3.0.1",
  "info": {
    "title": "ZHIPU AI API",
    "description": "ZHIPU AI interface provides powerful AI capabilities, including chat conversations, tool calls, and video generation.",
    "license": {
      "name": "ZHIPU AI Developer Agreement and Policies",
      "url": "https://chat.z.ai/legal-agreement/terms-of-service"
    },
    "version": "1.0.0",
    "contact": {
      "name": "Z.AI Developer",
      "url": "https://chat.z.ai/legal-agreement/privacy-policy",
      "email": "user_feedback@z.ai"
    }
  },
  "tags": [
    {
      "name": "Chat API",
      "description": "Chat related endpoints"
    },
    {
      "name": "Embedding API",
      "description": "Text embedding endpoints"
    },
    {
      "name": "Audio API",
      "description": "Audio processing endpoints"
    },
    {
      "name": "Video API",
      "description": "Video generation endpoints"
    },
    {
      "name": "Image API",
      "description": "Image generation endpoints"
    },
    {
      "name": "Tool API",
      "description": "Tool invocation endpoints"
    },
    {
      "name": "Agent API",
      "description": "Agent endpoints"
    },
    {
      "name": "Assistant API",
      "description": "Assistant endpoints"
    },
    {
      "name": "File API",
      "description": "File management endpoints"
    },
    {
      "name": "Knowledge API",
      "description": "Knowledge base endpoints"
    },
    {
      "name": "QingLiu Agent API",
      "description": "QingLiu Agent API"
    },
    {
      "name": "Realtime API",
      "description": "Realtime endpoints"
    },
    {
      "name": "Batch API",
      "description": "Batch processing endpoints"
    }
  ],
  "servers": [
    {
      "url": "https://open.bigmodel.cn/api/",
      "description": "Open Platform Service"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/paas/v4/chat/completions": {
      "post": {
        "tags": [
          "Chat API"
        ],
        "summary": "Chat completion",
        "description": "Generate AI responses for chat conversations. Supports multiple application scenarios and provides intelligent dialogue capabilities.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/audio/customization": {
      "post": {
        "tags": [
          "Audio API"
        ],
        "summary": "Voice customization",
        "description": "Use advanced neural models for voice cloning and customization to create personalized voice models.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/AudioCustomizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioCustomizationResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/images/generations": {
      "post": {
        "tags": [
          "Image API"
        ],
        "summary": "Image generation",
        "description": "Generate high-quality images from text prompts using the CogView-3-Plus model. Supports multiple styles and sizes.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateImageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/embeddings": {
      "post": {
        "tags": [
          "Embedding API"
        ],
        "summary": "Text embedding",
        "description": "Convert text into high-dimensional vector representations using the GLM embedding model for semantic similarity and search. Supports multiple languages and models, compatible with the OpenAI Embedding API.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingCreateRequest"
              }
            }
          },
          "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": [
          "Knowledge API"
        ],
        "summary": "Text Reranking",
        "description": "Rerank is used for text reranking. It receives the user's query text and a list of candidate texts, uses a model to calculate the relevance scores between the candidate texts and the query, and returns the scores. It is suitable for scenarios such as intelligent question answering and information retrieval.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RerankRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RerankResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files": {
      "post": {
        "tags": [
          "File API"
        ],
        "summary": "Upload file",
        "description": "Upload files to the platform for batch, file extraction, agent or other AI tasks.Note: The \"Try it\" feature only supports uploading small files. For actual file size limits, please refer to the \"purpose\" section below.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/FileUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileObject"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "File API"
        ],
        "summary": "List files",
        "description": "Get a paginated list of uploaded files, with filtering by purpose and sorting options.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "after",
            "in": "query",
            "description": "Page cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "purpose",
            "in": "query",
            "description": "Filter files according to their purpose",
            "schema": {
              "type": "string",
              "enum": [
                "batch",
                "file-extract",
                "code-interpreter",
                "agent"
              ]
            },
            "required": true
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order",
            "schema": {
              "type": "string",
              "enum": [
                "created_at"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of files returned per page",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files/{file_id}": {
      "delete": {
        "tags": [
          "File API"
        ],
        "summary": "Delete file",
        "description": "Permanently delete the specified file and all associated data.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "description": "Unique file identifier",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDeletedResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/files/{file_id}/content": {
      "get": {
        "tags": [
          "File API"
        ],
        "summary": "Get file content",
        "description": "Get file content. Only supports files of type batch and file-extract.",
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the requested file, used to specify the file to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful. Returns file byte stream.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/videos/generations": {
      "post": {
        "tags": [
          "Video API"
        ],
        "summary": "Generate video",
        "description": "Generate video content from text or images. Supports multiple video generation methods, including text-to-video and image-to-video.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "CogVideoX-2",
                    "$ref": "#/components/schemas/CogVideoX2Request"
                  },
                  {
                    "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"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/async-result/{id}": {
      "get": {
        "tags": [
          "Video API"
        ],
        "summary": "Get async result",
        "description": "Query the result and status of an asynchronous request.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "任务 ID。"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "model": {
                      "type": "string",
                      "description": "模型名称。"
                    },
                    "video_result": {
                      "type": "array",
                      "description": "视频生成结果。",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string",
                            "description": "视频链接。"
                          },
                          "cover_image_url": {
                            "type": "string",
                            "description": "视频封面链接。"
                          }
                        }
                      }
                    },
                    "task_status": {
                      "type": "string",
                      "description": "处理状态，`PROCESSING (处理中)`、`SUCCESS (成功)`、`FAIL (失败)`。注意：处理状态需要通过查询获取。"
                    },
                    "request_id": {
                      "type": "string",
                      "description": "客户端请求时用户提交的任务编号或平台生成的任务编号。"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/web_search": {
      "post": {
        "tags": [
          "Tool API"
        ],
        "summary": "Web search",
        "description": "Web search service optimized for AI models. Provides structured search results, including web page titles, links, summaries, and more.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebSearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebSearchResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/audio/speech": {
      "post": {
        "tags": [
          "Audio API"
        ],
        "summary": "Text to Speech",
        "description": "Use GLM-4-Voice to convert text to natural speech, supporting various voices, emotion control, and tone adjustment.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudioSpeechRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/audio/transcriptions": {
      "post": {
        "tags": [
          "Audio API"
        ],
        "summary": "Speech to Text",
        "description": "Use GLM ASR model to transcribe audio files to text, supporting multiple languages and real-time streaming transcription.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/AudioTranscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/tools": {
      "post": {
        "tags": [
          "Tool API"
        ],
        "summary": "Web search (comprehensive)",
        "description": "Perform a web search and return comprehensive results.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebSearchParamsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebSearchResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agents": {
      "post": {
        "tags": [
          "Agent API"
        ],
        "summary": "Agent conversation",
        "description": "Interact with agents for conversation. Supports both synchronous and streaming calls, providing professional agent capabilities.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "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": "Get agent async result",
        "description": "Query the result and status of an agent's asynchronous task.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "async_id",
            "in": "query",
            "required": true,
            "description": "任务ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": true,
            "description": "agent智能体名称，如doc_translation_agent",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAsyncResultResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/assistant": {
      "post": {
        "tags": [
          "Assistant API"
        ],
        "summary": "Assistant conversation",
        "description": "Interact with the AI assistant, supporting both streaming and synchronous modes.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "stream",
            "in": "query",
            "description": "是否启用流式响应",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "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/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/assistant/list": {
      "post": {
        "tags": [
          "Assistant API"
        ],
        "summary": "Query Assistant List",
        "description": "Query the list of specified assistants, including detailed configurations, tools, and metadata.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantListRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantSupportResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/assistant/conversation/list": {
      "post": {
        "tags": [
          "Assistant API"
        ],
        "summary": "Query Assistant Conversation List",
        "description": "Query the conversation list for a specified assistant, with support for pagination.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "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": "Operation successful"
                    },
                    "data": {
                      "$ref": "#/components/schemas/ConversationListResponse"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/batches": {
      "post": {
        "tags": [
          "Batch API"
        ],
        "summary": "Create batch task",
        "description": "Create a new batch processing task.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "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": [
          "Batch API"
        ],
        "summary": "List batch tasks",
        "description": "Get a list of batch processing tasks, with pagination support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "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": [
          "Batch API"
        ],
        "summary": "Get Batch Task Details",
        "description": "Get the details of a Batch task by its unique batch_id.",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the batch task.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful. Returns a Batch object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "default": {
            "description": "Request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/paas/v4/batches/{batch_id}/cancel": {
      "post": {
        "tags": [
          "Batch API"
        ],
        "summary": "Cancel batch task",
        "description": "Cancel a running batch processing task.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "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": [
          "Knowledge API"
        ],
        "summary": "Knowledge retrieve",
        "description": "Retrieve personal knowledge base, supporting vector retrieval, keyword retrieval, mixed retrieval, and custom reranking models.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KnowledgeRetrieveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeRetrieveResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/zrag/agent/chat": {
      "post": {
        "tags": [
          "Agent API"
        ],
        "summary": "Agent Chat (SSE Streaming)",
        "description": "Streaming chat interface based on ReAct (Reasoning + Acting) inference engine. The LLM autonomously decides whether to invoke tools (knowledge retrieval, query rewrite, etc.) based on the user's question, and pushes the thinking process, tool calls, and final answer in real-time via SSE.",
        "parameters": [
          {
            "name": "X-Session-Id",
            "in": "header",
            "description": "Session ID, pass in to continue an existing conversation",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentChatRequest"
              },
              "example": {
                "messages": [
                  {
                    "role": "user",
                    "content": "What is the company's annual leave policy?"
                  }
                ],
                "model": "glm-5v-turbo",
                "temperature": 0.7,
                "max_steps": 10,
                "retrieval": {
                  "know_ids": [
                    "know_hr_policy"
                  ],
                  "top_k": 8,
                  "top_n": 10,
                  "enable_rerank": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSE streaming response, returns AgentStreamEvent event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/AgentStreamEvent"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmApplicationError"
                }
              }
            }
          }
        }
      }
    },
    "/zrag/retrieval/retrieve": {
      "post": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Multimodal knowledge retrieve",
        "description": "Retrieve multimodal knowledge base, supporting text, image, and video inputs. Supports vector retrieval, keyword retrieval, mixed retrieval, query rewrite, reranking, QA intervention, and other advanced features.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ZragRetrieveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ZragRetrieveResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/knowledge": {
      "post": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Create knowledge base",
        "description": "Create a personal knowledge base, supporting vector model binding, name, description, background color, and icon settings.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "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/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "List knowledge bases",
        "description": "Get a list of personal knowledge bases, with pagination support.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "页码，默认1",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "每页数量，默认10",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeListResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/knowledge/{id}": {
      "put": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Edit knowledge base",
        "description": "Edit an existing personal knowledge base. Only provide fields to be modified.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "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/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Get knowledge base details",
        "description": "Get details of a personal knowledge base by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeDetailResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Delete knowledge base",
        "description": "Delete a personal knowledge base by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeDeleteResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/knowledge/capacity": {
      "get": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Get knowledge base usage",
        "description": "Get usage details of a personal knowledge base, including word and byte counts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "业务处理成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeCapacityResponse"
                }
              }
            }
          },
          "default": {
            "description": "请求失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document/upload_document/{id}": {
      "post": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Upload document to knowledge base",
        "description": "Upload a document to the specified knowledge base, supporting multiple slicing methods and callbacks.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "知识库id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "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/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/v2/application/{app_id}/variables": {
      "get": {
        "tags": [
          "QingLiu Agent API"
        ],
        "summary": "Get agent (application) input parameters",
        "description": "Get the list of input parameters for the specified agent (application).",
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "Agent (application) id. Get it from: My Agents list page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationVariablesResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v2/application/file_upload": {
      "post": {
        "tags": [
          "QingLiu Agent API"
        ],
        "summary": "File upload",
        "description": "Upload files to the agent (application), returns upload result synchronously. You need to request the file parsing status API to get the parsing result.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "app_id": {
                    "type": "string",
                    "description": "Agent (application) id"
                  },
                  "upload_unit_id": {
                    "type": "string",
                    "description": "Upload file component id. Required for text, not for dialog temporary files."
                  },
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "File array"
                  },
                  "conversation_id": {
                    "type": "string",
                    "description": "For dialog-type apps uploading temporary files, you must first create a new conversation and assign the conversation ID to this parameter (required for dialog-type, not for text)."
                  },
                  "file_type": {
                    "type": "integer",
                    "description": "File type: 1: excel, 2: document, 3: audio 4: image 4: video"
                  }
                },
                "required": [
                  "app_id",
                  "files"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationFileUploadResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v2/application/file_stat": {
      "post": {
        "tags": [
          "QingLiu Agent API"
        ],
        "summary": "Get file parsing status",
        "description": "Get the parsing status of specified files.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationFileStatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationFileStatResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v2/application/{app_id}/conversation": {
      "post": {
        "tags": [
          "QingLiu Agent API"
        ],
        "summary": "Create new conversation",
        "description": "Create a new conversation for the specified agent (application) and return the conversation ID.",
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "Agent (application) id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationConversationResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v3/application/invoke": {
      "post": {
        "tags": [
          "QingLiu Agent API"
        ],
        "summary": "Inference API",
        "description": "Inference API for dialog or text applications, supports both synchronous and streaming (SSE) calls.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationInvokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationInvokeResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/v2/application/slice_info": {
      "post": {
        "tags": [
          "QingLiu Agent API"
        ],
        "summary": "Knowledge base slice reference position info",
        "description": "Get the reference position info of knowledge base slices.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationSliceInfoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationSliceInfoResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/history_session_record/{app_id}/{conversation_id}": {
      "get": {
        "tags": [
          "QingLiu Agent API"
        ],
        "summary": "Recommended questions API",
        "description": "Get the list of recommended questions.",
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "Application id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "description": "Conversation id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistorySessionRecordResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/llm-application/open/document/{id}": {
      "put": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Edit Knowledge",
        "description": "Edit personal knowledge and reconstruct knowledge.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Knowledge id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditKnowledgeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditKnowledgeResponse"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Get document detail",
        "description": "Get document detail by id.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Document id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful",
            "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": "Word count exceeds the limit"
                    }
                  },
                  "code": 200,
                  "message": "Request successful",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Delete knowledge",
        "description": "Delete knowledge by id.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Knowledge id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteKnowledgeResponse"
                },
                "example": {
                  "code": 200,
                  "message": "Request successful",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document": {
      "get": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Get knowledge base document list",
        "description": "Get the document list of the specified knowledge base.",
        "parameters": [
          {
            "name": "knowledge_id",
            "in": "query",
            "required": true,
            "description": "Knowledge base id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, default 1",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Page size, default 10",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "word",
            "in": "query",
            "required": false,
            "description": "Document name",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful",
            "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": "Word count exceeds the limit"
                        }
                      }
                    ],
                    "total": 1
                  },
                  "code": 200,
                  "message": "Request successful",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document/upload_url": {
      "post": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Upload URL to build knowledge",
        "description": "Create personal knowledge from web pages.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadUrlKnowledgeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "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": "Unsupported document type"
                      }
                    ]
                  },
                  "code": 200,
                  "message": "Request successful",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llm-application/open/document/embedding/{id}": {
      "post": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Re-embedding",
        "description": "Re-embed a document (retry, etc). Synchronous return means the call is accepted; embedding completion will notify via callback_url, or you can query the document detail API for results. Mainly used for URL knowledge scenarios.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Knowledge id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReEmbeddingRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReEmbeddingResponse"
                },
                "example": {
                  "code": 200,
                  "message": "Request successful",
                  "timestamp": 1689649504996
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/document/slice/image_list/{id}": {
      "post": {
        "tags": [
          "Knowledge API"
        ],
        "summary": "Get parsed image list from file",
        "description": "Get the mapping of image indices and image URLs parsed from a file.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Knowledge id",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "Request successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeImageListResponse"
                },
                "example": {
                  "data": {
                    "images": [
                      {
                        "text": "[Image Index_1829473032620613632_103]",
                        "cos_url": "https://cdn.bigmodel.cn/knowledge_pdf_image/de7163a7-c67f-4e33-8810-97a6d5a83378.png"
                      }
                    ]
                  },
                  "code": 200,
                  "message": "Request successful",
                  "timestamp": 1725070689634
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "AcceptLanguage": {
        "name": "Accept-Language",
        "in": "header",
        "schema": {
          "type": "string",
          "description": "HTTP 请求头，用于告知服务器浏览器的首选语言列表，以便服务器返回最符合用户偏好的语言内容。",
          "default": "cn",
          "enum": [
            "en",
            "cn"
          ]
        },
        "required": true
      }
    },
    "schemas": {
      "ChatCompletionRequest": {
        "required": [
          "model",
          "messages"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "Model code to call",
            "example": "glm-4-32b-0414-128k",
            "default": "glm-4-32b-0414-128k",
            "enum": [
              "glm-4-32b-0414-128k"
            ]
          },
          "messages": {
            "type": "array",
            "description": "Current conversation message list as model prompt input, provided in JSON array format, for example: `{\"role\": \"user\", \"content\": \"Hello\"}`. Possible message types include system messages, user messages, assistant messages, and tool messages.",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "description": "Role of the message author. Options: system, user, or assistant.",
                  "example": "user",
                  "default": "user",
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ]
                },
                "content": {
                  "type": "string",
                  "description": "Message content",
                  "example": "What opportunities and challenges will the Chinese large model industry face in 2025?"
                }
              },
              "required": [
                "role",
                "content"
              ]
            },
            "minItems": 1,
            "maxItems": 10
          },
          "request_id": {
            "type": "string",
            "description": "Passed by the client, must be unique; used to distinguish each request. If not provided by the client, the platform will generate one by default."
          },
          "do_sample": {
            "type": "boolean",
            "example": true,
            "default": true,
            "description": "When do_sample is true, sampling strategies are enabled; when do_sample is false, sampling strategy parameters such as temperature and top_p will not take effect. Default value is `true`."
          },
          "stream": {
            "type": "boolean",
            "example": false,
            "default": false,
            "description": "When using synchronous calls, this parameter should be set to false or omitted. Indicates that the model returns all content at once after generating all content. Default value is false. If set to true, the model will return generated content in chunks through standard event streams. When the event stream ends, a `data: [DONE]` message will be returned."
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，控制输出的随机性，必须是范围 `[0.0, 1.0]` 内的正数，默认值为 `0.95`。",
            "format": "float",
            "example": 0.95,
            "default": 0.95,
            "minimum": 0.0,
            "maximum": 1.0
          },
          "top_p": {
            "type": "number",
            "description": "Another temperature sampling method with a value range of `[0.0, 1.0]`, default value is `0.7`.",
            "format": "float",
            "example": 0.7,
            "default": 0.7,
            "minimum": 0.0,
            "maximum": 1.0
          },
          "max_tokens": {
            "type": "integer",
            "description": "Maximum number of tokens the model outputs, with a maximum output of `4095` and default value of `1024`.",
            "example": 1024,
            "default": 1024,
            "minimum": 1,
            "maximum": 4095
          },
          "tools": {
            "type": "array",
            "description": "List of tools that the model can call. Currently only functions are supported as tools. Use this parameter to provide a list of functions for which the model can generate JSON input. Supports up to 128 functions.\n",
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FunctionToolSchema"
                }
              },
              {
                "items": {
                  "$ref": "#/components/schemas/RetrievalToolSchema"
                }
              }
            ]
          }
        }
      },
      "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": "Whether to enable search functionality.\nDefaults to `false`. Set to true to enable."
          },
          "search_engine": {
            "type": "string",
            "description": "Search engine type.\nDefaults to `search_std`. Supports: `search_std`, `search_pro`, `search_pro_sogou`, `search_pro_quark`, `search_pro_jina`, `search_pro_bing`.",
            "enum": [
              "search_std",
              "search_pro",
              "search_pro_sogou",
              "search_pro_quark",
              "search_pro_jina",
              "search_pro_bing"
            ]
          },
          "search_query": {
            "type": "string",
            "description": "Force trigger search"
          },
          "count": {
            "type": "integer",
            "description": "返回结果数量\n范围：`1-50`，每次搜索最多 `50` 个结果\n默认为 `10`\n支持的引擎：`search_std`、`search_pro`、`search_pro_sogou`\n对于 `search_pro_sogou`：允许的值为 `10`、`20`、`30`、`40`、`50`",
            "minimum": 1,
            "maximum": 50
          },
          "search_domain_filter": {
            "type": "string",
            "description": "将搜索结果限制为指定的白名单域名。白名单：直接输入域名（例如：www.example.com）\n支持的引擎：`search_std`、`search_pro`、`search_pro_sogou`、`search_pro_Jina`"
          },
          "search_recency_filter": {
            "type": "string",
            "description": "将搜索限制在特定时间范围内。\n默认为 `noLimit`\n值：\n`oneDay`，一天内\n`oneWeek`，一周内\n`oneMonth`，一个月内\n`oneYear`，一年内\n`noLimit`，无限制（默认）\n支持的引擎：`search_std`、`search_pro`、`search_pro_sogou`、`search_pro_quark`",
            "enum": [
              "oneDay",
              "oneWeek",
              "oneMonth",
              "oneYear",
              "noLimit"
            ]
          },
          "content_size": {
            "type": "string",
            "description": "网页摘要的字符数。\n默认为 `medium`\n`medium`：适用于大多数查询的平衡模式。400-600 个字符\n`high`：最大化上下文以获得全面答案，2500 个字符。",
            "enum": [
              "medium",
              "high"
            ]
          },
          "result_sequence": {
            "type": "string",
            "description": "指定搜索结果是在模型响应之前还是之后显示。选项：`before`、`after`。默认为 `after`",
            "enum": [
              "before",
              "after"
            ]
          },
          "search_result": {
            "type": "boolean",
            "description": "是否在响应中返回搜索结果。\n默认为 `false`"
          },
          "require_search": {
            "type": "boolean",
            "description": "是否强制基于搜索结果的模型响应。\n默认为 `false`"
          },
          "search_prompt": {
            "type": "string",
            "description": "自定义搜索结果处理方式的提示词。\n默认提示词：\n`你是一个智能问答专家，具有综合信息、识别时间、理解语义和清理矛盾数据的能力。当前日期是 {{current_date}}。将此作为唯一的时间参考。基于以下信息，为用户的问题提供全面准确的答案。只提取对答案有价值的内容。确保答案及时且权威。直接陈述答案，不要引用数据源或内部流程。`"
          }
        },
        "required": [
          "search_engine"
        ]
      },
      "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"
        ]
      },
      "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'、'tool_calls'、'length'、'sensitive' 或 'network_error'。"
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "description": "调用结束时返回的 Token 使用统计。",
            "properties": {
              "prompt_tokens": {
                "type": "integer",
                "description": "用户输入的 Token 数量"
              },
              "completion_tokens": {
                "type": "integer",
                "description": "输出的 Token 数量"
              },
              "total_tokens": {
                "type": "integer",
                "description": "Token 总数"
              }
            }
          }
        }
      },
      "ChatCompletionResponseMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "当前对话角色，默认为 'assistant'",
            "example": "assistant"
          },
          "content": {
            "type": "string",
            "description": "当前对话内容。如果调用函数则为 null，否则返回推理结果。"
          },
          "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": "object",
                "description": "生成的函数调用参数的 JSON 格式。调用函数前请验证参数。"
              }
            },
            "required": [
              "name",
              "arguments"
            ]
          },
          "id": {
            "type": "string",
            "description": "命中函数的唯一标识符。"
          },
          "type": {
            "type": "string",
            "description": "调用的工具类型，目前仅支持 'function'。"
          }
        }
      },
      "CogVideoX2Request": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "description": "要调用的代码。",
                "enum": [
                  "cogvideox-2"
                ]
              },
              "prompt": {
                "type": "string",
                "description": "视频的文本描述，最大输入长度为 512 个 Token。必须提供 image_url 或 prompt，或两者都提供。"
              },
              "quality": {
                "type": "string",
                "description": "输出模式，默认为 `speed`。\n `quality`：优先质量，生成质量更高。\n`speed`：优先速度，生成时间更快，质量相对较低。",
                "example": "speed",
                "enum": [
                  "speed",
                  "quality"
                ]
              },
              "with_audio": {
                "type": "boolean",
                "description": "是否生成 AI 音效。默认：`false`（无音效）。",
                "example": false
              },
              "image_url": {
                "description": "用于内容生成的基础图像。如果提供，系统将基于此图像进行操作。支持 URL 或 Base64 编码图像。图像要求：支持 .png、.jpeg、.jpg 格式；图像大小不超过 5M。必须提供 image_url 或 prompt，或两者都提供。",
                "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"
                  }
                ]
              },
              "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 个 Token。"
              },
              "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 个 Token。必须提供 image_url 或 prompt，或两者都提供。"
              },
              "image_url": {
                "type": "string",
                "description": "系统将使用此参数中提供的图像作为第一帧来生成视频。\n仅支持 `1` 张图像。\n支持的格式：`png`、`jpeg`、`jpg`、`webp`。\n图像宽高比必须小于 `1:4` 或 `4:1`。\n图像文件大小不得超过 `50MB`。\n注意：Base64 解码后，字节长度必须小于 50 MB，编码必须包含适当的内容类型字符串（例如，`data:image/png;base64,{base64_encode}`）。",
                "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"
                  }
                ]
              },
              "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": "为生成的视频添加背景音乐。"
              }
            },
            "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 个 Token。必须提供 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 解码后，字节长度必须小于 50 MB，编码必须包含适当的内容类型字符串，例如 `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`",
                    "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": "为生成的视频添加背景音乐。"
              }
            },
            "required": [
              "model"
            ]
          },
          {
            "$ref": "#/components/schemas/VideoCommonRequest"
          }
        ]
      },
      "ViduReference2VideoRequest": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "description": "要调用的代码。",
                "enum": [
                  "vidu2-reference"
                ]
              },
              "prompt": {
                "type": "string",
                "description": "视频的文本描述，最大输入长度为 512 个 Token。必须提供 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 解码后，字节长度必须小于 50 MB，编码必须包含适当的内容类型字符串，例如 `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"
          }
        ]
      },
      "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": "Z.AI 生成的任务订单号，调用请求结果接口时使用此订单号。",
            "type": "string"
          },
          "request_id": {
            "description": "用户在客户端请求期间提交的任务编号或平台生成的任务编号。",
            "type": "string"
          },
          "task_status": {
            "description": "处理状态，`PROCESSING (处理中)`、`SUCCESS (成功)`、`FAIL (失败)`。结果需要通过查询获取。",
            "type": "string"
          }
        }
      },
      "WebSearchRequest": {
        "type": "object",
        "properties": {
          "search_query": {
            "type": "string",
            "description": "要搜索的内容。"
          },
          "search_engine": {
            "type": "string",
            "description": "要调用的搜索引擎代码。目前支持：\n`search_std`：Z.AI 基础搜索引擎\n`search_pro`：Z.AI 高级搜索引擎\n`search_pro_sogou`：搜狗搜索引擎\n`search_pro_quark`：夸克搜索引擎\n`search_pro_jina`：jina.ai 搜索引擎\n默认为 `search_std`。",
            "example": "search_std",
            "default": "search_std",
            "enum": [
              "search_std",
              "search_pro",
              "search_pro_sogou",
              "search_pro_quark",
              "search_pro_jina"
            ]
          },
          "count": {
            "type": "integer",
            "description": "返回结果的数量\n可填范围：`1-50`，单次搜索最多 `50` 个结果\n默认为 `10`\n支持的搜索引擎：\n`search_pro`、`search_std`、`search_pro_sogou`\n搜狗：可选枚举值为 `10`、`20`、`30`、`40`、`50`。",
            "minimum": 1,
            "maximum": 50
          },
          "search_domain_filter": {
            "type": "string",
            "description": "用于限制搜索结果范围，仅返回指定白名单域名的内容。\n白名单：直接输入域名（例如，`www.example.com`）\n支持的搜索引擎：\n`search_std`、`search_pro`、`search_pro_sogou`、`search_pro_jina`"
          },
          "search_recency_filter": {
            "type": "string",
            "description": "在指定时间范围内搜索网页。\n默认为 `noLimit`\n可填值：\n`oneDay`：一天内\n`oneWeek`：一周内\n`oneMonth`：一个月内\n`oneYear`：一年内\n`noLimit`：无限制（默认）\n支持的搜索引擎：\n`search_std`、`search_pro`、`search_pro_sogou`、`search_pro_quark`",
            "enum": [
              "oneDay",
              "oneWeek",
              "oneMonth",
              "oneYear",
              "noLimit"
            ]
          },
          "content_size": {
            "type": "string",
            "description": "网页摘要的字符数。\n默认为 `medium`\n`medium`：适用于大多数查询的平衡模式，400-600 个字符\n`high`：为全面答案最大化上下文，2500 个字符。",
            "example": "medium",
            "default": "medium",
            "enum": [
              "medium",
              "high"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "用户提供的用于区分请求的唯一标识符。如果未提供，平台将生成一个。"
          },
          "user_id": {
            "type": "string",
            "description": "终端用户的唯一 ID，帮助平台干预非法活动、不当内容生成或其他滥用行为。ID 长度：6 到 128 个字符。"
          }
        },
        "required": [
          "search_query"
        ]
      },
      "WebSearchResponse": {
        "type": "object",
        "properties": {
          "id": {
            "description": "任务 ID。",
            "type": "string"
          },
          "created": {
            "description": "请求创建时间，Unix 时间戳（秒）。",
            "type": "integer"
          },
          "search_intent": {
            "description": "搜索意图结果。",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "query": {
                  "type": "string",
                  "description": "原始搜索查询。"
                },
                "intent": {
                  "type": "string",
                  "description": "识别的意图类型。\n`SEARCH_ALL`：搜索整个网络\n`SEARCH_NONE`：无搜索意图"
                },
                "keywords": {
                  "type": "string",
                  "description": "重写的搜索关键词。"
                }
              }
            }
          },
          "search_result": {
            "description": "搜索结果。",
            "type": "array",
            "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": "网站发布日期。"
                }
              }
            }
          }
        }
      },
      "AudioSpeechRequest": {
        "type": "object",
        "required": [
          "model",
          "input",
          "voice"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "要使用的TTS模型"
          },
          "input": {
            "type": "string",
            "description": "要转换为语音的文本",
            "maxLength": 4096
          },
          "voice": {
            "type": "string",
            "enum": [
              "alloy",
              "echo",
              "fable",
              "onyx",
              "nova",
              "shimmer"
            ],
            "description": "用于生成音频的语音"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "mp3",
              "opus",
              "aac",
              "flac"
            ],
            "default": "mp3",
            "description": "音频输出格式"
          },
          "speed": {
            "type": "number",
            "minimum": 0.25,
            "maximum": 4.0,
            "default": 1.0,
            "description": "生成音频的速度"
          }
        }
      },
      "AudioTranscriptionRequest": {
        "type": "object",
        "required": [
          "file",
          "model"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "要转录的音频文件"
          },
          "model": {
            "type": "string",
            "description": "要使用的ASR模型"
          },
          "language": {
            "type": "string",
            "description": "音频的语言（ISO-639-1格式）"
          },
          "prompt": {
            "type": "string",
            "description": "可选的文本提示"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "json",
              "text",
              "srt",
              "verbose_json",
              "vtt"
            ],
            "default": "json",
            "description": "转录输出格式"
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0,
            "description": "采样温度"
          }
        }
      },
      "AudioTranscriptionResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "转录的文本"
          }
        }
      },
      "ImageGenerationRequest": {
        "type": "object",
        "required": [
          "model",
          "prompt"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "要使用的图像生成模型"
          },
          "prompt": {
            "type": "string",
            "description": "描述所需图像的文本提示"
          },
          "n": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 1,
            "description": "要生成的图像数量"
          },
          "quality": {
            "type": "string",
            "enum": [
              "standard",
              "hd"
            ],
            "default": "standard",
            "description": "生成图像的质量"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "url",
              "b64_json"
            ],
            "default": "url",
            "description": "返回生成图像的格式"
          },
          "size": {
            "type": "string",
            "enum": [
              "256x256",
              "512x512",
              "1024x1024",
              "1792x1024",
              "1024x1792"
            ],
            "default": "1024x1024",
            "description": "生成图像的尺寸"
          },
          "style": {
            "type": "string",
            "enum": [
              "vivid",
              "natural"
            ],
            "default": "vivid",
            "description": "生成图像的风格"
          },
          "user": {
            "type": "string",
            "description": "代表最终用户的唯一标识符"
          }
        }
      },
      "ImageGenerationResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "description": "图像生成的Unix时间戳"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImageObject"
            }
          }
        }
      },
      "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": "嵌入模型名称，如 text-embedding-v1、text-embedding-v2、text-embedding-v3、text-embedding-v4。"
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "输入文本，支持字符串或字符串数组。\n- 单字符串：最长 2048 Token（v3/v4 最长 8192 Token）\n- 字符串数组：最多 25 条（v3/v4 最多 10 条），每条最长 2048 Token（v3/v4 每条最长 8192 Token）"
          },
          "encoding_format": {
            "type": "string",
            "enum": [
              "float",
              "base64"
            ],
            "default": "float",
            "description": "返回向量格式，支持 float（默认）或 base64。"
          },
          "dimensions": {
            "type": "integer",
            "minimum": 1,
            "description": "输出向量维度，仅 text-embedding-v3 与 text-embedding-v4 支持。可选值：2048（仅 v4）、1536（仅 v4）、1024（默认）、768、512、256、128、64。"
          },
          "user": {
            "type": "string",
            "description": "代表最终用户的唯一标识符。"
          }
        }
      },
      "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": "The file to be uploaded"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "batch",
              "file-extract",
              "code-interpreter",
              "agent"
            ],
            "description": "The intended purpose of the file.\nbatch: Used for batch task processing, supports .jsonl file format, with a single file size limit of 100 MB and no more than 1,000 files. See Batch Guide.\nfile-extract: Used for document content extraction, supported formats include: pdf, docx, doc, xls, xlsx, ppt, pptx, png, jpg, jpeg, csv. Single file size limit is 50 MB, image size must not exceed 5 MB, and no more than 100 files.\ncode-interpreter: Files are uploaded for code sandbox CI usage, supported formats include: pdf, docx, doc, xls, xlsx, txt, png, jpg, jpeg, csv. Single file size limit is 20 MB, image size must not exceed 5 MB, and no more than 100 files.\nagent: Files are uploaded for agent usage, supported formats include: pdf, docx, doc, xls, xlsx, txt, png, jpg, jpeg, csv. No more than 1000 files."
          }
        }
      },
      "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": "是否有更多数据"
          }
        }
      },
      "FileDeletedResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "删除的文件ID"
          },
          "object": {
            "type": "string",
            "enum": [
              "file"
            ]
          },
          "deleted": {
            "type": "boolean",
            "description": "是否成功删除"
          }
        }
      },
      "FineTuningJobCreateRequest": {
        "type": "object",
        "required": [
          "model",
          "training_file"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "要微调的基础模型名称"
          },
          "training_file": {
            "type": "string",
            "description": "包含训练数据的上传文件ID"
          },
          "validation_file": {
            "type": "string",
            "description": "包含验证数据的上传文件ID"
          },
          "suffix": {
            "type": "string",
            "maxLength": 40,
            "description": "微调模型名称的后缀"
          },
          "hyperparameters": {
            "type": "object",
            "properties": {
              "n_epochs": {
                "type": "integer",
                "minimum": 1,
                "maximum": 50,
                "default": 3,
                "description": "训练轮数"
              },
              "batch_size": {
                "type": "integer",
                "minimum": 1,
                "maximum": 256,
                "description": "批次大小"
              },
              "learning_rate_multiplier": {
                "type": "number",
                "minimum": 0.02,
                "maximum": 0.2,
                "description": "学习率乘数"
              }
            }
          }
        }
      },
      "FineTuningJobObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "微调任务ID"
          },
          "object": {
            "type": "string",
            "enum": [
              "fine_tuning.job"
            ]
          },
          "created_at": {
            "type": "integer",
            "description": "任务创建的Unix时间戳"
          },
          "finished_at": {
            "type": "integer",
            "description": "任务完成的Unix时间戳"
          },
          "model": {
            "type": "string",
            "description": "基础模型名称"
          },
          "fine_tuned_model": {
            "type": "string",
            "description": "微调后的模型名称"
          },
          "organization_id": {
            "type": "string",
            "description": "组织ID"
          },
          "status": {
            "type": "string",
            "enum": [
              "validating_files",
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ],
            "description": "任务状态"
          },
          "hyperparameters": {
            "type": "object",
            "description": "微调超参数"
          },
          "training_file": {
            "type": "string",
            "description": "训练文件ID"
          },
          "validation_file": {
            "type": "string",
            "description": "验证文件ID"
          },
          "result_files": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "结果文件ID列表"
          },
          "trained_tokens": {
            "type": "integer",
            "description": "已训练的token数量"
          }
        }
      },
      "FineTuningJobListResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FineTuningJobObject"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "是否有更多数据"
          }
        }
      },
      "FineTuningJobDeletedResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "删除的任务ID"
          },
          "object": {
            "type": "string",
            "enum": [
              "fine_tuning.job"
            ]
          },
          "deleted": {
            "type": "boolean",
            "description": "是否成功删除"
          }
        }
      },
      "FineTuningJobEventListResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FineTuningJobEventObject"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "是否有更多数据"
          }
        }
      },
      "FineTuningJobEventObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "事件ID"
          },
          "object": {
            "type": "string",
            "enum": [
              "fine_tuning.job.event"
            ]
          },
          "created_at": {
            "type": "integer",
            "description": "事件创建的Unix时间戳"
          },
          "level": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "error"
            ],
            "description": "日志级别"
          },
          "message": {
            "type": "string",
            "description": "事件消息"
          },
          "data": {
            "type": "object",
            "description": "事件数据"
          },
          "type": {
            "type": "string",
            "description": "事件类型"
          }
        }
      },
      "FineTunedModelDeletedResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "删除的模型ID"
          },
          "object": {
            "type": "string",
            "enum": [
              "model"
            ]
          },
          "deleted": {
            "type": "boolean",
            "description": "是否成功删除"
          }
        }
      },
      "WebSearchParamsRequest": {
        "type": "object",
        "properties": {
          "search_query": {
            "type": "string",
            "description": "搜索查询字符串"
          },
          "search_engine": {
            "type": "string",
            "description": "搜索引擎类型",
            "enum": [
              "google",
              "bing"
            ]
          },
          "count": {
            "type": "integer",
            "description": "返回结果数量",
            "default": 10
          },
          "search_domain_filter": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "域名过滤器"
          },
          "search_recency_filter": {
            "type": "string",
            "description": "时间过滤器",
            "enum": [
              "day",
              "week",
              "month",
              "year"
            ]
          },
          "content_size": {
            "type": "string",
            "description": "内容大小",
            "enum": [
              "small",
              "medium",
              "large"
            ]
          }
        },
        "required": [
          "search_query"
        ]
      },
      "RerankRequest": {
        "type": "object",
        "required": [
          "model",
          "query",
          "documents"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "The code of the model to be used. Defaults to 'rerank'."
          },
          "query": {
            "type": "string",
            "description": "The query text to match against candidate texts. Maximum length is 4096 characters."
          },
          "top_n": {
            "type": "integer",
            "description": "Returns the top n documents with the highest scores. Default is 0, which returns all."
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "An array of candidate texts to be scored, holding up to 128 items. Each item can have a maximum length of 4096 characters."
          },
          "return_documents": {
            "type": "boolean",
            "description": "Whether to return the original texts. Default is FALSE."
          },
          "return_raw_scores": {
            "type": "boolean",
            "description": "Whether to return the raw scores. Default is FALSE."
          },
          "request_id": {
            "type": "string",
            "description": "Parameter passed by the client, must be unique. If left empty, the server will generate one by default."
          },
          "user_id": {
            "type": "string",
            "description": "Unique ID of the user."
          }
        }
      },
      "RerankResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "format": "int64",
            "example": 1732083164
          },
          "id": {
            "type": "string",
            "example": "20241120141244890ab4ee4af84acf",
            "description": "The task order number generated by Zhipu AI Open Platform. Please use this order ID when calling the result query interface."
          },
          "request_id": {
            "type": "string",
            "example": "1111111111",
            "description": "The task number submitted by the client in the request, or the task number generated by the platform."
          },
          "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": "The original text."
          },
          "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"
        ]
      },
      "AgentRequest": {
        "type": "object",
        "required": [
          "agent_id",
          "messages"
        ],
        "properties": {
          "agent_id": {
            "type": "string",
            "description": "智能体 ID。例如：翻译智能体ID为 general_translation；专业文档翻译智能体ID为： doc_translation_agent。",
            "example": "general_translation"
          },
          "stream": {
            "type": "boolean",
            "description": "使用同步调用时，此参数应当设置为 false 或者省略。表示模型生成完所有内容后一次性返回所有内容。默认值为 false。如果设置为 true，模型将通过标准 Event Stream，逐块返回模型生成内容。Event Stream 结束时会返回一条 data: [DONE] 消息。",
            "default": false,
            "example": false
          },
          "messages": {
            "type": "array",
            "description": "会话消息体列表。",
            "items": {
              "type": "object",
              "required": [
                "role",
                "content"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "description": "消息作者的角色。用户输入时 role = user。",
                  "enum": [
                    "user",
                    "assistant"
                  ],
                  "example": "user"
                },
                "content": {
                  "type": "array",
                  "description": "会话消息体内容。",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "text"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "消息内容类型。目前支持 type=text。",
                        "enum": [
                          "text"
                        ],
                        "example": "text"
                      },
                      "text": {
                        "type": "string",
                        "description": "用户输入的文本内容。",
                        "example": "请帮我翻译这段文字：Hello World"
                      }
                    }
                  }
                }
              }
            },
            "minItems": 1
          },
          "custom_variables": {
            "type": "object",
            "description": "智能体扩展参数。根据不同智能体的需求提供相应的参数配置。",
            "additionalProperties": true
          }
        }
      },
      "AgentResponse": {
        "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": "结果索引。"
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "description": "响应角色，通常为 assistant。",
                      "example": "assistant"
                    },
                    "content": {
                      "type": "string",
                      "description": "智能体生成的响应内容。"
                    }
                  }
                },
                "finish_reason": {
                  "type": "string",
                  "description": "响应结束原因。可以是 'stop'、'length'、'sensitive' 或 'network_error'。"
                }
              }
            }
          },
          "usage": {
            "$ref": "#/components/schemas/UsageStatistics"
          }
        }
      },
      "AgentAsyncResultResponse": {
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "description": "agent智能体名称"
          },
          "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数"
              }
            }
          }
        }
      },
      "AssistantRequest": {
        "type": "object",
        "properties": {
          "assistant_id": {
            "type": "string",
            "title": "Assistant Selection",
            "description": "Assistant ID, required parameter. Please select an assistant from the dropdown:\n\n• ChatGLM (Official) - 65940acff94777010aa6b796: Hi~ I'm Qingyan, super happy to meet you! 😺\n• Data Analysis (Official) - 65a265419d72d299a9230616: Analyze data and provide charts\n• Complex Flowchart (Official) - 664dd7bd5bb3a13ba0f81668: Create a flowchart in five seconds\n• Mind Map (Official) - 664e0cade018d633146de0d2: Turn any complex concept into a mind map\n• Prompt Engineer (Official) - 6654898292788e88ce9e7f4c: Super strong structured prompt expert\n• AI Drawing (Official) - 66437ef3d920bdc5c60f338e: Your exclusive drawing partner\n• AI Search (Official) - 659e54b1b8006379b4b2abd6: Connect to all web content, precise search\n• PPT Assistant (Official) - 65d2f07bb2c10188f885bd89: Super practical PPT generator\n• arXiv Paper Speed Reading (Official) - 663058948bb259b7e8a22730: Deep analysis of papers\n• Programmer Assistant Sam (Official) - 65a393b3619c6f13586246cd: Programming development knowledge search engine\n• Web Novel Writer (Official) - 65b356af6924a59d52832e54: Master writing secrets\n• English Grammar Assistant (Official) - 668fdd45405f2e3c9f71f832: Check grammar and explanations",
            "enum": [
              "65940acff94777010aa6b796",
              "65a265419d72d299a9230616",
              "664dd7bd5bb3a13ba0f81668",
              "664e0cade018d633146de0d2",
              "6654898292788e88ce9e7f4c",
              "66437ef3d920bdc5c60f338e",
              "659e54b1b8006379b4b2abd6",
              "65d2f07bb2c10188f885bd89",
              "663058948bb259b7e8a22730",
              "65a393b3619c6f13586246cd",
              "65b356af6924a59d52832e54",
              "668fdd45405f2e3c9f71f832"
            ],
            "x-enum-varnames": [
              "ChatGLM (Official)",
              "Data Analysis (Official)",
              "Complex Flowchart (Official)",
              "Mind Map (Official)",
              "Prompt Engineer (Official)",
              "AI Drawing (Official)",
              "AI Search (Official)",
              "PPT Assistant (Official)",
              "arXiv Paper Speed Reading (Official)",
              "Programmer Assistant Sam (Official)",
              "Web Novel Writer (Official)",
              "English Grammar Assistant (Official)"
            ],
            "x-enumNames": [
              "ChatGLM (Official)",
              "Data Analysis (Official)",
              "Complex Flowchart (Official)",
              "Mind Map (Official)",
              "Prompt Engineer (Official)",
              "AI Drawing (Official)",
              "AI Search (Official)",
              "PPT Assistant (Official)",
              "arXiv Paper Speed Reading (Official)",
              "Programmer Assistant Sam (Official)",
              "Web Novel Writer (Official)",
              "English Grammar Assistant (Official)"
            ],
            "x-enum-descriptions": [
              "ChatGLM (Official) - Hi~ I'm Qingyan, super happy to meet you! 😺 Do you have any fun things to share with me recently?",
              "Data Analysis (Official) - Helps users analyze data and provide charts by analyzing uploaded files or data descriptions. Can also complete file processing through simple coding.",
              "Complex Flowchart (Official) - A flowchart tool everyone can master, create a flowchart in five seconds to impress colleagues.",
              "Mind Map (Official) - Say goodbye to organizing troubles, any complex concept can be instantly turned into a mind map.",
              "Prompt Engineer (Official) - Everyone is a prompt engineer, super strong structured prompt expert, rewrite prompts with one click.",
              "AI Drawing (Official) - Let imagination fly freely, your exclusive drawing partner, draw until you can't stop.",
              "AI Search (Official) - Connect to all web content, precise search, intelligent assistant that quickly analyzes and summarizes.",
              "PPT Assistant (Official) - Super practical PPT generator, supports manual outline editing and automatic chapter content filling.",
              "arXiv Paper Speed Reading (Official) - Deep analysis of arXiv papers, help you quickly grasp research trends and save precious time.",
              "Programmer Assistant Sam (Official) - \"Programming development knowledge search engine\", can help programmers solve daily problems.",
              "Web Novel Writer (Official) - Master writing secrets: one template repeated continuously.",
              "English Grammar Assistant (Official) - Input words for queries; input sentences to check grammar and get grammar explanations."
            ],
            "example": "65940acff94777010aa6b796"
          },
          "conversation_id": {
            "type": "string",
            "description": "Conversation ID, optional parameter for continuing previous conversations"
          },
          "model": {
            "type": "string",
            "description": "Model name to use",
            "default": "glm-4-assistant"
          },
          "messages": {
            "type": "array",
            "description": "List of conversation messages",
            "items": {
              "type": "object",
              "required": [
                "role",
                "content"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "description": "Role of the message author",
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "example": "user"
                },
                "content": {
                  "oneOf": [
                    {
                      "type": "string",
                      "description": "Message text content",
                      "example": "Hello"
                    },
                    {
                      "type": "array",
                      "description": "Multimodal message content supporting text, images, etc.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "text",
                              "image_url"
                            ],
                            "description": "Content type"
                          },
                          "text": {
                            "type": "string",
                            "description": "Text content"
                          },
                          "image_url": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "description": "Image URL"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            },
            "minItems": 1
          },
          "tools": {
            "type": "array",
            "description": "List of available tools",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "function",
                    "retrieval",
                    "web_search"
                  ],
                  "description": "Tool type"
                },
                "function": {
                  "type": "object",
                  "description": "Function tool definition",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Function name"
                    },
                    "description": {
                      "type": "string",
                      "description": "Function description"
                    },
                    "parameters": {
                      "type": "object",
                      "description": "Function parameters definition"
                    }
                  }
                }
              }
            }
          },
          "stream": {
            "type": "boolean",
            "description": "Whether to enable streaming response",
            "default": false
          },
          "request_id": {
            "type": "string",
            "description": "Request task ID, length must be between 6 to 64 characters",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "description": "Unique ID of the end user, length must be between 6 to 128 characters",
            "minLength": 6,
            "maxLength": 128
          },
          "do_sample": {
            "type": "boolean",
            "description": "Whether to use stable output"
          },
          "top_k": {
            "type": "integer",
            "description": "Top-k sampling parameter"
          },
          "max_tokens": {
            "type": "integer",
            "description": "Maximum number of output tokens"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "List of attachments"
          },
          "metadata": {
            "type": "object",
            "description": "Metadata information",
            "additionalProperties": true
          },
          "extra_parameters": {
            "type": "object",
            "description": "Extra parameters for specific assistant configurations",
            "properties": {
              "translate": {
                "type": "object",
                "description": "Translation parameters",
                "properties": {
                  "from": {
                    "type": "string",
                    "description": "Source language"
                  },
                  "to": {
                    "type": "string",
                    "description": "Target language"
                  }
                }
              }
            }
          }
        },
        "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",
        "properties": {
          "assistant_id_list": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of assistant IDs. If empty, query all available assistants",
            "example": [
              "65940acff94777010aa6b796",
              "assistant_2"
            ]
          }
        }
      },
      "AssistantInfo": {
        "type": "object",
        "properties": {
          "assistant_id": {
            "type": "string",
            "description": "Assistant ID",
            "example": "65940acff94777010aa6b796"
          },
          "name": {
            "type": "string",
            "description": "Assistant name",
            "example": "General Assistant"
          },
          "avatar": {
            "type": "string",
            "description": "Assistant avatar URL",
            "example": "https://example.com/avatar.png"
          },
          "description": {
            "type": "string",
            "description": "Assistant description",
            "example": "A general AI assistant that can answer various questions"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of tools supported by the assistant",
            "example": [
              "web_search",
              "code_interpreter"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "Tag key",
                  "example": "category"
                },
                "label": {
                  "type": "string",
                  "description": "Tag value",
                  "example": "General Assistant"
                }
              }
            },
            "description": "List of assistant tags"
          },
          "status": {
            "type": "string",
            "description": "Assistant status",
            "example": "active"
          },
          "starter_prompts": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Assistant starter prompts"
          },
          "created_at": {
            "type": "string",
            "description": "Creation time",
            "example": "2024-01-01T00:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "description": "Update time",
            "example": "2024-01-01T00:00:00Z"
          }
        },
        "required": [
          "assistant_id",
          "name"
        ]
      },
      "ConversationListRequest": {
        "type": "object",
        "required": [
          "assistant_id"
        ],
        "properties": {
          "assistant_id": {
            "type": "string",
            "description": "Assistant ID",
            "example": "65940acff94777010aa6b796"
          },
          "page": {
            "type": "integer",
            "description": "Page number, starting from 1",
            "minimum": 1,
            "default": 1,
            "example": 1
          },
          "page_size": {
            "type": "integer",
            "description": "Page size",
            "minimum": 1,
            "maximum": 100,
            "default": 5,
            "example": 10
          }
        }
      },
      "ConversationListResponse": {
        "type": "object",
        "properties": {
          "assistant_id": {
            "type": "string",
            "description": "Assistant ID",
            "example": "65940acff94777010aa6b796"
          },
          "conversation_list": {
            "type": "array",
            "description": "Conversation list",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Conversation ID",
                  "example": "conv_123456"
                },
                "assistant_id": {
                  "type": "string",
                  "description": "Assistant ID",
                  "example": "65940acff94777010aa6b796"
                },
                "create_time": {
                  "type": "string",
                  "description": "Creation time",
                  "example": "2024-01-01T10:00:00Z"
                },
                "update_time": {
                  "type": "string",
                  "description": "Update time",
                  "example": "2024-01-01T10:30:00Z"
                },
                "usage": {
                  "type": "object",
                  "description": "Usage statistics",
                  "properties": {
                    "prompt_tokens": {
                      "type": "integer",
                      "description": "Input token count"
                    },
                    "completion_tokens": {
                      "type": "integer",
                      "description": "Output token count"
                    },
                    "total_tokens": {
                      "type": "integer",
                      "description": "Total token count"
                    }
                  }
                }
              },
              "required": [
                "id",
                "assistant_id"
              ]
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there is more data",
            "example": true
          }
        },
        "required": [
          "assistant_id",
          "conversation_list",
          "has_more"
        ]
      },
      "BatchCreateRequest": {
        "type": "object",
        "properties": {
          "input_file_id": {
            "type": "string",
            "description": "The ID of the uploaded file containing the batch requests. The input file must be in .jsonl format and the upload purpose must be marked as 'batch'."
          },
          "endpoint": {
            "type": "string",
            "description": "The endpoint to be used for all requests in the batch. Currently only /v4/chat/completions is supported.",
            "enum": [
              "/v4/chat/completions"
            ]
          },
          "auto_delete_input_file": {
            "type": "boolean",
            "description": "Whether to automatically delete the original batch file. Default is true: true means auto-delete, false means keep the original batch file.",
            "default": true
          },
          "metadata": {
            "type": "object",
            "nullable": true,
            "description": "Additional metadata for the batch, such as customer ID, description, or other task management and tracking information. Up to 16 key-value pairs, each key up to 64 characters, each value up to 512 characters."
          }
        },
        "required": [
          "input_file_id",
          "endpoint"
        ]
      },
      "Batch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for the batch."
          },
          "object": {
            "type": "string",
            "description": "Object type, always 'batch'."
          },
          "endpoint": {
            "type": "string",
            "description": "API endpoint used by the batch."
          },
          "input_file_id": {
            "type": "string",
            "description": "ID of the input file used by the batch."
          },
          "completion_window": {
            "type": "string",
            "description": "The time frame within which the batch should be completed."
          },
          "status": {
            "type": "string",
            "description": "Current status of the batch."
          },
          "output_file_id": {
            "type": "string",
            "description": "File ID containing outputs of successfully executed requests."
          },
          "error_file_id": {
            "type": "string",
            "description": "File ID containing outputs of requests that encountered errors."
          },
          "created_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch was created."
          },
          "in_progress_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch started processing."
          },
          "expires_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch will expire."
          },
          "finalizing_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch started finalizing."
          },
          "completed_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch was completed."
          },
          "failed_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch failed."
          },
          "expired_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch expired."
          },
          "cancelling_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch started cancelling."
          },
          "cancelled_at": {
            "type": "integer",
            "description": "Unix timestamp (seconds) when the batch was cancelled."
          },
          "request_counts": {
            "type": "integer",
            "description": "Batch request count."
          },
          "total": {
            "type": "integer",
            "description": "Total number of requests in the batch."
          },
          "completed": {
            "type": "integer",
            "description": "Number of successfully completed requests in the batch."
          },
          "failed": {
            "type": "integer",
            "description": "Number of failed requests in the batch."
          },
          "metadata": {
            "type": "object",
            "description": "A collection of up to 16 key-value pairs attached to the object. Keys can be up to 64 characters, values up to 512 characters."
          }
        }
      },
      "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": "Unique request ID for log positioning"
          },
          "query": {
            "type": "string",
            "description": "Query content, limited to 1000 characters"
          },
          "knowledge_ids": {
            "type": "array",
            "description": "Knowledge base ID list",
            "items": {
              "type": "string"
            }
          },
          "document_ids": {
            "type": "array",
            "description": "Document ID list",
            "items": {
              "type": "string"
            }
          },
          "top_k": {
            "type": "integer",
            "description": "Final recall quantity, range [1~20], default 8"
          },
          "top_n": {
            "type": "integer",
            "description": "Initial recall quantity, range [1~100], default 10"
          },
          "recall_method": {
            "type": "string",
            "description": "Retrieval type: embedding (vector retrieval, default), keyword (keyword retrieval), mixed (mixed retrieval)"
          },
          "recall_ratio": {
            "type": "integer",
            "description": "Weight of vector retrieval in mixed retrieval, range (0~100), default 80"
          },
          "rerank_status": {
            "type": "integer",
            "description": "Whether to enable reranking: 0 (disable), 1 (enable), default disable"
          },
          "rerank_model": {
            "type": "string",
            "description": "Reranking model, supports rerank, rerank-pro"
          },
          "fractional_threshold": {
            "type": "number",
            "description": "Similarity threshold, slices below this threshold will be filtered"
          }
        },
        "required": [
          "query",
          "knowledge_ids"
        ]
      },
      "KnowledgeRetrieveResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "description": "Retrieval result list",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string",
                  "description": "Slice content"
                },
                "score": {
                  "type": "number",
                  "description": "Similarity score"
                },
                "metadata": {
                  "type": "object",
                  "description": "Slice metadata",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "description": "Slice ID"
                    },
                    "knowledge_id": {
                      "type": "string",
                      "description": "Knowledge base ID"
                    },
                    "doc_id": {
                      "type": "string",
                      "description": "Document ID"
                    },
                    "doc_name": {
                      "type": "string",
                      "description": "Document name"
                    },
                    "doc_url": {
                      "type": "string",
                      "description": "Document URL"
                    },
                    "contextual_text": {
                      "type": "string",
                      "description": "Contextual enhanced content, empty if contextual enhancement is not enabled"
                    }
                  }
                }
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "Response code, 200 for success"
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Response timestamp"
          }
        }
      },
      "ZragRetrieveRequest": {
        "type": "object",
        "properties": {
          "multimodal": {
            "type": "boolean",
            "default": true,
            "description": "Whether to use multimodal retrieval path, default is true"
          },
          "knows": {
            "type": "array",
            "description": "Knowledge base list to query",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Knowledge base ID"
                },
                "doc_ids": {
                  "type": "array",
                  "description": "Document ID list under the knowledge base",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id"
              ]
            }
          },
          "query": {
            "type": "string",
            "description": "Text query content"
          },
          "multimodal_parts": {
            "type": "array",
            "description": "Multimodal link list",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "image_url",
                    "video_url"
                  ],
                  "description": "Type: image_url, video_url"
                },
                "url": {
                  "type": "string",
                  "description": "URL link"
                }
              },
              "required": [
                "type",
                "url"
              ]
            }
          },
          "top_k": {
            "type": "integer",
            "default": 8,
            "description": "Final recall quantity, default 8"
          },
          "top_n": {
            "type": "integer",
            "default": 10,
            "description": "Initial recall quantity, default 10"
          },
          "recall_method": {
            "type": "string",
            "enum": [
              "embedding",
              "keyword",
              "mixed"
            ],
            "description": "Text retrieval method: embedding (vector retrieval), keyword (keyword retrieval), mixed (mixed retrieval)"
          },
          "recall_ratio": {
            "type": "number",
            "description": "Weight of vector retrieval in mixed retrieval, range 0~1"
          },
          "enable_rerank": {
            "type": "boolean",
            "default": false,
            "description": "Whether to enable reranking, default disabled"
          },
          "enable_rewrite": {
            "type": "boolean",
            "default": false,
            "description": "Whether to enable query rewrite, can be used with messages for multi-turn dialogue, default disabled"
          },
          "enable_expansion": {
            "type": "boolean",
            "default": false,
            "description": "Whether to enable expanded recall, default disabled"
          },
          "similarity_threshold": {
            "type": "number",
            "description": "Similarity threshold, slices below this threshold will be filtered"
          },
          "search_filters": {
            "type": "object",
            "description": "Filter conditions",
            "properties": {
              "index_types": {
                "type": "array",
                "description": "Index list",
                "items": {
                  "type": "object",
                  "properties": {
                    "know_id": {
                      "type": "string",
                      "description": "Knowledge base ID"
                    },
                    "index_type_id": {
                      "type": "integer",
                      "description": "Index ID"
                    }
                  },
                  "required": [
                    "know_id",
                    "index_type_id"
                  ]
                }
              },
              "tags": {
                "type": "array",
                "description": "Tag list",
                "items": {
                  "type": "object",
                  "properties": {
                    "tag_id": {
                      "type": "string",
                      "description": "Tag ID"
                    },
                    "value_type": {
                      "type": "string",
                      "enum": [
                        "fixed",
                        "ref"
                      ],
                      "description": "Fixed value: fixed, reference variable: ref"
                    },
                    "filter_type": {
                      "type": "integer",
                      "enum": [
                        1,
                        2,
                        3,
                        4
                      ],
                      "description": "Filter type: 1: >=, 2: <=, 3: contains, 4: not contains"
                    },
                    "filter_value": {
                      "type": "string",
                      "description": "Date/text/reference value"
                    },
                    "multiple_value": {
                      "type": "array",
                      "description": "Option value list",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "tag_id",
                    "value_type",
                    "filter_type",
                    "filter_value",
                    "multiple_value"
                  ]
                }
              },
              "qa_intervention": {
                "type": "object",
                "description": "QA intervention configuration",
                "properties": {
                  "qa_similarity_threshold": {
                    "type": "number",
                    "description": "QA intervention similarity threshold"
                  },
                  "qa_intervention_ids": {
                    "type": "array",
                    "description": "QA knowledge base ID list",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "qa_similarity_threshold",
                  "qa_intervention_ids"
                ]
              }
            }
          },
          "messages": {
            "type": "array",
            "description": "Message content, supports text, image, and video, used for multi-turn dialogue rewrite"
          }
        },
        "required": [
          "knows"
        ]
      },
      "ZragRetrieveResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "contents": {
                "type": "array",
                "description": "Retrieval result list",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Slice ID (UUID)"
                    },
                    "know_id": {
                      "type": "string",
                      "description": "Knowledge base ID"
                    },
                    "doc_id": {
                      "type": "string",
                      "description": "Document ID"
                    },
                    "text": {
                      "type": "string",
                      "description": "Text content"
                    },
                    "medias": {
                      "type": "array",
                      "description": "Media files in text",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Image ID"
                          },
                          "url": {
                            "type": "string",
                            "description": "Image URL"
                          },
                          "description": {
                            "type": "string",
                            "description": "Image description"
                          },
                          "image_url": {
                            "type": "object",
                            "description": "Image URL object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "description": "URL"
                              }
                            }
                          },
                          "video_url": {
                            "type": "object",
                            "description": "Video URL object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "description": "URL"
                              }
                            }
                          }
                        }
                      }
                    },
                    "index": {
                      "type": "integer",
                      "description": "Recall rank position"
                    },
                    "score": {
                      "type": "number",
                      "description": "Recall score"
                    },
                    "rerank_index": {
                      "type": "integer",
                      "description": "Rerank position"
                    },
                    "rerank_score": {
                      "type": "number",
                      "description": "Rerank score"
                    },
                    "metadata": {
                      "type": "object",
                      "description": "Metadata",
                      "properties": {
                        "doc_type": {
                          "type": "string",
                          "description": "Document type, e.g. pdf, docx, jpeg, png, mp4, mp3"
                        },
                        "doc_name": {
                          "type": "string",
                          "description": "Document name"
                        },
                        "doc_url": {
                          "type": "string",
                          "description": "Document URL"
                        },
                        "index": {
                          "type": "integer",
                          "description": "Slice index"
                        },
                        "page_index": {
                          "type": "integer",
                          "description": "Document page number"
                        },
                        "clip_index": {
                          "type": "integer",
                          "description": "Video clip index"
                        },
                        "start_time": {
                          "type": "integer",
                          "description": "First frame timestamp"
                        },
                        "end_time": {
                          "type": "integer",
                          "description": "Last frame timestamp"
                        },
                        "duration": {
                          "type": "integer",
                          "description": "Video clip duration"
                        },
                        "frames": {
                          "type": "array",
                          "description": "Keyframe list",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "rewritten_query": {
                "type": "object",
                "description": "Query rewrite result",
                "properties": {
                  "original_query": {
                    "type": "string",
                    "description": "Original query"
                  },
                  "multi_queries": {
                    "type": "array",
                    "description": "Alternative query list",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "elapsed_ms": {
                "type": "integer",
                "description": "Request elapsed time (milliseconds)"
              },
              "total_tokens": {
                "type": "integer",
                "description": "Total tokens consumed"
              },
              "request_id": {
                "type": "string",
                "description": "Request ID"
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "Error code, 200 for success"
          },
          "message": {
            "type": "string",
            "description": "Error message"
          }
        }
      },
      "KnowledgeCreateRequest": {
        "type": "object",
        "properties": {
          "embedding_id": {
            "type": "integer",
            "description": "知识库绑定的向量化模型ID"
          },
          "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",
            "description": "知识库绑定的向量化模型ID"
          },
          "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": "知识库描述"
          },
          "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": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "响应码，200为成功"
          },
          "message": {
            "type": "string",
            "description": "响应信息"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳"
          }
        }
      },
      "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": "array",
            "items": {
              "type": "string",
              "format": "binary"
            },
            "description": "文件数组"
          },
          "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"
          },
          "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 总数"
          }
        }
      },
      "BadRequestData": {},
      "UnauthorizedData": {},
      "NotFoundData": {},
      "Error": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "KeyValuePair": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Variable id"
          },
          "name": {
            "type": "string",
            "description": "Variable name"
          },
          "type": {
            "type": "string",
            "description": "Variable type. Input: text input, selection_list: dropdown, upload_file: file upload, upload_image: image upload, upload_video: video upload, upload_audio: audio upload"
          },
          "tips": {
            "type": "string",
            "description": "Tips"
          },
          "allowed_values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Dropdown options, present when 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": "Options"
          }
        },
        "required": [
          "options"
        ]
      },
      "ApplicationVariablesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyValuePair"
            },
            "description": "Variable list"
          },
          "code": {
            "type": "integer",
            "description": "Response code, 200 means success"
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Response timestamp"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationFileUploadSuccessInfo": {
        "type": "object",
        "properties": {
          "file_id": {
            "type": "string",
            "description": "File id"
          },
          "file_name": {
            "type": "string",
            "description": "File name"
          }
        },
        "required": [
          "file_id",
          "file_name"
        ]
      },
      "ApplicationFileUploadFailInfo": {
        "type": "object",
        "properties": {
          "file_name": {
            "type": "string",
            "description": "File name"
          },
          "fail_reason": {
            "type": "string",
            "description": "Fail reason"
          }
        },
        "required": [
          "file_name",
          "fail_reason"
        ]
      },
      "ApplicationFileUploadResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "success_info": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApplicationFileUploadSuccessInfo"
                },
                "description": "Successfully uploaded files"
              },
              "fail_info": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApplicationFileUploadFailInfo"
                },
                "description": "Failed files"
              }
            },
            "required": [
              "success_info",
              "fail_info"
            ]
          },
          "code": {
            "type": "integer",
            "description": "Response code, 200 means success"
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Response timestamp"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationConversationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "conversation_id": {
                "type": "string",
                "description": "Conversation id"
              }
            },
            "required": [
              "conversation_id"
            ]
          },
          "code": {
            "type": "integer",
            "description": "Response code, 200 means success"
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Response timestamp"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationInvokeRequest": {
        "type": "object",
        "properties": {
          "app_id": {
            "type": "string",
            "description": "Application id"
          },
          "conversation_id": {
            "type": "string",
            "description": "Conversation id, if not provided a new conversation will be created"
          },
          "third_request_id": {
            "type": "string",
            "description": "Third-party request id (for plugin calls, used for traceability)"
          },
          "stream": {
            "type": "boolean",
            "description": "Default true, false for synchronous call"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeMessage"
            },
            "description": "User input list"
          },
          "role": {
            "type": "string",
            "description": "For dialog apps: user (user input), assistant (model output)"
          },
          "send_log_event": {
            "type": "boolean",
            "description": "Whether to push process logs in real time, default false"
          }
        },
        "required": [
          "app_id",
          "messages"
        ]
      },
      "ApplicationInvokeMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "Role user/assistant"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeContent"
            },
            "description": "Content list"
          }
        },
        "required": [
          "content"
        ]
      },
      "ApplicationInvokeContent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Content type input/upload_file/upload_image/upload_video/selection_list"
          },
          "value": {
            "type": "string",
            "description": "User input / dropdown option / file ID / image or video url"
          },
          "key": {
            "type": "string",
            "description": "Field name (required for text app requests)"
          }
        },
        "required": [
          "type",
          "value"
        ]
      },
      "ApplicationInvokeResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Request id"
          },
          "conversation_id": {
            "type": "string",
            "description": "Conversation id"
          },
          "app_id": {
            "type": "string",
            "description": "Application id"
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeChoice"
            },
            "description": "Incremental return information"
          },
          "usage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInvokeUsage"
            },
            "description": "Token usage statistics for this call"
          },
          "model": {
            "type": "string",
            "description": "Inference model"
          },
          "error_msg": {
            "type": "string",
            "description": "Error message"
          }
        }
      },
      "ApplicationInvokeChoice": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "description": "Result index"
          },
          "finish_reason": {
            "type": "string",
            "description": "stop: normal end, error: failed"
          },
          "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": "Node id"
          },
          "node_name": {
            "type": "string",
            "description": "Node name"
          },
          "type": {
            "type": "string",
            "description": "Event type node_processing/tool_processing/tool_finish/node_finish"
          },
          "content": {
            "type": "string",
            "description": "Input/output content"
          },
          "time": {
            "type": "integer",
            "description": "Milliseconds"
          },
          "tool_calls": {
            "$ref": "#/components/schemas/ToolCallsData"
          }
        }
      },
      "ToolCallsData": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "function/retrieval/web_search"
          },
          "tool_calls_data": {
            "type": "object",
            "description": "Tool message/log body"
          }
        }
      },
      "MessageData": {
        "type": "object",
        "properties": {
          "msg": {
            "type": "string",
            "description": "Inference content/text/image/video/tool etc."
          },
          "type": {
            "type": "string",
            "description": "text/image/video/all_tools"
          },
          "code": {
            "type": "string",
            "description": "Code (for all_tools)"
          },
          "file": {
            "type": "string",
            "description": "File URL (for all_tools)"
          },
          "url": {
            "type": "string",
            "description": "Image/video url"
          },
          "coverUrl": {
            "type": "string",
            "description": "Video cover url"
          }
        }
      },
      "ApplicationInvokeUsage": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "Inference model"
          },
          "nodeName": {
            "type": "string",
            "description": "Node name"
          },
          "inputTokenCount": {
            "type": "integer",
            "description": "Input token count"
          },
          "outputTokenCount": {
            "type": "integer",
            "description": "Output token count"
          },
          "totalTokenCount": {
            "type": "integer",
            "description": "Total token count"
          }
        }
      },
      "ApplicationSliceInfoRequest": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "ID returned by the create conversation or text request interface"
          },
          "node_id": {
            "type": "string",
            "description": "Node id"
          }
        },
        "required": [
          "request_id",
          "node_id"
        ]
      },
      "ApplicationSliceInfoResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "document_slices": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DocumentSlices"
                },
                "description": "Knowledge slice info"
              },
              "has_old_document": {
                "type": "boolean",
                "description": "Whether there are historical documents without slice position info"
              }
            },
            "required": [
              "document_slices",
              "has_old_document"
            ]
          },
          "code": {
            "type": "integer",
            "description": "Response code, 200 means success"
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Response timestamp"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "DocumentSlices": {
        "type": "object",
        "properties": {
          "document": {
            "$ref": "#/components/schemas/DocumentInfo"
          },
          "slice_info": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SliceInfo"
            },
            "description": "Slice info"
          },
          "hide_positions": {
            "type": "boolean",
            "description": "Whether there are historical document slices without position info"
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SliceImage"
            },
            "description": "Image list"
          }
        },
        "required": [
          "document",
          "slice_info",
          "hide_positions"
        ]
      },
      "SliceImage": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Image name"
          },
          "cos_url": {
            "type": "string",
            "description": "Image url"
          }
        },
        "required": [
          "text",
          "cos_url"
        ]
      },
      "DocumentInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Knowledge unique id"
          },
          "name": {
            "type": "string",
            "description": "Knowledge name"
          },
          "url": {
            "type": "string",
            "description": "Knowledge url"
          },
          "dtype": {
            "type": "integer",
            "description": "Knowledge type"
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "dtype"
        ]
      },
      "SliceInfo": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "Knowledge unique id"
          },
          "position": {
            "$ref": "#/components/schemas/SlicePosition"
          },
          "line": {
            "type": "integer",
            "description": "Sheet row number"
          },
          "sheet_name": {
            "type": "string",
            "description": "Sheet name"
          },
          "text": {
            "type": "string",
            "description": "Slice content"
          }
        },
        "required": [
          "document_id",
          "text"
        ]
      },
      "SlicePosition": {
        "type": "object",
        "properties": {
          "x0": {
            "type": "number",
            "format": "float",
            "description": "Distance from left to row left"
          },
          "x1": {
            "type": "number",
            "format": "float",
            "description": "Distance from character top to top"
          },
          "top": {
            "type": "number",
            "format": "float",
            "description": "Distance from character top to top"
          },
          "bottom": {
            "type": "number",
            "format": "float",
            "description": "Distance from character bottom to top"
          },
          "page": {
            "type": "integer",
            "description": "Page number"
          },
          "height": {
            "type": "number",
            "format": "float",
            "description": "Page height"
          },
          "width": {
            "type": "number",
            "format": "float",
            "description": "Page width"
          }
        },
        "required": [
          "x0",
          "x1",
          "top",
          "bottom",
          "page",
          "height",
          "width"
        ]
      },
      "HistorySessionRecordResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "problems": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Recommended questions list"
              }
            },
            "required": [
              "problems"
            ]
          },
          "code": {
            "type": "integer",
            "description": "Response code, 200 means success"
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Response timestamp"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationFileStatRequest": {
        "type": "object",
        "properties": {
          "app_id": {
            "type": "string",
            "description": "Agent (application) id"
          },
          "file_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "File id list"
          }
        },
        "required": [
          "app_id",
          "file_ids"
        ]
      },
      "ApplicationFileStatResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationFileStatItem"
            },
            "description": "File parsing status list"
          },
          "code": {
            "type": "integer",
            "description": "Response code, 200 means success"
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Response timestamp"
          }
        },
        "required": [
          "data",
          "code",
          "message",
          "timestamp"
        ]
      },
      "ApplicationFileStatItem": {
        "type": "object",
        "properties": {
          "file_id": {
            "type": "string",
            "description": "File id"
          },
          "code": {
            "type": "integer",
            "description": "File parsing status code"
          },
          "msg": {
            "type": "string",
            "description": "Description"
          }
        },
        "required": [
          "file_id",
          "code",
          "msg"
        ]
      },
      "EditKnowledgeRequest": {
        "type": "object",
        "properties": {
          "knowledge_type": {
            "type": "integer",
            "description": "Knowledge slice type. 1: By title/paragraph; 2: By Q&A pair; 3: By row; 5: Custom slice; 6: By page; 7: By single slice."
          },
          "custom_separator": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Custom slice separator, only valid when knowledge_type=5, default is \n"
          },
          "sentence_size": {
            "type": "integer",
            "description": "Custom slice size, only valid when knowledge_type=5, range: 20-2000, default 300"
          },
          "callback_url": {
            "type": "string",
            "description": "Callback URL"
          },
          "callback_header": {
            "type": "object",
            "description": "Callback header k-v object"
          }
        },
        "required": [
          "knowledge_type"
        ]
      },
      "EditKnowledgeResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "description": "Message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Timestamp"
          }
        }
      },
      "KnowledgeDocumentListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "list": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/KnowledgeDocumentItem"
                }
              },
              "total": {
                "type": "integer",
                "description": "Total count"
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "description": "Message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Timestamp"
          }
        }
      },
      "KnowledgeDocumentItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Document id"
          },
          "knowledge_type": {
            "type": "integer",
            "description": "Knowledge slice type"
          },
          "custom_separator": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Custom separator"
          },
          "sentence_size": {
            "type": "integer",
            "description": "Slice size"
          },
          "length": {
            "type": "integer",
            "description": "Document length"
          },
          "word_num": {
            "type": "integer",
            "description": "Word count"
          },
          "name": {
            "type": "string",
            "description": "Document name"
          },
          "url": {
            "type": "string",
            "description": "Document URL"
          },
          "embedding_stat": {
            "type": "integer",
            "description": "Embedding status"
          },
          "failInfo": {
            "$ref": "#/components/schemas/KnowledgeDocumentFailInfo"
          }
        }
      },
      "KnowledgeDocumentFailInfo": {
        "type": "object",
        "properties": {
          "embedding_code": {
            "type": "integer",
            "description": "Embedding failure code"
          },
          "embedding_msg": {
            "type": "string",
            "description": "Embedding failure message"
          }
        }
      },
      "KnowledgeDocumentDetailResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeDocumentItem"
          },
          "code": {
            "type": "integer",
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "description": "Message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Timestamp"
          }
        }
      },
      "DeleteKnowledgeResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "description": "Message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Timestamp"
          }
        }
      },
      "UploadUrlKnowledgeRequest": {
        "type": "object",
        "properties": {
          "upload_detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UrlData"
            },
            "description": "URL list"
          },
          "knowledge_id": {
            "type": "string",
            "description": "Knowledge base id"
          }
        },
        "required": [
          "upload_detail",
          "knowledge_id"
        ]
      },
      "UrlData": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL"
          },
          "knowledge_type": {
            "type": "integer",
            "description": "Knowledge slice type"
          },
          "custom_separator": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Custom slice separator, only valid when knowledge_type=5, default is \n"
          },
          "sentence_size": {
            "type": "integer",
            "description": "Custom slice size, only valid when knowledge_type=5, range: 20-2000, default 300"
          },
          "callback_url": {
            "type": "string",
            "description": "Callback URL"
          },
          "callback_header": {
            "type": "object",
            "description": "Callback header k-v object"
          }
        },
        "required": [
          "url",
          "knowledge_type"
        ]
      },
      "UploadUrlKnowledgeResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "successInfos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "documentId": {
                      "type": "string",
                      "description": "Document id"
                    },
                    "url": {
                      "type": "string",
                      "description": "URL"
                    }
                  }
                }
              },
              "failedInfos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "URL"
                    },
                    "failReason": {
                      "type": "string",
                      "description": "Failure reason"
                    }
                  }
                }
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "description": "Message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Timestamp"
          }
        }
      },
      "ReEmbeddingRequest": {
        "type": "object",
        "properties": {
          "callback_url": {
            "type": "string",
            "description": "Callback URL"
          },
          "callback_header": {
            "type": "object",
            "description": "Callback header k-v object"
          }
        }
      },
      "ReEmbeddingResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "description": "Message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Timestamp"
          }
        }
      },
      "KnowledgeImageListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "Image index text"
                    },
                    "cos_url": {
                      "type": "string",
                      "description": "Image URL"
                    }
                  }
                }
              }
            }
          },
          "code": {
            "type": "integer",
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "description": "Message"
          },
          "timestamp": {
            "type": "integer",
            "description": "Timestamp"
          }
        }
      },
      "AgentChatRequest": {
        "type": "object",
        "required": [
          "messages"
        ],
        "properties": {
          "messages": {
            "type": "array",
            "description": "Current message list, supports multimodal content",
            "items": {
              "$ref": "#/components/schemas/AgentMessage"
            }
          },
          "model": {
            "type": "string",
            "default": "glm-5v-turbo",
            "description": "LLM model name, defaults to glm-5v-turbo"
          },
          "temperature": {
            "type": "number",
            "default": 0.7,
            "description": "Sampling temperature, defaults to 0.7"
          },
          "max_steps": {
            "type": "integer",
            "default": 10,
            "description": "Maximum reasoning steps, defaults to 10"
          },
          "retrieval": {
            "$ref": "#/components/schemas/AgentRetrieval"
          },
          "enable_rich_media": {
            "type": "boolean",
            "default": false,
            "description": "Rich media toggle. When enabled, injects MCP image cropping tool after knowledge retrieval, outputs markdown rich media responses"
          },
          "enable_thinking": {
            "type": "boolean",
            "default": false,
            "description": "Enable thinking mode. When enabled, the model outputs reasoning process via reasoning events in the stream"
          }
        }
      },
      "AgentRetrieval": {
        "type": "object",
        "description": "Retrieval preset parameters. When preset, LLM only decides whether to call retrieval without needing to fill in parameters itself",
        "properties": {
          "know_ids": {
            "type": "array",
            "description": "Knowledge base ID list",
            "items": {
              "type": "string"
            }
          },
          "top_k": {
            "type": "integer",
            "description": "Retrieval quantity"
          },
          "top_n": {
            "type": "integer",
            "description": "Recall quantity"
          },
          "enable_rerank": {
            "type": "boolean",
            "description": "Whether to enable reranking"
          },
          "enable_rewrite": {
            "type": "boolean",
            "description": "Whether to enable query rewrite"
          },
          "similarity_threshold": {
            "type": "number",
            "description": "Similarity threshold"
          },
          "backup_chat": {
            "type": "boolean",
            "description": "Whether to fall back to regular chat mode when retrieval returns no results"
          }
        }
      },
      "AgentMessage": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant",
              "tool"
            ],
            "description": "Role: system / user / assistant / tool"
          },
          "content": {
            "description": "Message content. Use String for plain text, ContentPart array for multimodal",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AgentContentPart"
                }
              }
            ]
          },
          "name": {
            "type": "string",
            "description": "Sender name"
          },
          "tool_call_id": {
            "type": "string",
            "description": "Required when role=tool, associated tool call ID"
          },
          "tool_calls": {
            "type": "array",
            "description": "Tool call list that may be included when role=assistant",
            "items": {
              "$ref": "#/components/schemas/AgentToolCallMessage"
            }
          },
          "reasoning_content": {
            "type": "string",
            "description": "Reasoning content"
          }
        }
      },
      "AgentContentPart": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image_url"
            ],
            "description": "Content type"
          },
          "text": {
            "type": "string",
            "description": "Text content (when type=text)"
          },
          "image_url": {
            "type": "object",
            "description": "Image URL (when type=image_url)",
            "properties": {
              "url": {
                "type": "string",
                "description": "Image URL address"
              }
            }
          }
        }
      },
      "AgentToolCallMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Tool call ID"
          },
          "type": {
            "type": "string",
            "description": "Type, fixed as function"
          },
          "function": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Tool name"
              },
              "arguments": {
                "type": "string",
                "description": "Tool call parameters (JSON string)"
              }
            }
          }
        }
      },
      "AgentStreamEvent": {
        "type": "object",
        "description": "A single event object in the SSE event stream",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "session_created",
              "reasoning",
              "thought",
              "tool_call",
              "tool_result",
              "answer",
              "done",
              "error"
            ],
            "description": "Event type"
          },
          "sessionId": {
            "type": "string",
            "description": "Session ID"
          },
          "messageId": {
            "type": "string",
            "description": "Message ID (only in done event)"
          },
          "data": {
            "description": "Event payload, structure depends on 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": "data structure when type=tool_call",
        "properties": {
          "callId": {
            "type": "string",
            "description": "Tool call ID"
          },
          "toolName": {
            "type": "string",
            "description": "Tool name"
          },
          "arguments": {
            "type": "object",
            "description": "Tool call parameters",
            "additionalProperties": true
          }
        }
      },
      "AgentToolResultData": {
        "type": "object",
        "description": "data structure when type=tool_result",
        "properties": {
          "callId": {
            "type": "string",
            "description": "Tool call ID"
          },
          "toolName": {
            "type": "string",
            "description": "Tool name"
          },
          "result": {
            "description": "Execution result",
            "additionalProperties": true
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "error"
            ],
            "description": "Execution status"
          },
          "durationMs": {
            "type": "integer",
            "format": "int64",
            "description": "Execution duration (milliseconds)"
          }
        }
      },
      "AgentErrorData": {
        "type": "object",
        "description": "data structure when type=error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error description"
          }
        }
      },
      "AgentUsage": {
        "type": "object",
        "description": "Token usage information (only in done event)",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "description": "Input token count"
          },
          "completion_tokens": {
            "type": "integer",
            "description": "Output token count"
          },
          "total_tokens": {
            "type": "integer",
            "description": "Total token count"
          },
          "total_calls": {
            "type": "integer",
            "description": "Total tool call count"
          },
          "prompt_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer",
                "description": "Cache hit token count"
              }
            }
          },
          "completion_tokens_details": {
            "type": "object",
            "properties": {
              "reasoning_tokens": {
                "type": "integer",
                "description": "Reasoning token count"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用以下格式进行身份验证：Bearer [<your api key>](https://bigmodel.cn/usercenter/proj-mgmt/apikeys)"
      }
    }
  }
}