{
  "openapi": "3.1.0",
  "info": {
    "title": "SeedRouter GLM-5.3",
    "version": "2026-10-29",
    "description": "Chat: Z.ai official schema. Responses: manufacturer Responses schema specialized to GLM-5.3. Messages includes protocol-reference fields not individually documented by Z.ai; live verification is pending. Text only, always-on reasoning, low/high/max effort. Official constraints are not narrowed to channel behavior."
  },
  "servers": [
    {
      "url": "https://api.seedrouter.ai"
    }
  ],
  "paths": {
    "/v1/chat/completions": {
      "post": {
        "summary": "GLM-5.3 completions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatChatCompletionTextRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Native JSON or SSE; usage contains token counts, not charges.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatChatCompletionResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Native event stream"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter or constraint."
          },
          "401": {
            "description": "Authentication required."
          }
        }
      }
    },
    "/v1/responses": {
      "post": {
        "summary": "GLM-5.3 responses",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesCreateResponseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Native JSON or SSE; usage contains token counts, not charges.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponseStreamEvent"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter or constraint."
          },
          "401": {
            "description": "Authentication required."
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "summary": "GLM-5.3 messages",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Native JSON or SSE; usage contains token counts, not charges.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Anthropic-compatible message envelope; see the reference for evidence limits."
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Native event stream"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter or constraint."
          },
          "401": {
            "description": "Authentication required."
          }
        }
      }
    },
    "/v1/responses/{response_id}": {
      "get": {
        "summary": "GLM-5.3 saved response operation",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "response_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Native saved response data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponse"
                }
              }
            }
          },
          "404": {
            "description": "Response unavailable or not owned by this account."
          }
        }
      },
      "delete": {
        "summary": "GLM-5.3 saved response operation",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "response_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Native saved response data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponseDeleted"
                }
              }
            }
          },
          "404": {
            "description": "Response unavailable or not owned by this account."
          }
        }
      }
    },
    "/v1/responses/{response_id}/input_items": {
      "get": {
        "summary": "GLM-5.3 saved response operation",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "response_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Native saved response data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesInputItemList"
                }
              }
            }
          },
          "404": {
            "description": "Response unavailable or not owned by this account."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ChatChatCompletionTextRequest": {
        "required": [
          "model",
          "messages"
        ],
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "glm-5.3",
              "glm-5.3:glm"
            ],
            "description": "Use glm-5.3 for Default. glm-5.3:glm explicitly selects the same default group."
          },
          "messages": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "user"
                      ],
                      "default": "user"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system"
                      ],
                      "default": "system"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "assistant"
                      ],
                      "default": "assistant"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "tool_calls": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "function",
                              "web_search",
                              "retrieval"
                            ]
                          },
                          "function": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "arguments": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "arguments"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      }
                    },
                    "reasoning_content": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "role"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "tool"
                      ],
                      "default": "tool"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "tool_call_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "role",
                    "content",
                    "tool_call_id"
                  ]
                }
              ]
            },
            "minItems": 1
          },
          "do_sample": {
            "type": "boolean",
            "default": true
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "thinking": {
            "$ref": "#/components/schemas/ChatChatThinking",
            "default": {
              "type": "enabled",
              "clear_thinking": true
            }
          },
          "reasoning_effort": {
            "type": "string",
            "default": "max",
            "enum": [
              "low",
              "high",
              "max"
            ]
          },
          "temperature": {
            "type": "number",
            "format": "float",
            "default": 1,
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "format": "float",
            "default": 0.95,
            "minimum": 0.01,
            "maximum": 1
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 131072
          },
          "tool_stream": {
            "type": "boolean",
            "default": false
          },
          "tools": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ChatFunctionToolSchema"
                },
                {
                  "$ref": "#/components/schemas/ChatRetrievalToolSchema"
                },
                {
                  "$ref": "#/components/schemas/ChatWebSearchToolSchema"
                }
              ]
            },
            "maxItems": 128
          },
          "tool_choice": {
            "type": "string",
            "enum": [
              "auto"
            ],
            "default": "auto"
          },
          "stop": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 4
          },
          "response_format": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text",
                  "json_object"
                ],
                "default": "text"
              }
            },
            "required": [
              "type"
            ]
          },
          "request_id": {
            "type": "string",
            "minLength": 6,
            "maxLength": 64
          },
          "user_id": {
            "type": "string",
            "minLength": 6,
            "maxLength": 128
          }
        }
      },
      "ChatChatThinking": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "enabled",
            "enum": [
              "enabled"
            ]
          },
          "clear_thinking": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ChatFunctionToolSchema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "function",
            "enum": [
              "function"
            ]
          },
          "function": {
            "$ref": "#/components/schemas/ChatFunctionObject"
          }
        },
        "required": [
          "type",
          "function"
        ],
        "additionalProperties": false
      },
      "ChatFunctionObject": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "parameters": {
            "$ref": "#/components/schemas/ChatFunctionParameters"
          }
        },
        "required": [
          "name",
          "description",
          "parameters"
        ]
      },
      "ChatFunctionParameters": {
        "type": "object",
        "additionalProperties": true
      },
      "ChatRetrievalToolSchema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "retrieval",
            "enum": [
              "retrieval"
            ]
          },
          "retrieval": {
            "$ref": "#/components/schemas/ChatRetrievalObject"
          }
        },
        "required": [
          "type",
          "retrieval"
        ],
        "additionalProperties": false
      },
      "ChatRetrievalObject": {
        "type": "object",
        "properties": {
          "knowledge_id": {
            "type": "string"
          },
          "prompt_template": {
            "type": "string"
          }
        },
        "required": [
          "knowledge_id"
        ]
      },
      "ChatWebSearchToolSchema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "web_search",
            "enum": [
              "web_search"
            ]
          },
          "web_search": {
            "$ref": "#/components/schemas/ChatWebSearchObject"
          }
        },
        "required": [
          "type",
          "web_search"
        ],
        "additionalProperties": false
      },
      "ChatWebSearchObject": {
        "type": "object",
        "properties": {
          "enable": {
            "type": "boolean"
          },
          "search_engine": {
            "type": "string",
            "enum": [
              "search_pro_jina"
            ]
          },
          "search_query": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "search_domain_filter": {
            "type": "string"
          },
          "search_recency_filter": {
            "type": "string",
            "enum": [
              "oneDay",
              "oneWeek",
              "oneMonth",
              "oneYear",
              "noLimit"
            ]
          },
          "content_size": {
            "type": "string",
            "enum": [
              "medium",
              "high"
            ]
          },
          "result_sequence": {
            "type": "string",
            "enum": [
              "before",
              "after"
            ]
          },
          "search_result": {
            "type": "boolean"
          },
          "require_search": {
            "type": "boolean"
          },
          "search_prompt": {
            "type": "string"
          }
        },
        "required": [
          "search_engine"
        ]
      },
      "ChatChatCompletionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "created": {
            "type": "integer"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "$ref": "#/components/schemas/ChatChatCompletionResponseMessage"
                },
                "finish_reason": {
                  "type": "string"
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "number"
              },
              "completion_tokens": {
                "type": "number"
              },
              "prompt_tokens_details": {
                "type": "object",
                "properties": {
                  "cached_tokens": {
                    "type": "number"
                  }
                }
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          },
          "web_search": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatWebSearchObjectResponse"
            }
          }
        }
      },
      "ChatChatCompletionResponseMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatChatCompletionResponseMessageToolCall"
            }
          }
        }
      },
      "ChatChatCompletionResponseMessageToolCall": {
        "type": "object",
        "properties": {
          "function": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "arguments": {
                "type": "object"
              }
            },
            "required": [
              "name",
              "arguments"
            ]
          },
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "ChatWebSearchObjectResponse": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          },
          "link": {
            "type": "string"
          },
          "media": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "refer": {
            "type": "string"
          },
          "publish_date": {
            "type": "string"
          }
        }
      },
      "ResponsesCreateResponseRequest": {
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "glm-5.3",
              "glm-5.3:glm"
            ],
            "description": "Use glm-5.3 for Default. glm-5.3:glm explicitly selects the same default group."
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ResponsesInputItem"
                }
              }
            ]
          },
          "instructions": {
            "type": "string"
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "temperature": {
            "type": "number",
            "format": "float",
            "minimum": 0,
            "maximum": 1,
            "default": 1,
            "multipleOf": 0.01
          },
          "top_p": {
            "type": "number",
            "format": "float",
            "minimum": 0.01,
            "maximum": 1,
            "default": 0.95,
            "multipleOf": 0.01
          },
          "max_output_tokens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 131072,
            "default": 65536
          },
          "stop": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponsesTool"
            }
          },
          "tool_choice": {
            "type": "string",
            "enum": [
              "none",
              "auto"
            ]
          },
          "reasoning": {
            "$ref": "#/components/schemas/ResponsesReasoningConfig",
            "default": {
              "effort": "max"
            }
          },
          "text": {
            "$ref": "#/components/schemas/ResponsesTextConfig"
          },
          "prompt_cache_key": {
            "type": "string"
          },
          "previous_response_id": {
            "type": "string"
          },
          "store": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ResponsesInputItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ResponsesInputMessage"
          },
          {
            "$ref": "#/components/schemas/ResponsesInputFunctionCall"
          },
          {
            "$ref": "#/components/schemas/ResponsesInputFunctionCallOutput"
          },
          {
            "$ref": "#/components/schemas/ResponsesInputReasoning"
          }
        ]
      },
      "ResponsesInputMessage": {
        "type": "object",
        "required": [
          "type",
          "role",
          "content"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "message"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "system",
              "assistant",
              "developer"
            ]
          },
          "content": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/ResponsesInputContentPart"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ResponsesInputContentPart"
                }
              }
            ]
          }
        }
      },
      "ResponsesInputContentPart": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type",
              "text"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "input_text"
                ]
              },
              "text": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type",
              "text"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "output_text"
                ]
              },
              "text": {
                "type": "string"
              }
            }
          }
        ]
      },
      "ResponsesInputFunctionCall": {
        "type": "object",
        "required": [
          "type",
          "name",
          "call_id",
          "arguments"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "function_call"
            ]
          },
          "name": {
            "type": "string"
          },
          "call_id": {
            "type": "string"
          },
          "arguments": {
            "type": "string"
          },
          "namespace": {
            "type": "string"
          }
        }
      },
      "ResponsesInputFunctionCallOutput": {
        "type": "object",
        "required": [
          "type",
          "call_id",
          "output"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "function_call_output"
            ]
          },
          "call_id": {
            "type": "string"
          },
          "output": {
            "type": "string"
          }
        }
      },
      "ResponsesInputReasoning": {
        "type": "object",
        "required": [
          "type",
          "content"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "reasoning"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/ResponsesReasoningTextPart"
          }
        }
      },
      "ResponsesReasoningTextPart": {
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "reasoning_text"
            ]
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ResponsesTool": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ResponsesFunctionTool"
          },
          {
            "$ref": "#/components/schemas/ResponsesNamespaceTool"
          },
          {
            "$ref": "#/components/schemas/ResponsesCustomTool"
          },
          {
            "$ref": "#/components/schemas/ResponsesWebSearchTool"
          }
        ]
      },
      "ResponsesFunctionTool": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "function"
            ]
          },
          "name": {
            "type": "string"
          },
          "parameters": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ResponsesNamespaceTool": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "namespace"
            ]
          },
          "name": {
            "type": "string"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponsesFunctionTool"
            }
          }
        }
      },
      "ResponsesCustomTool": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "custom"
            ]
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ResponsesWebSearchTool": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "web_search"
            ]
          }
        }
      },
      "ResponsesReasoningConfig": {
        "type": "object",
        "properties": {
          "effort": {
            "type": "string",
            "default": "max",
            "enum": [
              "low",
              "high",
              "max"
            ]
          }
        }
      },
      "ResponsesTextConfig": {
        "type": "object",
        "properties": {
          "format": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text",
                  "json_object"
                ]
              }
            }
          }
        }
      },
      "ResponsesResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "enum": [
              "response"
            ]
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "model": {
            "type": "string"
          },
          "instructions": {
            "type": "string"
          },
          "max_output_tokens": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "failed",
              "in_progress",
              "incomplete"
            ]
          },
          "temperature": {
            "type": "number",
            "format": "float"
          },
          "top_p": {
            "type": "number",
            "format": "float"
          },
          "text": {
            "$ref": "#/components/schemas/ResponsesTextConfig"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponsesTool"
            }
          },
          "error": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ResponsesResponseError"
              }
            ]
          },
          "incomplete_details": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ResponsesIncompleteDetails"
              }
            ]
          },
          "output": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponsesOutputItem"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/ResponsesUsage"
          }
        }
      },
      "ResponsesResponseError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ResponsesIncompleteDetails": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "ResponsesOutputItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ResponsesOutputMessage"
          },
          {
            "$ref": "#/components/schemas/ResponsesOutputReasoning"
          },
          {
            "$ref": "#/components/schemas/ResponsesOutputFunctionCall"
          },
          {
            "$ref": "#/components/schemas/ResponsesOutputWebSearchCall"
          }
        ]
      },
      "ResponsesOutputMessage": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "message"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "assistant"
            ]
          },
          "status": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "content": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResponsesOutputTextPart"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ResponsesOutputTextPart"
                }
              }
            ]
          }
        }
      },
      "ResponsesOutputTextPart": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "output_text"
            ]
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ResponsesOutputReasoning": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "reasoning"
            ]
          },
          "status": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "content": {
            "$ref": "#/components/schemas/ResponsesReasoningTextPart"
          }
        }
      },
      "ResponsesOutputFunctionCall": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "function_call"
            ]
          },
          "namespace": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "call_id": {
            "type": "string"
          },
          "arguments": {
            "type": "string"
          }
        }
      },
      "ResponsesOutputWebSearchCall": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "web_search_call"
            ]
          },
          "status": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "action": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "search"
                ]
              },
              "queries": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "source": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "result": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "ResponsesUsage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer"
          },
          "input_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer"
              }
            }
          },
          "output_tokens": {
            "type": "integer"
          },
          "output_tokens_details": {
            "type": "object",
            "properties": {
              "reasoning_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "ResponsesResponseStreamEvent": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ResponsesEventResponseCreated"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventResponseInProgress"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventResponseCompleted"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventResponseFailed"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventResponseIncomplete"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventOutputItemAdded"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventOutputItemDone"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventContentPartAdded"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventContentPartDone"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventOutputTextDelta"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventOutputTextDone"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventFunctionCallArgumentsDelta"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventFunctionCallArgumentsDone"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventReasoningTextDelta"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventReasoningTextDone"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventWebSearchInProgress"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventWebSearchSearching"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventWebSearchCompleted"
          },
          {
            "$ref": "#/components/schemas/ResponsesEventError"
          }
        ]
      },
      "ResponsesEventResponseCreated": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.created"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "response": {
            "$ref": "#/components/schemas/ResponsesResponse"
          }
        }
      },
      "ResponsesEventResponseInProgress": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.in_progress"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "response": {
            "$ref": "#/components/schemas/ResponsesResponse"
          }
        }
      },
      "ResponsesEventResponseCompleted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.completed"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "response": {
            "$ref": "#/components/schemas/ResponsesResponse"
          }
        }
      },
      "ResponsesEventResponseFailed": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.failed"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "response": {
            "$ref": "#/components/schemas/ResponsesResponse"
          }
        }
      },
      "ResponsesEventResponseIncomplete": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.incomplete"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "response": {
            "$ref": "#/components/schemas/ResponsesResponse"
          }
        }
      },
      "ResponsesEventOutputItemAdded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.output_item.added"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item": {
            "$ref": "#/components/schemas/ResponsesOutputItem"
          }
        }
      },
      "ResponsesEventOutputItemDone": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.output_item.done"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item": {
            "$ref": "#/components/schemas/ResponsesOutputItem"
          }
        }
      },
      "ResponsesEventContentPartAdded": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.content_part.added"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "content_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          },
          "part": {
            "$ref": "#/components/schemas/ResponsesStreamContentPart"
          }
        }
      },
      "ResponsesStreamContentPart": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "output_text",
              "reasoning_text"
            ]
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ResponsesEventContentPartDone": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.content_part.done"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "content_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          },
          "part": {
            "$ref": "#/components/schemas/ResponsesStreamContentPart"
          }
        }
      },
      "ResponsesEventOutputTextDelta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.output_text.delta"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "content_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          },
          "delta": {
            "type": "string"
          }
        }
      },
      "ResponsesEventOutputTextDone": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.output_text.done"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "content_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ResponsesEventFunctionCallArgumentsDelta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.function_call_arguments.delta"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          },
          "delta": {
            "type": "string"
          }
        }
      },
      "ResponsesEventFunctionCallArgumentsDone": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.function_call_arguments.done"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          },
          "arguments": {
            "type": "string"
          }
        }
      },
      "ResponsesEventReasoningTextDelta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.reasoning_text.delta"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          },
          "delta": {
            "type": "string"
          }
        }
      },
      "ResponsesEventReasoningTextDone": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.reasoning_text.done"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ResponsesEventWebSearchInProgress": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.web_search_call.in_progress"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          }
        }
      },
      "ResponsesEventWebSearchSearching": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.web_search_call.searching"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          }
        }
      },
      "ResponsesEventWebSearchCompleted": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "response.web_search_call.completed"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "output_index": {
            "type": "integer",
            "format": "int64"
          },
          "item_id": {
            "type": "string"
          }
        }
      },
      "ResponsesEventError": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "sequence_number": {
            "type": "integer",
            "format": "int64"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "MessagesRequest": {
        "type": "object",
        "required": [
          "model",
          "messages",
          "max_tokens"
        ],
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "glm-5.3",
              "glm-5.3:glm"
            ],
            "description": "Use glm-5.3 for Default. glm-5.3:glm explicitly selects the same default group."
          },
          "messages": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "role",
                "content"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "assistant"
                  ]
                },
                "content": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MessagesContentBlock"
                      }
                    }
                  ]
                }
              }
            }
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 131072
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "type",
                    "text"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "text"
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "cache_control": {
                      "type": "object",
                      "required": [
                        "type"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "ephemeral"
                          ]
                        },
                        "ttl": {
                          "type": "string",
                          "enum": [
                            "5m",
                            "1h"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            ]
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1
          },
          "top_k": {
            "type": "integer",
            "minimum": 0
          },
          "stop_sequences": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tools": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "object",
              "required": [
                "name",
                "input_schema"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "pattern": "^[a-zA-Z0-9_-]+$"
                },
                "input_schema": {
                  "type": "object"
                },
                "cache_control": {
                  "type": "object",
                  "required": [
                    "type"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "ephemeral"
                      ]
                    },
                    "ttl": {
                      "type": "string",
                      "enum": [
                        "5m",
                        "1h"
                      ]
                    }
                  }
                }
              }
            }
          },
          "tool_choice": {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "auto",
                  "none",
                  "any",
                  "tool"
                ]
              },
              "name": {
                "type": "string"
              },
              "disable_parallel_tool_use": {
                "type": "boolean"
              }
            }
          },
          "thinking": {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "enabled",
                  "adaptive"
                ]
              },
              "budget_tokens": {
                "type": "integer",
                "minimum": 1024,
                "maximum": 131071
              }
            }
          },
          "output_config": {
            "type": "object",
            "properties": {
              "effort": {
                "type": "string",
                "enum": [
                  "low",
                  "high",
                  "max"
                ]
              }
            }
          },
          "metadata": {
            "type": "object",
            "properties": {
              "user_id": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "cache_control": {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "ephemeral"
                ]
              },
              "ttl": {
                "type": "string",
                "enum": [
                  "5m",
                  "1h"
                ]
              }
            }
          }
        }
      },
      "MessagesContentBlock": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "thinking",
              "redacted_thinking",
              "tool_use",
              "tool_result"
            ]
          },
          "text": {
            "type": "string"
          },
          "thinking": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "input": {
            "type": "object"
          },
          "tool_use_id": {
            "type": "string"
          },
          "is_error": {
            "type": "boolean"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            ]
          },
          "cache_control": {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "ephemeral"
                ]
              },
              "ttl": {
                "type": "string",
                "enum": [
                  "5m",
                  "1h"
                ]
              }
            }
          }
        }
      },
      "ResponsesResponseDeleted": {
        "type": "object",
        "required": [
          "id",
          "object",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "enum": [
              "response"
            ]
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        }
      },
      "ResponsesInputItemList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponsesInputItem"
            }
          },
          "first_id": {
            "type": "string",
            "nullable": true
          },
          "last_id": {
            "type": "string",
            "nullable": true
          },
          "has_more": {
            "type": "boolean"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
