> ## 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 빠른 시작

> model과 input으로 GLM을 호출합니다. 지원 모델은 glm-5.3, glm-5.3-flash, glm-5.3-flashx, glm-5.2입니다. 사고와 본문을 위한 여유를 두도록 max_output_tokens를 1024 이상으로 설정하는 것이 좋습니다.

추가 예시와 모델별 차이는 [전체 매개변수 문서](./responses-reference)를 참고하세요.

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

POST /v1/responses를 사용하고 model로 모델을 선택합니다. 필수 필드는 model과 input입니다. 예시에는 바로 시작할 수 있도록 출력 예산과 추론 강도도 설정되어 있습니다.

<Warning>
  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`을 보내도 사고 토큰이 생성될 수 있으므로 사고 끄기를 보장하지 않습니다.
</Warning>

## 본문 읽기

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

응답 JSON을 response로 파싱한 후 다음과 같이 본문을 추출할 수 있습니다.

```python theme={null}
text = "".join(
    part["text"]
    for item in response.get("output", [])
    if item.get("type") == "message"
    for part in item.get("content", [])
    if part.get("type") == "output_text"
)
print(text)
```

<Note>
  이번 생성의 출력 토큰 상한으로, 사고 토큰도 포함합니다. 1024부터 작업에 맞게 조정하세요. 너무 작으면 사고 중에 한도를 소진하여 본문 없이 reasoning 항목만 반환될 수 있습니다. status와 `incomplete_details`를 확인하세요. 매개변수 이름은 `max_tokens`가 아닌 `max_output_tokens`입니다.
</Note>

도구 호출, 이미지 입력, SSE 처리, 여러 턴의 대화는 [전체 매개변수 문서](./responses-reference)를 참고하세요.


## OpenAPI

````yaml ko/api-manual/language-series/glm/responses/responses-quickstart.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 빠른 시작
      description: >-
        model과 input으로 GLM을 호출합니다. 지원 모델은 glm-5.3, glm-5.3-flash,
        glm-5.3-flashx, glm-5.2입니다. 사고와 본문을 위한 여유를 두도록 max_output_tokens를 1024
        이상으로 설정하는 것이 좋습니다.


        추가 예시와 모델별 차이는 [전체 매개변수 문서](./responses-reference)를 참고하세요.
      operationId: glmResponsesQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesQuickRequest'
            examples:
              basic:
                summary: 기본 텍스트 대화
                value:
                  model: glm-5.3-flash
                  input: 한 문장으로 자신을 소개해 주세요.
                  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
              flashx:
                summary: GLM-5.3-FlashX 호출
                value:
                  model: glm-5.3-flashx
                  input: 한 문장으로 자신을 소개해 주세요.
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
      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:
    ResponsesQuickRequest:
      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이
            반환되어도 사고를 끌 수 있다는 뜻은 아닙니다.
      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
    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를 전달하세요.

````