> ## 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.

# Grok 전체 모델 인터페이스 - Chat Completions 전체 매개변수

> - xAI Grok 텍스트 모델용 OpenAI 호환 Chat Completions 엔드포인트. 모델은 `model` 매개변수로 선택 (전체 값은 `model` 매개변수의 대조표 참조)
- `grok-4.5`: 컨텍스트 윈도우 500K 토큰. 프롬프트가 200K 토큰 이상이면 모든 토큰 유형이 2배 요금으로 과금됩니다
- 프롬프트 캐싱은 자동 적용: 캐시에 적중한 입력 토큰은 더 저렴한 캐시 입력 요금으로 과금됩니다
- 동기 및 스트리밍(SSE) 모드 지원
- 일반 `function` 도구 호출 지원. xAI 서버 측 도구는 [Responses API](../responses/responses-reference)에서만 사용할 수 있습니다

<Note>
  **BaseURL**: 기본 BaseURL은 `https://direct.evolink.ai`이며, 텍스트 모델 지원이 더 우수하고 장시간 연결을 지원합니다. `https://api.evolink.ai`는 멀티모달 서비스의 주력 엔드포인트이며, 텍스트 모델에 대해서는 대체 주소로 사용됩니다.
</Note>

<Note>
  **서버 측 도구**(웹 검색, X 검색, 코드 실행, 첨부 파일 검색, 컬렉션 검색)는 [Responses API](../responses/responses-reference)에서만 사용할 수 있습니다. Chat Completions 엔드포인트는 일반 `function` 도구 호출만 지원합니다.
</Note>


## OpenAPI

````yaml ko/api-manual/language-series/grok/chat-completions/chat-completions-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Grok 전체 모델 인터페이스 - Chat Completions 전체 매개변수
  description: OpenAI 호환 Chat Completions API로 xAI Grok 텍스트 모델을 호출하기 위한 전체 매개변수 레퍼런스입니다.
  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: Chat Completion
    description: AI 채팅 완성 관련 API
paths:
  /v1/chat/completions:
    post:
      tags:
        - 채팅 완성
      summary: Grok 대화 완성 (전체 모델, 전체 매개변수)
      description: >-
        - xAI Grok 텍스트 모델용 OpenAI 호환 Chat Completions 엔드포인트. 모델은 `model` 매개변수로
        선택 (전체 값은 `model` 매개변수의 대조표 참조)

        - `grok-4.5`: 컨텍스트 윈도우 500K 토큰. 프롬프트가 200K 토큰 이상이면 모든 토큰 유형이 2배 요금으로
        과금됩니다

        - 프롬프트 캐싱은 자동 적용: 캐시에 적중한 입력 토큰은 더 저렴한 캐시 입력 요금으로 과금됩니다

        - 동기 및 스트리밍(SSE) 모드 지원

        - 일반 `function` 도구 호출 지원. xAI 서버 측 도구는 [Responses
        API](../responses/responses-reference)에서만 사용할 수 있습니다
      operationId: grokChatCompletionsReference
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
      responses:
        '200':
          description: >-
            채팅 완성이 성공적으로 생성되었습니다 (JSON 객체, 또는 `stream=true`인 경우
            `chat.completion.chunk` 이벤트의 SSE 스트림)
          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
        '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
        '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 | 포지셔닝 |
            |---|---|
            | `grok-4.5` | xAI 추론 + 도구 호출 모델, 컨텍스트 윈도우 500K |
          enum:
            - grok-4.5
          example: grok-4.5
        messages:
          type: array
          description: 채팅 메시지 목록. `system`, `user`, `assistant` 역할을 지원합니다.
          items:
            $ref: '#/components/schemas/Message'
          minItems: 1
          example:
            - role: system
              content: You are a concise assistant.
            - role: user
              content: Explain prompt caching in one sentence.
        stream:
          type: boolean
          description: 스트리밍으로 응답을 반환할지 여부 (SSE, `chat.completion.chunk` 이벤트). 기본값 `false`.
          default: false
          example: false
        max_tokens:
          type: integer
          description: 생성할 최대 토큰 수. 모델에 그대로 전달됩니다.
          example: 1024
        temperature:
          type: number
          description: 샘플링 온도 (0-2). 값이 클수록 출력이 더 무작위해집니다.
          example: 0.7
        top_p:
          type: number
          description: Nucleus 샘플링 매개변수 (0-1).
          example: 0.95
        tools:
          type: array
          description: >-
            일반 OpenAI `function` 도구 정의 (클라이언트 측 함수 호출, 호출당 추가 요금 없음). xAI 서버 측
            도구는 Responses API에서만 사용할 수 있습니다.
          items:
            $ref: '#/components/schemas/FunctionTool'
        tool_choice:
          description: '함수 선택을 제어합니다: `"auto"` / `"none"` / `"required"`, 또는 특정 함수를 지정하는 객체.'
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - type: object
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 채팅 완성의 고유 식별자
          example: chatcmpl-20260812164515123456789AbCdEfGh
        model:
          type: string
          description: 실제 사용된 모델 이름
          example: grok-4.5
        object:
          type: string
          enum:
            - chat.completion
          description: 응답 유형
          example: chat.completion
        created:
          type: integer
          description: 생성 타임스탬프
          example: 1786538000
        choices:
          type: array
          description: 채팅 완성 선택지 목록
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    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: 오류 발생 시 제안
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: 메시지 역할
          enum:
            - system
            - user
            - assistant
        content:
          type: string
          description: 메시지 내용
    FunctionTool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          enum:
            - function
          description: 도구 유형. Chat Completions 엔드포인트는 `function`만 허용합니다
        function:
          type: object
          description: '함수 정의: `name`, `description` 및 JSON Schema 형식의 `parameters` 객체'
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: 선택 인덱스
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: 종료 이유
          enum:
            - stop
            - length
            - tool_calls
            - content_filter
          example: stop
    Usage:
      type: object
      description: 토큰 사용 통계. 프롬프트가 200K 토큰 이상이면 모든 토큰 유형(입력, 캐시 입력, 출력)이 2배로 과금됩니다.
      properties:
        prompt_tokens:
          type: integer
          description: 입력 콘텐츠의 토큰 수
          example: 504
        completion_tokens:
          type: integer
          description: 출력 콘텐츠의 토큰 수
          example: 2
        total_tokens:
          type: integer
          description: 총 토큰 수
          example: 526
        prompt_tokens_details:
          type: object
          description: 상세 입력 토큰 정보
          properties:
            cached_tokens:
              type: integer
              description: 캐시에 적중한 프롬프트 토큰 수 (더 저렴한 캐시 입력 요금으로 과금, 캐싱은 자동 적용)
              example: 0
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 메시지 발신자 역할
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AI 응답 메시지 내용
          example: >-
            Prompt caching reuses previously processed prompt prefixes so
            repeated context is billed at a lower rate.
        tool_calls:
          type: array
          description: 모델이 요청한 함수 호출 (`function` 도구를 사용할 때 포함됨)
          items:
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##모든 API는 Bearer Token 인증이 필요합니다##

        **API Key 받기:**

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

        **요청 헤더에 추가:**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````