> ## Documentation Index
> Fetch the complete documentation index at: https://evolink.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GLM 전체 모델 인터페이스 - Responses 전체 매개변수

> Responses 형식으로 GLM의 텍스트 대화, 스트리밍, 함수 호출을 이용합니다. 이미지 이해와 웹 검색은 모델별로 제공됩니다. 아래에서 매개변수와 모델별 차이를 확인하세요.

<Note>
  **BaseURL**: 기본 BaseURL은 `https://direct.evolink.ai`이며, 텍스트 모델과 장시간 연결을 더 잘 지원합니다. `https://api.evolink.ai`는 멀티모달 서비스의 기본 엔드포인트이자 텍스트 모델의 대체 주소 역할을 합니다.
</Note>

Responses 형식으로 GLM의 텍스트 대화, 스트리밍, 함수 호출을 이용합니다. 이미지 이해와 웹 검색은 모델별로 제공됩니다. 아래에서 매개변수와 모델별 차이를 확인하세요.

## 모델과 매개변수 차이

GLM 모델을 선택합니다. 네 모델 모두 이 엔드포인트의 텍스트 입력을 지원하며 선택 기능은 모델마다 다릅니다.

| 모델 ID            | 입력       | 추론 관련 참고 사항                                                             |
| ---------------- | -------- | ----------------------------------------------------------------------- |
| `glm-5.3`        | 텍스트      | 실제 수준은 `low` / `high` / `max`입니다. 호환 값은 reasoning을 참고하세요. 사고를 끌 수 없습니다. |
| `glm-5.3-flash`  | 텍스트, 이미지 | `glm-5.3`과 같습니다. 이미지는 `input_image`를 사용합니다.                             |
| `glm-5.3-flashx` | 텍스트, 이미지 | `glm-5.3`과 같습니다. 이미지는 `input_image`를 사용합니다.                             |
| `glm-5.2`        | 텍스트      | `none`이어도 사고 토큰이 생성될 수 있으며 사고 끄기를 보장하지 않습니다.                            |

Responses는 최상위 `reasoning_effort`나 `thinking` 대신 중첩된 `reasoning.effort`를 사용합니다. 사고 사용량은 `output_tokens`에 포함됩니다. 간단한 작업에서 `reasoning_tokens=0`이 반환되어도 사고를 끌 수 있다는 뜻은 아닙니다.

추론 강도이며 `low`를 권장합니다.

**`glm-5.3` / `glm-5.3-flash` / `glm-5.3-flashx` 호환 규칙**

| 전달 값                   | 실제 사고 수준     |
| ---------------------- | ------------ |
| `low` / `high` / `max` | 해당 수준 유지     |
| `xhigh`                | `max`        |
| `medium`               | `high`       |
| `minimal` / `none`     | `low`, 사고 유지 |

**`minimal`과 `none`은 5.3 시리즈의 사고를 끄지 않습니다.** 사고 토큰은 출력으로 과금됩니다. 알 수 없는 값은 호환 변환 없이 원래 값을 유지하므로 표에 나온 값을 사용하세요. 이 규칙은 `glm-5.2`에는 적용되지 않습니다.

이 엔드포인트에서 `glm-5.2`에 `none`을 보내도 사고 토큰이 생성될 수 있으므로 사고 끄기를 보장하지 않습니다.

## 시스템 프롬프트와 여러 턴의 대화

`instructions`: 시스템 지시문입니다. `glm-5.3-flash`는 input이 문자열일 때 이 필드를 지원합니다. 메시지 배열이면 첫 번째 `role=system` 메시지에 시스템 프롬프트를 넣으세요.

```json theme={null}
{
  "model": "glm-5.3-flash",
  "input": [
    {
      "role": "system",
      "content": "간결한 한국어로 답하세요."
    },
    {
      "role": "user",
      "content": "암호 RED-583을 기억하세요"
    },
    {
      "role": "assistant",
      "content": "기억했습니다"
    },
    {
      "role": "user",
      "content": "암호가 무엇인가요? 암호만 답하세요."
    }
  ],
  "reasoning": {
    "effort": "low"
  },
  "max_output_tokens": 1024
}
```

응답을 저장하여 나중에 참조합니다. `glm-5.3-flash`와 `glm-5.3-flashx`는 `store=true` 및 `previous_response_id`로 대화를 이어갈 수 있습니다. `glm-5.2`는 응답 ID 기반 이어가기를 지원하지 않으며 `store=true`로도 활성화되지 않습니다. 대신 input에 전체 기록을 포함하세요.

이전 응답의 최상위 id입니다. `glm-5.3-flash`와 `glm-5.3-flashx`는 `store=true` 및 동일 모델에서 지원합니다. output 항목의 id가 아닌 응답 id를 그대로 전달하세요. `glm-5.2`는 이 필드에 400을 반환합니다. 모델을 바꾸는 대화에서는 이 필드를 생략하고 input에 전체 기록을 포함하세요.

## 스트리밍 응답

SSE 스트리밍을 켭니다. 본문은 `response.output_text.delta`의 delta에서 읽습니다. 성공 종료 이벤트는 `response.completed`입니다. `response.incomplete`, `response.failed` 또는 error에서도 해당 턴을 종료하고 처리하세요. \[DONE]이나 연결 종료만 기다리지 마세요.

| 이벤트                                                                       | 처리 방법                                                 |
| ------------------------------------------------------------------------- | ----------------------------------------------------- |
| `response.created` / `response.in_progress`                               | 이번 턴을 시작합니다.                                          |
| `response.output_text.delta`                                              | delta를 본문에 추가합니다.                                     |
| `response.reasoning_text.delta` / `response.reasoning_summary_text.delta` | 사고 내용을 본문과 분리하고 두 이벤트 형식을 모두 지원합니다.                   |
| `response.output_item.done`                                               | `function_call` 등 완전한 출력 항목을 수집합니다.                   |
| `response.completed`                                                      | 생성이 끝났습니다. `response.output`과 `response.usage`를 읽습니다. |
| `response.incomplete` / `response.failed` / `error`                       | 잘림 또는 오류를 처리하고 턴을 종료합니다.                              |

종료 이벤트를 받으면 읽기를 끝내세요. HTTP 200은 스트림이 열렸다는 뜻이므로 이벤트의 최종 상태를 확인해야 합니다. 도구 호출 턴이 `response.completed`로 끝나더라도 애플리케이션이 함수를 실행하고 다음 요청을 보내야 할 수 있습니다.

## 함수 호출

요청 메뉴에서 함수 호출 예시를 선택하세요. Responses 함수 정의는 중첩하지 않는 구조입니다.

```json theme={null}
{
  "type": "function",
  "name": "get_temperature",
  "description": "지정한 도시의 기온을 반환합니다",
  "parameters": {
    "type": "object",
    "properties": {
      "city": {
        "type": "string"
      }
    },
    "required": [
      "city"
    ],
    "additionalProperties": false
  }
}
```

1. `response.output`을 순회하여 `type=function_call`인 모든 항목을 찾습니다.
2. arguments JSON 문자열을 파싱·검증한 뒤 애플리케이션에서 각 함수를 실행합니다.
3. 이전 output 전체를 기록에 추가합니다. 호출마다 `function_call_output`을 넣고 원래 `call_id`와 문자열 output을 사용합니다.
4. 갱신한 기록을 다음 요청의 input으로 보냅니다. 함수 결과 반환 예시에서 이 구조를 확인할 수 있습니다.

<Note>
  `parallel_tool_calls`: 한 턴에서 여러 도구 호출을 허용할지 정합니다. false로 설정해도 함수 호출이 하나만 반환된다는 보장은 없습니다. 클라이언트는 모든 `function_call`을 순회하고 처리해야 합니다.
</Note>

## 이미지, 검색 및 JSON 출력

`glm-5.3-flash`와 `glm-5.3-flashx`에서는 사용자 메시지의 content 배열에 `input_text`와 `input_image`를 섞을 수 있습니다. `image_url`에 공개 이미지 URL 또는 Base64 Data URL을 전달하세요. `glm-5.3`과 `glm-5.2`에는 텍스트만 사용합니다.

`tools: [{"type":"web_search"}]`를 선언합니다. 검색은 서버에서 실행되며 `web_search_call`과 본문으로 결과를 반환합니다. 실제 검색 여부는 출력 항목에서 확인하세요. 검색에는 토큰 요금 외에 건당 요금이 발생할 수 있으므로 모델 가격을 참고하세요.

검색 후 대화를 이어가려면 `web_search_call`과 `message`를 포함한 이전 `output` 전체를 `input`에 추가한 다음 새 질문을 추가하세요. 원본 `id`, `status`, `action` 등의 필드를 그대로 유지하세요. 검색은 서버에서 이미 실행되었으므로 `web_search_call`에 대한 `function_call_output`은 만들 필요가 없습니다. `web_search_history` 요청 예시를 참고하세요.

`text.format.type`: 출력 형식입니다. text는 일반 텍스트, `json_object`는 JSON 객체입니다. `json_object`를 사용할 때는 프롬프트에서 유효한 JSON을 명시적으로 요청하고 클라이언트에서 파싱·검증하세요. 엄격한 JSON Schema 제약은 제공하지 않으므로 `json_schema`나 `strict=true`로 지정 구조를 보장할 수 없습니다.

## 응답과 사용량

순서가 있는 출력 항목입니다. `type=message`의 content에서 `type=output_text`인 항목의 text가 본문입니다. reasoning이 본문보다 먼저 올 수 있고 `function_call` 턴에는 본문이 없을 수도 있습니다. 항상 output\[0]만 읽지 마세요.

`output_text`: 선택적인 본문 집계 필드로, 없을 수 있습니다. 범용 클라이언트는 output을 순회해야 합니다.

message에는 `output_text`, reasoning에는 `reasoning_text`가 올 수 있습니다. 사고 내용은 `summary_text`로도 반환될 수 있습니다. 모든 reasoning 항목에 content가 있다고 가정하지 마세요.

* `usage.input_tokens`: 캐시 적중분을 포함한 전체 입력 토큰입니다. `usage.input_tokens_details.cached_tokens`: 입력 중 캐시에 적중한 토큰 수입니다. `input_tokens`에 다시 더하지 마세요. 접두사 캐시는 자동이며 명시적인 `cache_control`이 필요하지 않습니다. 적중량은 반환된 값을 기준으로 확인하세요.
* `usage.output_tokens`: 사고 토큰을 포함한 전체 출력 토큰입니다. `usage.output_tokens_details.reasoning_tokens`: 출력 중 사고에 사용된 토큰 수입니다. `output_tokens`에 중복 계산하지 마세요. 이 상세 값은 없거나 0일 수 있습니다.

`status=incomplete`이고 `incomplete_details.reason=max_output_tokens`이면 예산이 소진된 것입니다. 사고만 있고 본문이 없을 수 있으므로 출력 상한을 늘리세요.


## OpenAPI

````yaml ko/api-manual/language-series/glm/responses/responses-reference.json POST /v1/responses
openapi: 3.1.0
info:
  title: GLM 전체 모델 인터페이스 - Responses 전체 매개변수
  description: >-
    OpenAI 호환 Responses 형식으로 Zhipu GLM 시리즈를 호출합니다. glm-5.3, glm-5.3-flash,
    glm-5.3-flashx, glm-5.2를 지원하며 선택 기능은 모델마다 다릅니다.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 프로덕션 (권장)
  - url: https://api.evolink.ai
    description: 대체 URL
security:
  - bearerAuth: []
tags:
  - name: Responses
    description: GLM Responses API
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: GLM Responses API(전체 매개변수)
      description: >-
        Responses 형식으로 GLM의 텍스트 대화, 스트리밍, 함수 호출을 이용합니다. 이미지 이해와 웹 검색은 모델별로
        제공됩니다. 아래에서 매개변수와 모델별 차이를 확인하세요.
      operationId: createGLMResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              basic:
                summary: 기본 텍스트 대화
                value:
                  model: glm-5.3-flash
                  input: 한 문장으로 자신을 소개해 주세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              system_message:
                summary: 시스템 프롬프트와 메시지 배열
                value:
                  model: glm-5.3-flash
                  input:
                    - role: system
                      content: 간결한 한국어로 답하세요.
                    - role: user
                      content: 이진 탐색이란 무엇인가요?
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              stream:
                summary: SSE 스트리밍 출력
                value:
                  model: glm-5.3-flash
                  input: 한 문장으로 자신을 소개해 주세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  stream: true
              history:
                summary: 기록을 포함한 여러 턴의 대화
                value:
                  model: glm-5.3-flash
                  input:
                    - role: user
                      content: 암호 RED-583을 기억하세요
                    - role: assistant
                      content: 기억했습니다
                    - role: user
                      content: 암호가 무엇인가요? 암호만 답하세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              function:
                summary: 클라이언트 측 함수 호출
                value:
                  model: glm-5.3-flash
                  input: 베이징의 기온을 조회하세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  tools:
                    - type: function
                      name: get_temperature
                      description: 지정한 도시의 기온을 반환합니다
                      parameters:
                        type: object
                        properties:
                          city:
                            type: string
                        required:
                          - city
                        additionalProperties: false
                  tool_choice:
                    type: function
                    name: get_temperature
              function_result:
                summary: 함수 실행 결과 반환
                description: 예시의 call_id를 이전 턴에서 실제로 반환된 값으로 바꾸고 이전 output 전체를 유지하세요.
                value:
                  model: glm-5.3-flash
                  input:
                    - role: user
                      content: 베이징의 기온을 조회하세요.
                    - type: function_call
                      call_id: call_weather_demo
                      name: get_temperature
                      arguments: '{"city":"베이징"}'
                    - type: function_call_output
                      call_id: call_weather_demo
                      output: '{"city":"베이징","temperature":25}'
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  tools:
                    - type: function
                      name: get_temperature
                      description: 지정한 도시의 기온을 반환합니다
                      parameters:
                        type: object
                        properties:
                          city:
                            type: string
                        required:
                          - city
                        additionalProperties: false
                  tool_choice: none
              web_search:
                summary: 서버 측 웹 검색
                value:
                  model: glm-5.3-flash
                  input: 웹 검색으로 Python 공식 홈페이지의 제목을 찾아 제목과 출처 링크만 반환하세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  tools:
                    - type: web_search
                  tool_choice: required
              web_search_history:
                summary: 웹 검색 후 대화 이어가기
                description: >-
                  실제 요청에서는 예시의 web_search_call과 message를 이전 응답의 원본 output 항목 전체로
                  바꾼 다음 새 질문을 추가하세요. id, status, action 등의 필드를 그대로 유지하세요.
                  web_search_call에 대한 function_call_output은 만들 필요가 없습니다.
                value:
                  model: glm-5.3-flash
                  input:
                    - role: user
                      content: 웹 검색으로 Python 공식 홈페이지의 제목을 찾아 제목과 출처 링크만 반환하세요.
                    - type: web_search_call
                      id: ws_search_demo
                      status: completed
                      action:
                        type: open_page
                        url: https://www.python.org
                    - type: message
                      id: msg_search_demo
                      status: completed
                      role: assistant
                      content:
                        - type: output_text
                          text: Welcome to Python.org — https://www.python.org
                          annotations: []
                    - role: user
                      content: 이전 턴에서 찾은 홈페이지 제목은 무엇인가요? 다시 검색하지 말고 제목만 반환하세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              json_object:
                summary: JSON 객체 출력
                value:
                  model: glm-5.3-flash
                  input: city 필드 값이 Beijing인 유효한 JSON 객체만 출력하세요. Markdown은 사용하지 마세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  text:
                    format:
                      type: json_object
              image:
                summary: 이미지 이해(Flash 예시)
                description: 예시는 빨간색 PNG 이미지의 Data URL입니다.
                value:
                  model: glm-5.3-flash
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  input:
                    - role: user
                      content:
                        - type: input_text
                          text: 이미지는 단색입니다. 색상만 답하세요.
                        - type: input_image
                          image_url: >-
                            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAABK0lEQVR4nO3RMQEAMAyAsLb+PW8y8hADHOybSEfraYDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANGOsDz+EB/5Uf+TQAAAAASUVORK5CYII=
              store:
                summary: 나중에 참조할 응답 생성(Flash)
                value:
                  model: glm-5.3-flash
                  input: 암호 BLUE-728을 기억하고 기억했습니다라고만 답하세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  store: true
              previous_response:
                summary: 이전 응답 참조(Flash)
                description: >-
                  먼저 응답을 저장하는 예시를 실행하고 최상위 id를 previous_response_id에 설정하세요.
                  glm-5.2는 이 방식의 대화 이어가기를 지원하지 않습니다.
                value:
                  model: glm-5.3-flash
                  input: 앞서 말한 암호가 무엇인가요? 암호만 답하세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  previous_response_id: 이전 턴에서 반환된 응답 ID
              flashx:
                summary: GLM-5.3-FlashX 호출
                value:
                  model: glm-5.3-flashx
                  input: 한 문장으로 자신을 소개해 주세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              vision_flashx:
                summary: GLM-5.3-FlashX 이미지 입력
                value:
                  model: glm-5.3-flashx
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  input:
                    - role: user
                      content:
                        - type: input_text
                          text: 이미지는 단색입니다. 색상만 답하세요.
                        - type: input_image
                          image_url: >-
                            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAABK0lEQVR4nO3RMQEAMAyAsLb+PW8y8hADHOybSEfraYDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANGOsDz+EB/5Uf+TQAAAAASUVORK5CYII=
      responses:
        '200':
          description: >-
            생성이 완료되었거나 불완전한 결과가 반환되었습니다. status를 확인하세요. 스트리밍은 text/event-stream을
            반환합니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
              example:
                id: response_demo
                object: response
                created_at: 1789971757
                model: glm-5.3-flash
                status: completed
                output:
                  - type: message
                    id: message_demo
                    status: completed
                    role: assistant
                    content:
                      - type: output_text
                        text: 안녕하세요, GLM입니다. 대화, 글쓰기, 코딩을 도와드립니다.
                        annotations: []
                usage:
                  input_tokens: 17
                  output_tokens: 24
                  total_tokens: 41
                  input_tokens_details:
                    cached_tokens: 0
                  output_tokens_details:
                    reasoning_tokens: 0
                error: null
            text/event-stream:
              schema:
                type: string
              example: >+
                event: response.output_text.delta

                data:
                {"type":"response.output_text.delta","item_id":"message_demo","output_index":0,"content_index":0,"delta":"안녕하세요"}


                event: response.completed

                data:
                {"type":"response.completed","response":{"id":"response_demo","object":"response","created_at":1789971757,"model":"glm-5.3-flash","status":"completed","output":[{"type":"message","id":"message_demo","status":"completed","role":"assistant","content":[{"type":"output_text","text":"안녕하세요","annotations":[]}]}],"usage":{"input_tokens":17,"output_tokens":3,"total_tokens":20},"error":null}}

        '400':
          description: >-
            잘못된 요청 매개변수입니다. input 누락, reasoning 형식 오류, previous_response_id 미지원
            모델 등이 해당됩니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: API 키가 잘못되었거나 만료되었습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: 사용 가능한 크레딧이 부족합니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 요청 빈도 제한을 초과했습니다. 대기 시간을 늘려 재시도하세요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 서버 오류입니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: 서비스를 일시적으로 사용할 수 없습니다. 나중에 다시 시도하세요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ResponsesRequest:
      type: object
      properties:
        model:
          type: string
          description: >-
            GLM 모델을 선택합니다. 네 모델 모두 이 엔드포인트의 텍스트 입력을 지원하며 선택 기능은 모델마다 다릅니다.


            | 모델 ID | 입력 | 추론 관련 참고 사항 |

            | --- | --- | --- |

            | `glm-5.3` | 텍스트 | 실제 수준은 low / high / max입니다. 호환 값은 reasoning을
            참고하세요. 사고를 끌 수 없습니다. |

            | `glm-5.3-flash` | 텍스트, 이미지 | glm-5.3과 같습니다. 이미지는 input_image를
            사용합니다. |

            | `glm-5.3-flashx` | 텍스트, 이미지 | glm-5.3과 같습니다. 이미지는 input_image를
            사용합니다. |

            | `glm-5.2` | 텍스트 | none이어도 사고 토큰이 생성될 수 있으며 사고 끄기를 보장하지 않습니다. |
          enum:
            - glm-5.3
            - glm-5.3-flash
            - glm-5.3-flashx
            - glm-5.2
          default: glm-5.3-flash
          example: glm-5.3-flash
        input:
          description: >-
            필수입니다. 텍스트 문자열 또는 Responses 입력 항목 배열입니다. 배열에는 메시지, 모델 출력의 재전송 항목,
            function_call_output을 포함할 수 있습니다. 여러 턴의 대화에서는 매번 전체 기록을 보낼 수 있습니다.
            시스템 프롬프트는 첫 번째 role=system 메시지에 두는 것이 좋습니다. 이미지는 input_image를 사용하며
            glm-5.3-flash와 glm-5.3-flashx만 지원합니다. Chat Completions의 messages /
            image_url 블록 형식을 사용하지 마세요.
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/InputItem'
          example: 한 문장으로 자신을 소개해 주세요.
        max_output_tokens:
          type: integer
          minimum: 1
          description: >-
            이번 생성의 출력 토큰 상한으로, 사고 토큰도 포함합니다. 1024부터 작업에 맞게 조정하세요. 너무 작으면 사고 중에
            한도를 소진하여 본문 없이 reasoning 항목만 반환될 수 있습니다. status와 incomplete_details를
            확인하세요. 매개변수 이름은 max_tokens가 아닌 max_output_tokens입니다.
          example: 1024
        stream:
          type: boolean
          default: false
          description: >-
            SSE 스트리밍을 켭니다. 본문은 response.output_text.delta의 delta에서 읽습니다. 성공 종료
            이벤트는 response.completed입니다. response.incomplete, response.failed 또는
            error에서도 해당 턴을 종료하고 처리하세요. [DONE]이나 연결 종료만 기다리지 마세요.
        reasoning:
          type: object
          properties:
            effort:
              type: string
              description: >-
                추론 강도이며 low를 권장합니다.


                **glm-5.3 / glm-5.3-flash / glm-5.3-flashx 호환 규칙**


                | 전달 값 | 실제 사고 수준 |

                | --- | --- |

                | `low` / `high` / `max` | 해당 수준 유지 |

                | `xhigh` | `max` |

                | `medium` | `high` |

                | `minimal` / `none` | low, 사고 유지 |


                **minimal과 none은 5.3 시리즈의 사고를 끄지 않습니다.** 사고 토큰은 출력으로 과금됩니다. 알 수
                없는 값은 호환 변환 없이 원래 값을 유지하므로 표에 나온 값을 사용하세요. 이 규칙은 glm-5.2에는 적용되지
                않습니다.


                이 엔드포인트에서 glm-5.2에 none을 보내도 사고 토큰이 생성될 수 있으므로 사고 끄기를 보장하지 않습니다.
              enum:
                - max
                - xhigh
                - high
                - medium
                - low
                - minimal
                - none
              example: low
          description: >-
            Responses는 최상위 reasoning_effort나 thinking 대신 중첩된 reasoning.effort를
            사용합니다. 사고 사용량은 output_tokens에 포함됩니다. 간단한 작업에서 reasoning_tokens=0이
            반환되어도 사고를 끌 수 있다는 뜻은 아닙니다.
        instructions:
          type: string
          description: >-
            시스템 지시문입니다. glm-5.3-flash는 input이 문자열일 때 이 필드를 지원합니다. 메시지 배열이면 첫 번째
            role=system 메시지에 시스템 프롬프트를 넣으세요.
        tools:
          type: array
          items:
            $ref: '#/components/schemas/Tool'
          description: >-
            클라이언트 측 function 도구와 서버 측 web_search를 지원합니다. 함수는 name / description
            / parameters를 같은 계층에 선언하며 Chat Completions의 function 객체처럼 중첩하지 않습니다.
            애플리케이션이 function_call을 실행하고 결과를 반환합니다. web_search는 서버에서 실행되며 실제 검색에는
            토큰 요금 외에 호출당 요금이 발생할 수 있습니다. 모델 가격을 참고하세요.
        tool_choice:
          description: >-
            auto는 모델이 선택하고, none은 도구를 사용하지 않으며, required는 도구 호출을 요구합니다. 특정 함수는
            {"type":"function","name":"get_temperature"}로 지정합니다. 강제 선택 동작이 모든
            모델과 도구 조합에서 동일하게 지원되는 것은 아닙니다.
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - type: object
              properties:
                type:
                  type: string
                  const: function
                name:
                  type: string
              required:
                - type
                - name
          example: auto
        parallel_tool_calls:
          type: boolean
          description: >-
            한 턴에서 여러 도구 호출을 허용할지 정합니다. false로 설정해도 함수 호출이 하나만 반환된다는 보장은 없습니다.
            클라이언트는 모든 function_call을 순회하고 처리해야 합니다.
        text:
          type: object
          properties:
            format:
              type: object
              properties:
                type:
                  type: string
                  description: >-
                    출력 형식입니다. text는 일반 텍스트, json_object는 JSON 객체입니다.
                    json_object를 사용할 때는 프롬프트에서 유효한 JSON을 명시적으로 요청하고 클라이언트에서
                    파싱·검증하세요. 엄격한 JSON Schema 제약은 제공하지 않으므로 json_schema나
                    strict=true로 지정 구조를 보장할 수 없습니다.
                  enum:
                    - text
                    - json_object
                  example: json_object
              required:
                - type
          description: >-
            출력 형식입니다. 예시는 json_object를 사용합니다. HTTP 200이 JSON Schema 준수를 보장하지는
            않습니다.
        store:
          type: boolean
          description: >-
            응답을 저장하여 나중에 참조합니다. glm-5.3-flash와 glm-5.3-flashx는 store=true 및
            previous_response_id로 대화를 이어갈 수 있습니다. glm-5.2는 응답 ID 기반 이어가기를 지원하지
            않으며 store=true로도 활성화되지 않습니다. 대신 input에 전체 기록을 포함하세요.
        previous_response_id:
          type: string
          description: >-
            이전 응답의 최상위 id입니다. glm-5.3-flash와 glm-5.3-flashx는 store=true 및 동일
            모델에서 지원합니다. output 항목의 id가 아닌 응답 id를 그대로 전달하세요. glm-5.2는 이 필드에 400을
            반환합니다. 모델을 바꾸는 대화에서는 이 필드를 생략하고 input에 전체 기록을 포함하세요.
          example: 이전 턴에서 반환된 응답 ID
        metadata:
          type: object
          additionalProperties:
            type: string
          description: 사용자 지정 문자열 키-값 메타데이터로, 응답의 metadata에서 읽을 수 있습니다. 키나 민감한 정보를 넣지 마세요.
          example:
            conversation: demo
        temperature:
          type: number
          description: >-
            샘플링 매개변수입니다. 유효 범위와 동작은 모델에 따라 다릅니다. 결정적인 출력을 보장하지 않으며 추론 작업에서는 생략할
            수 있습니다.
        top_p:
          type: number
          description: 샘플링 매개변수입니다. 유효 범위와 동작은 모델에 따라 다르며 보통 생략할 수 있습니다.
      required:
        - model
        - input
    ResponsesResponse:
      type: object
      properties:
        id:
          type: string
          description: 이번 응답의 ID입니다. previous_response_id에 그대로 전달하세요.
          example: response_demo
        object:
          type: string
          const: response
        created_at:
          type: integer
          description: 생성 시간이며 Unix 초 단위입니다.
        model:
          type: string
          example: glm-5.3-flash
        status:
          type: string
          description: >-
            completed는 이번 턴의 생성 종료를 의미하며 도구 호출만 있을 수도 있습니다. incomplete는 출력이
            불완전함을 뜻합니다. output과 error를 함께 확인하세요.
          enum:
            - completed
            - incomplete
            - failed
            - in_progress
            - queued
        output:
          type: array
          items:
            $ref: '#/components/schemas/OutputItem'
          description: >-
            순서가 있는 출력 항목입니다. type=message의 content에서 type=output_text인 항목의 text가
            본문입니다. reasoning이 본문보다 먼저 올 수 있고 function_call 턴에는 본문이 없을 수도 있습니다.
            항상 output[0]만 읽지 마세요.
        output_text:
          type: string
          description: 선택적인 본문 집계 필드로, 없을 수 있습니다. 범용 클라이언트는 output을 순회해야 합니다.
        usage:
          $ref: '#/components/schemas/Usage'
        error:
          type:
            - object
            - 'null'
          description: 응답 오류이며 성공 시 보통 null입니다.
          additionalProperties: true
        incomplete_details:
          type: object
          properties:
            reason:
              type: string
              description: '출력이 잘린 경우의 상세 정보입니다. 예: max_output_tokens.'
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type:
                - string
                - 'null'
            code:
              type:
                - string
                - integer
                - 'null'
      required:
        - error
    InputItem:
      description: >-
        메시지, 함수 결과 또는 이전 output에서 그대로 다시 보내는 항목입니다. 도구 결과에는 반환된 call_id를 사용하고 이전
        출력 항목의 원래 필드를 유지하세요.
      oneOf:
        - $ref: '#/components/schemas/InputMessage'
        - $ref: '#/components/schemas/FunctionCallOutput'
        - type: object
          properties:
            type:
              type: string
              description: 다시 보내는 출력 항목의 유형입니다.
              enum:
                - function_call
                - reasoning
                - web_search_call
            id:
              type: string
            call_id:
              type: string
            name:
              type: string
            arguments:
              type: string
              description: JSON 문자열로 인코딩된 인수입니다.
            status:
              type: string
            action:
              type: object
              additionalProperties: true
              description: web_search_call의 검색 또는 페이지 접근 작업입니다.
          required:
            - type
    Tool:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: function
            name:
              type: string
            description:
              type: string
            parameters:
              type: object
              description: 함수 매개변수의 JSON Schema입니다.
            strict:
              type: boolean
              description: 함수 인수 제약 옵션입니다. 함수를 실행하기 전에 클라이언트에서 arguments를 파싱하고 검증해야 합니다.
          required:
            - type
            - name
            - parameters
        - type: object
          properties:
            type:
              type: string
              const: web_search
          required:
            - type
    OutputItem:
      type: object
      properties:
        type:
          type: string
          description: 일반적인 유형은 message, reasoning, function_call, web_search_call입니다.
          enum:
            - message
            - reasoning
            - function_call
            - web_search_call
        id:
          type: string
        status:
          type: string
        role:
          type: string
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
              annotations:
                type: array
                items:
                  type: object
          description: message에는 output_text, reasoning에는 reasoning_text가 올 수 있습니다.
        summary:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
          description: >-
            사고 내용은 summary_text로도 반환될 수 있습니다. 모든 reasoning 항목에 content가 있다고 가정하지
            마세요.
        call_id:
          type: string
          description: 결과를 되돌려 줄 때 사용하는 함수 호출 식별자입니다.
        name:
          type: string
          description: 함수 이름입니다.
        arguments:
          type: string
          description: 함수 인수의 JSON 문자열입니다. 실행 전에 파싱하고 검증하세요.
        action:
          type: object
          additionalProperties: true
          description: web_search_call의 검색 또는 페이지 접근 작업입니다.
      required:
        - type
    Usage:
      type: object
      properties:
        input_tokens:
          type: integer
          description: 캐시 적중분을 포함한 전체 입력 토큰입니다.
        output_tokens:
          type: integer
          description: 사고 토큰을 포함한 전체 출력 토큰입니다.
        total_tokens:
          type: integer
          description: 입력 토큰과 출력 토큰의 합계입니다.
        input_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: >-
                입력 중 캐시에 적중한 토큰 수입니다. input_tokens에 다시 더하지 마세요. 접두사 캐시는 자동이며
                명시적인 cache_control이 필요하지 않습니다. 적중량은 반환된 값을 기준으로 확인하세요.
        output_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: >-
                출력 중 사고에 사용된 토큰 수입니다. output_tokens에 중복 계산하지 마세요. 이 상세 값은 없거나 0일
                수 있습니다.
    InputMessage:
      type: object
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
        content:
          description: >-
            텍스트 문자열 또는 입력 콘텐츠 블록 배열입니다. 기존 assistant 출력을 다시 보낼 때 output_text 블록을
            그대로 유지할 수 있습니다.
          oneOf:
            - type: string
            - type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/InputText'
                  - $ref: '#/components/schemas/InputImage'
                  - $ref: '#/components/schemas/OutputText'
      required:
        - role
        - content
    FunctionCallOutput:
      type: object
      properties:
        type:
          type: string
          const: function_call_output
        call_id:
          type: string
          description: 원래 function_call의 call_id입니다.
        output:
          type: string
          description: 함수 결과이며, 보통 JSON 인코딩 문자열입니다.
      required:
        - type
        - call_id
        - output
    InputText:
      type: object
      properties:
        type:
          type: string
          const: input_text
        text:
          type: string
      required:
        - type
        - text
    InputImage:
      type: object
      properties:
        type:
          type: string
          const: input_image
        image_url:
          type: string
          description: >-
            공개 이미지 URL 또는 Base64 Data URL입니다. PNG 예: data:image/png;base64,... .
            이미지는 glm-5.3-flash / glm-5.3-flashx만 지원합니다. glm-5.3과 glm-5.2에는 텍스트만
            사용하세요.
      required:
        - type
        - image_url
    OutputText:
      type: object
      properties:
        type:
          type: string
          const: output_text
        text:
          type: string
        annotations:
          type: array
          items:
            type: object
      required:
        - type
        - text
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Authorization 헤더에 Bearer YOUR_API_KEY를 전달하세요.

````