> ## 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 전체 모델 인터페이스 - Chat Completions 전체 매개변수

> - OpenAI Chat Completions 프로토콜로 GLM 시리즈 모델을 호출하며, `model` 파라미터로 구체적인 모델을 선택합니다
- 동기 처리 모드로 대화 내용을 실시간으로 반환합니다
- **텍스트 대화**: 단일 턴 또는 멀티턴 컨텍스트 대화. `glm-5.3-flash`는 이미지 입력도 지원합니다
- **시스템 프롬프트**: `role=system` 메시지로 AI의 역할과 동작을 사용자 지정
- **심층 사고**: `thinking.type`으로 사고 체인을 제어하고 `reasoning_effort`로 추론 강도를 조절하며, 추론 과정은 `reasoning_content`로 반환됩니다
- **스트리밍 출력**: SSE 스트리밍 반환 지원(`stream=true`)
- **도구 호출**: Function Calling과 웹 검색 지원(`web_search`, 최대 128개 도구)
- **구조화 출력**: `response_format`으로 JSON 모드 활성화

**스트리밍 응답 안내**: `stream=true`이면 Server-Sent Events로 반환되며, 각 메시지 형식은 `data: {JSON}`이고 종료 시 `data: [DONE]`이 반환됩니다. 각 데이터 청크(`ChatCompletionChunk`)에는 `id`, `created`, `model`, `choices`와 선택적으로 `usage`, `content_filter`가 포함됩니다. 그중 `choices[].delta`는 `role` / `content` / `reasoning_content` / `tool_calls`를 증분으로 반환하고, `choices[].finish_reason`은 마지막 청크에서 종료 사유를 제공합니다.

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

<Note>
  **사고 제어는 모델마다 다릅니다**: `glm-5.3`과 `glm-5.3-flash`는 항상 사고하며 끌 수 없습니다. `reasoning_effort`는 `low` / `high` / `max` 세 단계가 실제로 적용되고 나머지 단계는 가장 가까운 사용 가능 단계로 자동 강등됩니다(`xhigh` → `max`, `medium` → `high`, `minimal` / `none` → `low`, 여전히 사고하며 output으로 과금). `glm-5.2`는 `thinking.type: "disabled"`로 사고를 끌 수 있고 더 많은 추론 단계를 지원합니다. 자세한 내용은 `thinking`과 `reasoning_effort` 필드 설명을 참조하세요.
</Note>

<Note>
  **이미지 입력**: `glm-5.3-flash`만 지원하며, `messages[].content[]`의 `image_url` 콘텐츠 블록으로 전달합니다. 다른 모델에 이미지 블록을 보내면 오류가 발생합니다.
</Note>


## OpenAPI

````yaml ko/api-manual/language-series/glm/chat-completions/chat-completions-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: GLM 전체 모델 인터페이스 - Chat Completions 전체 매개변수
  description: >-
    OpenAI 호환 Chat Completions API로 Zhipu GLM 시리즈 텍스트 모델을 호출하기 위한 전체 API
    레퍼런스입니다.


    **수록 모델**: `glm-5.3`, `glm-5.3-flash`, `glm-5.2` (`model` 파라미터로 선택)


    **공통 기능**:

    - 1M token 컨텍스트 윈도우, 최대 출력 **131,072 tokens**(128K), **1,024 tokens** 이상 권장

    - 심층 사고: `thinking` 필드로 사고 체인을 제어하고 `reasoning_effort`로 추론 강도를 조절하며, 추론 과정은
    `reasoning_content`로 반환됩니다

    - 도구 호출: Function Calling, 웹 검색(최대 128개 도구)

    - 스트리밍 출력: SSE 스트리밍 반환

    - 구조화 출력: `text` / `json_object` 두 가지 응답 형식

    - 컨텍스트 캐시: 암묵적 프리픽스 캐시로 동일한 프리픽스의 반복 요청이 자동 적중하며, 적중분은
    `usage.prompt_tokens_details.cached_tokens`에 반영됩니다


    **모델 간 차이**(사고 제어, 이미지 입력)는 아래 `model` 및 `thinking` / `reasoning_effort` 필드
    설명을 참조하세요.
  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: 대화 생성
    description: AI 대화 생성 관련 인터페이스
paths:
  /v1/chat/completions:
    post:
      tags:
        - 대화 생성
      summary: GLM 대화 완성 (전체 모델, OpenAI 호환)
      description: >-
        - OpenAI Chat Completions 프로토콜로 GLM 시리즈 모델을 호출하며, `model` 파라미터로 구체적인 모델을
        선택합니다

        - 동기 처리 모드로 대화 내용을 실시간으로 반환합니다

        - **텍스트 대화**: 단일 턴 또는 멀티턴 컨텍스트 대화. `glm-5.3-flash`는 이미지 입력도 지원합니다

        - **시스템 프롬프트**: `role=system` 메시지로 AI의 역할과 동작을 사용자 지정

        - **심층 사고**: `thinking.type`으로 사고 체인을 제어하고 `reasoning_effort`로 추론 강도를
        조절하며, 추론 과정은 `reasoning_content`로 반환됩니다

        - **스트리밍 출력**: SSE 스트리밍 반환 지원(`stream=true`)

        - **도구 호출**: Function Calling과 웹 검색 지원(`web_search`, 최대 128개 도구)

        - **구조화 출력**: `response_format`으로 JSON 모드 활성화


        **스트리밍 응답 안내**: `stream=true`이면 Server-Sent Events로 반환되며, 각 메시지 형식은
        `data: {JSON}`이고 종료 시 `data: [DONE]`이 반환됩니다. 각 데이터
        청크(`ChatCompletionChunk`)에는 `id`, `created`, `model`, `choices`와 선택적으로
        `usage`, `content_filter`가 포함됩니다. 그중 `choices[].delta`는 `role` /
        `content` / `reasoning_content` / `tool_calls`를 증분으로 반환하고,
        `choices[].finish_reason`은 마지막 청크에서 종료 사유를 제공합니다.
      operationId: createChatCompletionGLM
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: 단일 턴 텍스트 대화
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: 자기소개를 해 주세요
              multi_turn:
                summary: 멀티턴 대화(컨텍스트 이해)
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: Python이란 무엇인가요?
                    - role: assistant
                      content: Python은 고급 프로그래밍 언어입니다……
                    - role: user
                      content: 그 장점은 무엇인가요?
              system_prompt:
                summary: 시스템 프롬프트 사용
                value:
                  model: glm-5.3
                  messages:
                    - role: system
                      content: 당신은 전문적인 Python 프로그래밍 어시스턴트입니다. 간결한 언어로 질문에 답하세요.
                    - role: user
                      content: 파일을 어떻게 읽나요?
              deep_thinking:
                summary: 심층 사고 활성화 및 추론 강도 조절
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: >-
                        한 농부가 늑대, 양, 양배추를 데리고 강을 건너야 하는데 한 번에 하나만 옮길 수 있습니다. 어떻게
                        안전하게 건널 수 있을까요?
                  thinking:
                    type: enabled
                  reasoning_effort: max
              function_calling:
                summary: 도구 호출(Function Calling)
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: 베이징의 오늘 날씨는 어떤가요?
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: 지정한 도시의 실시간 날씨를 조회합니다
                        parameters:
                          type: object
                          properties:
                            city:
                              type: string
                              description: '도시 이름, 예: 베이징'
                          required:
                            - city
                  tool_choice: auto
              web_search:
                summary: 웹 검색 도구 활성화
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: 최근 일주일간의 인공지능 뉴스를 조회해 주세요
                  tools:
                    - type: web_search
                      web_search:
                        enable: true
                        count: 10
                        search_recency_filter: oneWeek
                description: >-
                  모델이 인터넷이 필요하다고 판단하면 자동으로 검색하며, 검색 결과는 컨텍스트에 병합되어 추론에 사용됩니다. 검색
                  결과는 입력 토큰으로 과금되고, 검색 서비스 자체는 호출 횟수에 따라 별도로 과금됩니다(자세한 내용은 가격
                  페이지를 참조하세요). 모델이 검색을 실행하지 않으면 검색 요금은 발생하지 않습니다.
              json_mode:
                summary: JSON 구조화 출력
                value:
                  model: glm-5.3
                  messages:
                    - role: system
                      content: name과 age 두 필드를 포함하여 JSON 형식으로 출력해 주세요.
                    - role: user
                      content: 홍길동, 올해 28세
                  response_format:
                    type: json_object
              streaming:
                summary: 스트리밍 출력(SSE)
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: 봄에 관한 짧은 시를 써 주세요
                  stream: true
              disable_thinking_glm52_only:
                summary: 심층 사고 비활성화 (glm-5.2만 지원)
                value:
                  model: glm-5.2
                  messages:
                    - role: user
                      content: 상대성 이론을 한 문장으로 요약해 주세요.
                  thinking:
                    type: disabled
                description: >-
                  사고를 끌 수 있는 모델은 `glm-5.2`뿐입니다. `glm-5.3`과 `glm-5.3-flash`에
                  `thinking.type: "disabled"`를 보내면 오류가 발생하므로 `reasoning_effort:
                  "low"`를 사용하세요.
              low_effort:
                summary: 사고 비용 절감 (glm-5.3 시리즈에서 사고를 끄는 대신 사용하는 방법)
                description: >-
                  `glm-5.3` 시리즈는 사고를 끌 수 없습니다. `reasoning_effort: "low"`로 추론 강도를
                  최소로 낮추세요.
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: HTTP를 한 문장으로 설명해 주세요
                  thinking:
                    type: enabled
                  reasoning_effort: low
                  max_tokens: 1024
              vision_flash:
                summary: 이미지 입력 (glm-5.3-flash 전용)
                description: >-
                  `glm-5.3-flash`는 비전을 기본 지원합니다. 이미지는 `image_url` 콘텐츠 블록으로 전달하며,
                  공개 URL 또는 Base64 데이터 URL을 사용할 수 있습니다.
                value:
                  model: glm-5.3-flash
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: 이 이미지에는 무엇이 있나요?
                        - type: image_url
                          image_url:
                            url: https://example.com/photo.jpg
                  max_tokens: 1024
      responses:
        '200':
          description: 채팅 완성이 성공적으로 생성되었습니다
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '400':
          description: 잘못된 요청 파라미터
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 400
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 인증되지 않음, 유효하지 않거나 만료된 토큰
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: 할당량 부족, 충전 필요
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota_error
                  fallback_suggestion: https://evolink.ai/dashboard/billing
        '403':
          description: 접근 거부
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Access denied for this model
                  type: permission_error
                  param: model
        '404':
          description: 리소스를 찾을 수 없음
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Specified model not found
                  type: not_found_error
                  param: model
                  fallback_suggestion: glm-5.3
        '429':
          description: 요청 빈도 초과
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
                  fallback_suggestion: retry after 60 seconds
        '500':
          description: 내부 서버 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: 업스트림 서비스 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Upstream AI service unavailable
                  type: upstream_error
                  fallback_suggestion: try different model
        '503':
          description: 서비스 일시적으로 사용 불가
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: >
            호출할 모델:


            | 모델 ID | 포지셔닝 | 사고 제어 | 이미지 입력 |

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

            | `glm-5.3` | 플래그십 모델, 복잡한 소프트웨어 엔지니어링과 에이전트 작업 능력이 전반적으로 향상되고 코딩
            능력은 이전 세대 대비 큰 폭으로 강화; 1M 컨텍스트 | 항상 사고하며 끌 수 없음. `reasoning_effort`는
            `low` / `high` / `max`만 실제로 적용되고 나머지 레벨은 자동으로 강등됨 | 미지원 |

            | `glm-5.3-flash` | 경량 멀티모달 모델, 희소 어텐션과 선형 어텐션 혼합 구조로 비용이 매우 낮고 비전을
            기본 지원; 1M 컨텍스트 | `glm-5.3`과 동일 | **지원**, `messages` 필드 참조 |

            | `glm-5.2` | 이전 세대 플래그십, 복잡한 추론과 초장문 컨텍스트; 1M 컨텍스트 |
            `thinking.type: "disabled"`로 끌 수 있음. `reasoning_effort`는 7단계 모두 지원 |
            미지원 |
          enum:
            - glm-5.3
            - glm-5.3-flash
            - glm-5.2
          default: glm-5.3
          example: glm-5.3
        messages:
          type: array
          description: >-
            대화 메시지 목록으로, 현재 대화의 완전한 컨텍스트 정보를 포함합니다


            `system`, `user`, `assistant`, `tool` 네 가지 역할을 지원합니다. 역할마다 메시지의 필드
            구조가 다르므로 해당 역할을 선택하여 확인하세요. 최소 1개의 메시지를 포함해야 하며, 시스템 메시지나 어시스턴트 메시지만
            포함할 수는 없습니다.
          items:
            oneOf:
              - $ref: '#/components/schemas/SystemMessage'
              - $ref: '#/components/schemas/UserMessage'
              - $ref: '#/components/schemas/AssistantRequestMessage'
              - $ref: '#/components/schemas/ToolMessage'
            discriminator:
              propertyName: role
              mapping:
                system:
                  $ref: '#/components/schemas/SystemMessage'
                user:
                  $ref: '#/components/schemas/UserMessage'
                assistant:
                  $ref: '#/components/schemas/AssistantRequestMessage'
                tool:
                  $ref: '#/components/schemas/ToolMessage'
          minItems: 1
        stream:
          type: boolean
          description: >-
            스트리밍 출력 모드를 활성화할지 여부


            - `false`: 모델이 완전한 응답을 생성한 후 한 번에 반환(기본값), 짧은 텍스트와 일괄 처리에 적합

            - `true`: Server-Sent Events(SSE)를 통해 청크 단위로 실시간 반환, 채팅과 장문에 적합;
            스트리밍 종료 시 `data: [DONE]`을 반환
          default: false
          example: false
        thinking:
          type: object
          description: 사고 체인(Chain of Thought)을 켤지 여부를 제어합니다
          properties:
            type:
              type: string
              description: >-
                사고 체인 스위치


                - `enabled`: 심층 사고 켜기(모든 모델의 기본 동작)

                - `disabled`: 심층 사고 끄기, 모델이 바로 답변


                **`disabled`를 지원하는 모델은 `glm-5.2`뿐입니다.** `glm-5.3`과
                `glm-5.3-flash`는 항상 사고하며, `disabled`를 보내면 오류가 발생합니다.


                `glm-5.3` 시리즈에서 사고 비용을 낮추려면 `reasoning_effort: "low"`를 사용하세요.


                **`glm-5.2`에서 마이그레이션**: 기존 코드에 `thinking.type: "disabled"`가
                하드코딩되어 있다면 `glm-5.3`으로 바꾸기 전에 `"enabled"`로 수정해야 하며(사고 비용을 낮추려면
                `reasoning_effort: "low"`를 함께 지정), 그렇지 않으면 요청이 바로 실패합니다.


                두 필드의 처리 방식이 **다르다**는 점에 유의하세요. `reasoning_effort`는 해당 시리즈가 지원하지
                않는 등급을 보내도 자동으로 강등되고 오류가 나지 않지만, `thinking.type`은 명시적 스위치라서
                `disabled`를 보내면 반드시 오류가 나며 조용히 바뀌지 않습니다. 따라서 `reasoning_effort`만
                `none`에서 `low`로 바꾸는 것으로는 부족하고 `thinking.type`도 함께 바꿔야 합니다.
              enum:
                - enabled
                - disabled
              default: enabled
            clear_thinking:
              type: boolean
              description: >-
                과거 대화 턴의 `reasoning_content`를 제거할지 여부


                - `true`(기본값): 과거 턴의 `reasoning_content`를 무시/제거하고, 추론이 아닌
                내용(사용자/어시스턴트가 볼 수 있는 텍스트, 도구 호출과 결과 등)만 컨텍스트로 사용하여 컨텍스트 길이와 비용을
                줄일 수 있습니다

                - `false`: 과거 턴의 `reasoning_content`를 유지하고 컨텍스트와 함께 모델에
                제공합니다(Preserved Thinking); 이 경우 `messages`에 과거
                `reasoning_content`를 **완전하고, 수정 없이, 원래 순서대로** 그대로 전달해야 하며, 누락,
                잘림, 변형 또는 재배열은 효과 저하나 동작 불능을 초래합니다

                - 참고: 이 파라미터는 턴 간의 과거 사고에만 영향을 주며, 현재 턴에서 사고를 생성하는지 여부는 바꾸지 않습니다
              default: true
              example: true
        reasoning_effort:
          type: string
          description: >-
            모델의 추론 강도를 제어하며, `thinking`이 켜져 있을 때만 적용되고 기본값은 `max`입니다


            **지원하는 값은 모델마다 다릅니다**:


            | 값 | `glm-5.3` / `glm-5.3-flash` | `glm-5.2` |

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

            | `max` | 심층 추론(기본값) | 심층 추론 |

            | `high` | 강화된 추론 | 강화된 추론 |

            | `low` | 경량 추론 | `high`와 동일 |

            | `xhigh` | `max`로 강등 | `max`와 동일 |

            | `medium` | `high`로 강등 | `high`와 동일 |

            | `minimal` | `low`로 강등(사고는 계속) | 사고하지 않음 |

            | `none` | `low`로 강등(사고는 계속) | 사고하지 않음 |


            `glm-5.3` 시리즈는 항상 사고하며 실제로 적용되는 값은 `low` / `high` / `max` 세 단계뿐입니다.
            나머지 네 개는 오류가 나지 않고 가장 가까운 사용 가능 단계로 자동 강등됩니다(`xhigh` → `max`,
            `medium` → `high`, `minimal` / `none` → `low`).


            **`glm-5.3` 시리즈는 사고를 끌 수 없습니다.** `minimal`이나 `none`을 보내도 최저 단계인
            `low`로 내려갈 뿐, 모델은 계속 사고 토큰을 생성하며 **output 단가로 과금**됩니다. 비용을 아끼려고 이 두
            값을 보내는 경우라면 `glm-5.2`와 다르다는 점에 유의하세요. `glm-5.2`에서는 실제로 사고를 하지 않습니다.


            프로그래밍처럼 복잡한 작업에는 `max`를 권장합니다.
          enum:
            - max
            - xhigh
            - high
            - medium
            - low
            - minimal
            - none
          default: max
          example: max
        do_sample:
          type: boolean
          description: >-
            샘플링 전략을 활성화할지 여부


            - `true`(기본값): `temperature` / `top_p`로 무작위 샘플링을 수행하여 출력이 더 다양해짐

            - `false`: 항상 확률이 가장 높은 단어를 선택(그리디 디코딩)하여 출력이 더 확정적이며, 이때
            `temperature`와 `top_p`는 무시됩니다


            일관성과 재현성이 필요한 작업(예: 코드 생성, 번역)에는 `false`로 설정하는 것을 권장합니다
          default: true
          example: true
        temperature:
          type: number
          format: float
          description: |-
            샘플링 온도로, 출력의 무작위성과 창의성을 제어합니다

            **설명**:
            - 범위: `[0.0, 1.0]`, 소수점 둘째 자리까지
            - 높은 값(예: 0.8): 더 무작위하고 창의적이며 창작 글쓰기에 적합
            - 낮은 값(예: 0.2): 더 안정적이고 확정적이며 사실 기반 질의응답과 코드 생성에 적합
            - 기본값: `1.0`

            **권장 사항**: `temperature`와 `top_p`를 동시에 조정하지 마세요
          minimum: 0
          maximum: 1
          default: 1
          example: 1
        top_p:
          type: number
          format: float
          description: >-
            핵 샘플링(Nucleus Sampling) 파라미터로, `temperature` 샘플링의 대체 방법입니다


            **설명**:

            - 범위: `[0.01, 1.0]`, 소수점 둘째 자리까지

            - 모델은 누적 확률이 `top_p`에 도달하는 후보 단어만 고려하며, 예를 들어 0.1은 상위 10% 확률의 단어만
            고려함을 의미합니다

            - 작은 값은 더 집중되고 일관된 출력을 만들며, 큰 값은 다양성을 높입니다

            - 기본값: `0.95`


            **권장 사항**: `temperature`와 `top_p`를 동시에 조정하지 마세요
          minimum: 0.01
          maximum: 1
          default: 0.95
          example: 0.95
        max_tokens:
          type: integer
          description: >-
            모델 출력의 최대 토큰 수 제한


            **설명**:

            - GLM 시리즈는 최대 **131,072 tokens**(128K) 출력 길이를 지원하며 `1024` 이상 설정을
            권장합니다

            - `thinking`이 켜져 있으면 사고 체인 토큰도 이 상한에 포함됩니다

            - `length` 사유로 생성이 잘렸다면 이 값을 높여 보세요
          minimum: 1
          maximum: 131072
          example: 1024
        tools:
          type: array
          description: >-
            모델이 호출할 수 있는 도구 목록


            **설명**:

            - 함수 호출(`function`)과 웹 검색(`web_search`)을 지원

            - 함수는 최대 128개

            - 이 중 `web_search`는 실제로 검색이 발생하면 **호출당 별도로 과금**되며, 나머지 도구는 추가 비용이
            없습니다
          items:
            oneOf:
              - $ref: '#/components/schemas/FunctionTool'
              - $ref: '#/components/schemas/WebSearchTool'
            discriminator:
              propertyName: type
              mapping:
                function:
                  $ref: '#/components/schemas/FunctionTool'
                web_search:
                  $ref: '#/components/schemas/WebSearchTool'
          maxItems: 128
        tool_choice:
          type: string
          description: >-
            모델이 어떤 함수를 호출할지 선택하는 방식을 제어합니다


            **설명**: 도구 유형이 `function`일 때만 유효하며, 기본값이자 `auto`만 지원합니다(모델이 도구 호출
            여부를 자동으로 결정)
          enum:
            - auto
          default: auto
          example: auto
        stop:
          type: array
          description: |-
            중지 단어 목록

            **설명**:
            - 모델이 생성하는 텍스트가 지정한 문자열을 만나면 즉시 생성을 중지합니다(중지 단어 자체는 반환 텍스트에 포함되지 않음)
            - 현재는 단일 중지 단어만 지원하며, 형식은 `["stop_word1"]`, 예: `["Human:"]`
          items:
            type: string
          maxItems: 4
          example:
            - 'Human:'
        response_format:
          type: object
          description: >-
            모델 응답 출력 형식을 지정하며, 기본값은 `text`입니다


            **설명**:

            - `{ "type": "json_object" }`는 JSON 모드를 활성화하며, 모델이 유효한 JSON 형식 데이터를
            반환하여 구조화 데이터 추출 등의 시나리오에 적합합니다

            - JSON 모드를 사용할 때는 `system` 또는 `user` 메시지에서 JSON 출력을 명확히 요구하는 것을
            권장합니다
          required:
            - type
          properties:
            type:
              type: string
              description: |-
                출력 형식 유형

                - `text`: 일반 텍스트 출력(기본값)
                - `json_object`: JSON 형식 출력
              enum:
                - text
                - json_object
              default: text
        request_id:
          type: string
          description: |-
            요청 고유 식별자

            **설명**:
            - 사용자 측에서 전달하며, 길이는 6-64자이고 고유성을 보장하기 위해 UUID 형식을 권장합니다
            - 제공하지 않으면 플랫폼이 자동으로 생성합니다
          minLength: 6
          maxLength: 64
          example: req-7f3a2c1e8b9d4f0a
        user_id:
          type: string
          description: >-
            최종 사용자의 고유 식별자


            **설명**: 길이는 6-128자이며, 민감한 정보를 포함하지 않는 고유 식별자 사용을 권장합니다. 플랫폼이 남용 행위를
            모니터링하고 탐지하는 데 도움이 됩니다
          minLength: 6
          maxLength: 128
          example: user-abc123456
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 작업 `ID`
          example: chatcmpl-a6613b56-c61c-94ba-9a9f-43d4cdc7d77a
        object:
          type: string
          description: 응답 유형
          enum:
            - chat.completion
          example: chat.completion
        request_id:
          type: string
          description: 요청 `ID`(요청에서 `request_id`를 제공한 경우 다시 반환)
          example: req-7f3a2c1e8b9d4f0a
        created:
          type: integer
          description: 요청 생성 시각, `Unix` 타임스탬프(초)
          example: 1777021417
        model:
          type: string
          description: 모델 이름
          example: glm-5.3
        choices:
          type: array
          description: 모델 응답 목록
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
        web_search:
          type: array
          description: 웹 검색 관련 정보, `web_search` 도구를 사용하고 검색에 적중했을 때 반환
          items:
            $ref: '#/components/schemas/WebSearchResult'
        content_filter:
          type: array
          description: 콘텐츠 안전 관련 정보
          items:
            $ref: '#/components/schemas/ContentFilter'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP 상태 오류 코드
            message:
              type: string
              description: 오류 설명 정보
            type:
              type: string
              description: 오류 유형
            param:
              type: string
              description: 관련 매개변수 이름
            fallback_suggestion:
              type: string
              description: 오류 발생 시 제안
    SystemMessage:
      title: System Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
          description: 역할 식별자, `system`으로 고정
        content:
          type: string
          description: 시스템 프롬프트 내용, AI의 역할과 동작을 설정하는 데 사용
    UserMessage:
      title: User Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
          description: 역할 식별자, `user`로 고정
        content:
          description: |-
            사용자 메시지 내용입니다.

            - **문자열**: 일반 텍스트, 모든 모델이 지원
            - **콘텐츠 블록 배열**: 텍스트와 이미지 혼합, **`glm-5.3-flash`만 지원**

            `glm-5.3`이나 `glm-5.2`에 이미지 콘텐츠 블록을 보내면 오류가 발생합니다.
          oneOf:
            - type: string
              title: 순수 텍스트
              description: 순수 텍스트 메시지 내용
              example: 안녕하세요, 자기소개를 해 주세요
            - type: array
              title: 콘텐츠 블록 배열 (glm-5.3-flash 전용)
              description: >-
                텍스트와 이미지 혼합. 이미지는 `image_url` 블록으로 전달하며 공개 URL(권장) 또는 Base64 데이터
                URL을 사용할 수 있습니다. 여러 장이면 `image_url` 블록을 여러 개 넣습니다.
              items:
                $ref: '#/components/schemas/ContentPart'
    AssistantRequestMessage:
      title: Assistant Message
      type: object
      description: 어시스턴트 메시지, 도구 호출을 포함할 수 있음
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - assistant
          description: 역할 식별자, `assistant`로 고정
        content:
          type:
            - string
            - 'null'
          description: >-
            어시스턴트 메시지 내용


            **설명**: 멀티턴 대화에서 과거 어시스턴트 응답을 전달하는 데 사용; `tool_calls`가 존재할 때는 보통
            `null`입니다
        reasoning_content:
          type:
            - string
            - 'null'
          description: >-
            과거 사고 체인 내용


            **설명**: `thinking.clear_thinking=false`(Preserved Thinking)일 때만
            필요하며, 이전 턴 응답의 `reasoning_content`를 그대로 다시 전달;
            기본값(`clear_thinking=true`)에서는 다시 전달할 필요가 없습니다
        tool_calls:
          type: array
          description: |-
            도구 호출 목록

            멀티턴 대화에서 과거 도구 호출 정보를 전달하는 데 사용; 이 필드를 제공할 때 `content`는 보통 비어 있습니다
          items:
            type: object
            required:
              - id
              - type
            properties:
              id:
                type: string
                description: 도구 호출 ID
              type:
                type: string
                enum:
                  - function
                  - web_search
                description: 도구 유형
              function:
                type: object
                description: 함수 호출 정보, `type`이 `function`일 때 비어 있지 않음
                required:
                  - name
                  - arguments
                properties:
                  name:
                    type: string
                    description: 함수 이름
                  arguments:
                    type: string
                    description: 함수 인자(JSON 형식 문자열)
    ToolMessage:
      title: Tool Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - tool
          description: 역할 식별자, `tool`로 고정
        content:
          type: string
          description: 도구 호출 반환 결과 내용
        tool_call_id:
          type: string
          description: >-
            이 메시지에 대응하는 도구 호출 `ID`를 가리킵니다(assistant 메시지의 `tool_calls`에서 반환된
            `id`에 대응)
    FunctionTool:
      title: Function 도구
      type: object
      required:
        - type
        - function
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - function
          default: function
          description: 도구 유형, `function`으로 고정
        function:
          type: object
          required:
            - name
            - description
            - parameters
          properties:
            name:
              type: string
              description: >-
                호출할 함수 이름


                **설명**: `a-z`, `A-Z`, `0-9` 문자로 구성하거나 밑줄과 하이픈을 포함해야 합니다; 최대 길이는
                64자입니다
              minLength: 1
              maxLength: 64
              pattern: ^[a-zA-Z0-9_-]+$
            description:
              type: string
              description: 함수 기능 설명, 모델이 언제 어떻게 함수를 호출할지 선택하는 데 사용
            parameters:
              type: object
              description: 함수의 입력 파라미터, JSON Schema 객체로 기술
    WebSearchTool:
      title: Web Search 도구(웹 검색)
      type: object
      required:
        - type
        - web_search
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - web_search
          default: web_search
          description: 도구 유형, `web_search`로 고정
        web_search:
          type: object
          required:
            - enable
          properties:
            enable:
              type: boolean
              description: 검색 기능을 활성화할지 여부, 활성화 시 `true`로 설정
              default: false
            search_query:
              type: string
              description: 검색을 강제로 트리거하는 사용자 정의 키워드
            search_intent:
              type: boolean
              description: |-
                검색 의도 인식을 수행할지 여부, 기본적으로 수행

                - `true`: 검색 의도 인식을 수행하고, 검색 의도가 있으면 검색을 실행
                - `false`: 의도 인식을 건너뛰고 검색을 바로 실행
            count:
              type: integer
              description: >-
                반환할 결과 개수로, 범위는 `1-50`, 기본값은 `10`입니다.


                개수는 비용에 직접 영향을 줍니다. 검색 결과는 `prompt_tokens`에 병합되어 입력 단가로 과금되며,
                `50`으로 설정하면 한 번의 입력이 2만 토큰 규모에 이를 수 있습니다. 더 넓은 검색 범위가 꼭 필요한 경우가
                아니라면 기본값을 유지하세요.
              minimum: 1
              maximum: 50
              default: 10
            search_domain_filter:
              type: string
              description: '검색 결과를 제한하는 도메인 화이트리스트(예: `www.example.com`)'
            search_recency_filter:
              type: string
              description: 검색 결과의 시간 범위를 제한, 기본값 `noLimit`
              enum:
                - oneDay
                - oneWeek
                - oneMonth
                - oneYear
                - noLimit
              default: noLimit
            content_size:
              type: string
              description: |-
                웹페이지 요약의 글자 수를 제어, 기본값 `medium`

                - `medium`: 요약 정보를 반환하여 기본 추론 요구를 충족
                - `high`: 컨텍스트를 최대화하여 정보가 더 상세함
              enum:
                - medium
                - high
              default: medium
            result_sequence:
              type: string
              description: 검색 결과를 반환하는 위치(모델 응답의 앞 또는 뒤), 기본값 `after`
              enum:
                - before
                - after
              default: after
            search_result:
              type: boolean
              description: >-
                검색 출처의 상세 정보를 응답에 포함할지 여부이며 기본값은 `false`입니다.


                `true`로 설정하면 응답 최상위에 `web_search` 배열이 붙어 이번에 검색된 출처(제목, 링크, 매체
                출처, 게시 시간, 요약 등)를 나열합니다. 기본값을 유지하면 응답에 이 필드가 포함되지 않습니다.


                이 파라미터는 응답 내용에만 영향을 주며, 검색 실행 여부나 과금에는 영향을 주지 않습니다.
              default: false
              example: true
            require_search:
              type: boolean
              description: 검색 결과를 기반으로만 답변을 반환하도록 강제할지 여부, 기본값 `false`
              default: false
            search_prompt:
              type: string
              description: 검색 결과 처리를 사용자 정의하는 데 사용하는 `Prompt`, 전달하지 않으면 기본 템플릿을 사용합니다
      description: >-
        웹 검색 도구입니다. 활성화하면 모델이 필요할 때 인터넷을 검색해 결과를 컨텍스트에 병합합니다.


        **과금**: 컨텍스트에 병합된 검색 결과 부분은 `prompt_tokens`로 입력 단가에 포함됩니다. 검색 서비스 자체는
        **호출 횟수에 따라 별도로 과금**되며 토큰 사용량과 분리해 정산합니다(자세한 내용은 가격 페이지를 참조하세요). 검색 실행
        여부는 검색 의도에 따라 모델이 판단하며, 검색이 발생하지 않으면 이 요금은 부과되지 않습니다.
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: 결과 인덱스
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: |-
            추론 종료 사유

            - `stop`: 자연스러운 종료 또는 중지 단어 트리거
            - `tool_calls`: 모델이 함수(도구 호출)에 적중
            - `length`: token 길이 제한 도달
            - `sensitive`: 콘텐츠가 안전 심사에 의해 차단됨(판단하여 공개 콘텐츠 철회 여부를 결정하세요)
            - `network_error`: 모델 추론 이상
            - `model_context_window_exceeded`: 모델 컨텍스트 윈도우 초과
          enum:
            - stop
            - tool_calls
            - length
            - sensitive
            - network_error
            - model_context_window_exceeded
          example: stop
    Usage:
      type: object
      description: 호출 종료 시 반환되는 Token 사용 통계
      properties:
        prompt_tokens:
          type: integer
          description: 사용자 입력의 token 수
          example: 24
        completion_tokens:
          type: integer
          description: 출력의 token 수(사고 체인 `reasoning_tokens` 부분 포함)
          example: 346
        total_tokens:
          type: integer
          description: token 총수 = prompt_tokens + completion_tokens
          example: 370
        prompt_tokens_details:
          type: object
          description: 입력 token 상세 내역
          properties:
            cached_tokens:
              type: integer
              description: >-
                컨텍스트 캐시에 적중한 입력 토큰 수입니다.


                GLM 시리즈는 **암묵적 프리픽스 캐시**를 사용합니다. 동일한 프리픽스의 반복 요청은 추가 파라미터 없이
                자동으로 적중하며, 적중한 부분은 캐시 단가로 과금되어 미적중 입력 단가보다 훨씬 저렴합니다. 첫 요청은 0이고
                이후 같은 프리픽스 요청부터 적중합니다.
              example: 0
        completion_tokens_details:
          type: object
          description: 출력 token 상세 내역
          properties:
            reasoning_tokens:
              type: integer
              description: 사고 체인(심층 사고)에서 생성된 token 수, `completion_tokens`에 포함됨
              example: 321
    WebSearchResult:
      type: object
      description: 단일 웹 검색 결과
      properties:
        icon:
          type: string
          description: 출처 사이트의 아이콘
        title:
          type: string
          description: 검색 결과의 제목
        link:
          type: string
          description: 검색 결과의 웹페이지 링크
        media:
          type: string
          description: 검색 결과 웹페이지의 미디어 출처 이름
        publish_date:
          type: string
          description: 사이트 게시 시각
        content:
          type: string
          description: 검색 결과 웹페이지에서 인용한 텍스트 내용
        refer:
          type: string
          description: 각주 번호
    ContentFilter:
      type: object
      description: 콘텐츠 안전 정보
      properties:
        role:
          type: string
          description: |-
            안전이 적용되는 단계

            - `assistant`: 모델 추론
            - `user`: 사용자 입력
            - `history`: 과거 컨텍스트
          enum:
            - assistant
            - user
            - history
        level:
          type: integer
          description: 심각도 `0-3`, `0`은 가장 심각함을, `3`은 경미함을 의미
          minimum: 0
          maximum: 3
    ContentPart:
      title: Content Part
      type: object
      description: 멀티모달 콘텐츠 블록입니다. **이미지 블록은 `glm-5.3-flash`만 지원합니다.**
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - text
            - image_url
          description: |-
            콘텐츠 블록 유형

            - `text`: 텍스트
            - `image_url`: 이미지 (`glm-5.3-flash` 전용)
        text:
          type: string
          description: 텍스트 내용, `type=text`일 때 필수
          example: 이 이미지에는 무엇이 있나요?
        image_url:
          type: object
          description: 이미지 내용, `type=image_url`일 때 필수
          required:
            - url
          properties:
            url:
              type: string
              description: >-
                이미지 주소. 공개 HTTPS URL(권장) 또는 Base64 데이터
                URL(`data:image/png;base64,...`)을 지원
              example: https://example.com/photo.jpg
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 현재 대화 역할, 기본값 `assistant`
          enum:
            - assistant
          example: assistant
        content:
          type:
            - string
            - 'null'
          description: >-
            대화 텍스트 내용


            **설명**: 도구를 호출(`tool_calls`)할 때는 `null`일 수 있으며, 그렇지 않으면 모델 응답 내용을
            반환합니다
          example: 안녕하세요! 저는 GLM-5.3으로, 대화, 추론, 작문, 코딩 등 다양한 작업을 도와드릴 수 있습니다.
        reasoning_content:
          type: string
          description: |-
            사고 체인 내용

            **설명**: `thinking`이 켜진 경우 반환되며, 모델의 추론 과정을 기록합니다
          example: 먼저 이 문제를 분석해 보겠습니다……
        tool_calls:
          type: array
          description: 생성된 도구 호출 정보(모델이 도구를 호출하기로 결정했을 때 반환)
          items:
            type: object
            properties:
              id:
                type: string
                description: 도구 호출의 고유 식별자
              type:
                type: string
                description: 도구 호출 유형
                enum:
                  - function
              function:
                type: object
                description: 함수 호출 정보(생성된 함수 이름과 JSON 형식 인자를 포함)
                properties:
                  name:
                    type: string
                    description: 생성된 함수 이름
                  arguments:
                    type: string
                    description: 함수 호출 인자의 JSON 형식 문자열, 함수를 호출하기 전에 인자를 검증하세요
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ##모든 인터페이스는 Bearer Token 인증이 필요합니다##


        **API Key 발급**:


        [API Key 관리 페이지](https://evolink.ai/dashboard/keys)에 방문하여 API Key를
        발급받으세요


        **요청 헤더에 추가**:

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````