> ## 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` 파라미터로 구체적인 모델을 선택합니다
- 필요한 파라미터는 `model`과 `messages` 두 가지뿐입니다
- 전 시리즈 1M token 컨텍스트 윈도우, 최대 출력 131,072 tokens
- 전 시리즈가 기본적으로 심층 사고를 켜며, 추론 과정은 `reasoning_content`로 반환됩니다
- 스트리밍 출력, 도구 호출, 사고 강도 조절, 이미지 입력 등의 기능은 '전체 매개변수' 페이지를 참조하세요

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


## OpenAPI

````yaml ko/api-manual/language-series/glm/chat-completions/chat-completions-quickstart.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: GLM 전체 모델 인터페이스 - Chat Completions 빠른 시작
  description: >-
    OpenAI 호환 Chat Completions API로 Zhipu GLM 시리즈 텍스트 모델을 호출하는 빠른 시작 예제입니다.
    `model`과 `messages` 두 가지 파라미터만으로 대화를 시작할 수 있으며, 전체 파라미터는 '전체 매개변수' 페이지를
    참조하세요.
  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 빠른 대화 (전체 모델)
      description: >-
        - OpenAI Chat Completions 프로토콜로 GLM 시리즈 모델을 호출하며, `model` 파라미터로 구체적인 모델을
        선택합니다

        - 필요한 파라미터는 `model`과 `messages` 두 가지뿐입니다

        - 전 시리즈 1M token 컨텍스트 윈도우, 최대 출력 131,072 tokens

        - 전 시리즈가 기본적으로 심층 사고를 켜며, 추론 과정은 `reasoning_content`로 반환됩니다

        - 스트리밍 출력, 도구 호출, 사고 강도 조절, 이미지 입력 등의 기능은 '전체 매개변수' 페이지를 참조하세요
      operationId: glmChatCompletionsQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionQuickRequest'
            examples:
              simple:
                summary: 최소 호출
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: 안녕하세요, 한 문장으로 자기소개를 해 주세요
              flash:
                summary: 경량 모델로 전환
                description: '`glm-5.3-flash`는 `glm-5.3`보다 비용이 훨씬 낮아 고빈도 호출에 적합합니다.'
                value:
                  model: glm-5.3-flash
                  messages:
                    - role: user
                      content: HTTP가 무엇인지 한 문장으로 설명해 주세요
              multi_turn:
                summary: 멀티턴 대화
                value:
                  model: glm-5.3
                  messages:
                    - role: user
                      content: 입문하기 좋은 프로그래밍 언어를 추천해 주세요
                    - role: assistant
                      content: Python을 추천합니다. 문법이 간결하고 생태계가 풍부합니다.
                    - role: user
                      content: 그걸 배우려면 대략 얼마나 걸리나요?
      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:
    ChatCompletionQuickRequest:
      title: Chat Completion Quick Request
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: >
            호출할 모델:


            | 모델 ID | 포지셔닝 |

            |---|---|

            | `glm-5.3` | 플래그십 모델, 복잡한 소프트웨어 엔지니어링과 에이전트 작업 능력이 전반적으로 향상; 1M
            컨텍스트 |

            | `glm-5.3-flash` | 경량 멀티모달 모델, 비용이 매우 낮고 이미지 입력을 기본 지원; 1M 컨텍스트 |

            | `glm-5.2` | 이전 세대 플래그십, 복잡한 추론과 초장문 컨텍스트; 1M 컨텍스트 |
          enum:
            - glm-5.3
            - glm-5.3-flash
            - glm-5.2
          default: glm-5.3
          example: glm-5.3
        messages:
          type: array
          description: 대화 메시지 목록으로, 시간 순서대로 배열합니다. 최소 1개의 메시지가 필요합니다.
          minItems: 1
          items:
            $ref: '#/components/schemas/MessageSimple'
    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'
        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: 오류 발생 시 제안
    MessageSimple:
      title: Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
          description: |-
            메시지 역할

            - `system`: 시스템 프롬프트
            - `user`: 사용자 입력
            - `assistant`: 모델 응답 (멀티턴 대화 시 포함)
          example: user
        content:
          type: string
          description: 메시지 내용 (일반 텍스트)
          example: 안녕하세요, 한 문장으로 자기소개를 해 주세요
    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: 캐시에 적중한 token 수
              example: 0
        completion_tokens_details:
          type: object
          description: 출력 token 상세 내역
          properties:
            reasoning_tokens:
              type: integer
              description: 사고 체인(심층 사고)에서 생성된 token 수, `completion_tokens`에 포함됨
              example: 321
    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
    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

        ```

````