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

> - xAI Grok 텍스트 모델용 OpenAI 호환 Responses 엔드포인트. 모델은 `model` 매개변수로 선택 (전체 값은 `model` 매개변수의 대조표 참조)
- `grok-4.5`: 컨텍스트 윈도우 500K 토큰. 프롬프트가 200K 토큰 이상이면 모든 토큰 유형이 2배 요금으로 과금됩니다
- 프롬프트 캐싱은 자동 적용: 캐시에 적중한 입력 토큰은 더 저렴한 캐시 입력 요금으로 과금됩니다
- 동기 및 스트리밍(SSE) 모드 지원
- xAI 서버 측 도구는 xAI 인프라에서 실행되며 성공한 호출당 과금됩니다: `web_search`, `x_search`, `code_execution`, `attachment_search`, `collections_search`
- 일반 `function` 도구(클라이언트 측 함수 호출)도 지원하며 호출당 추가 요금은 없습니다

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

<Note>
  **서버 측 도구**는 xAI 인프라에서 실행되며, 토큰 사용량과 별도로 성공한 호출당 과금됩니다: 웹 검색 / X 검색 / 코드 실행 호출당 $0.005, 첨부 파일 검색 호출당 $0.01, 컬렉션 검색 호출당 \$0.0025. 도구 요금은 롱 컨텍스트 배수의 영향을 받지 않습니다.
</Note>

<Warning>
  `image_generation`은 현재 Grok 4.5에서 사용할 수 없습니다: 호환성을 위해 선언은 허용되지만, 요청이 모델에 도달하기 전에 도구가 제거됩니다. 인식되지 않는 `tools[].type` 값은 `400`으로 거부됩니다.
</Warning>


## OpenAPI

````yaml ko/api-manual/language-series/grok/responses/responses-reference.json POST /v1/responses
openapi: 3.1.0
info:
  title: Grok 전체 모델 인터페이스 - Responses 전체 매개변수
  description: >-
    서버 측 도구를 포함하여 OpenAI 호환 Responses 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: Responses
    description: xAI 서버 측 도구를 지원하는 OpenAI Responses API
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Grok Responses (전체 모델, 전체 매개변수)
      description: >-
        - xAI Grok 텍스트 모델용 OpenAI 호환 Responses 엔드포인트. 모델은 `model` 매개변수로 선택 (전체
        값은 `model` 매개변수의 대조표 참조)

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

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

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

        - xAI 서버 측 도구는 xAI 인프라에서 실행되며 성공한 호출당 과금됩니다: `web_search`, `x_search`,
        `code_execution`, `attachment_search`, `collections_search`

        - 일반 `function` 도구(클라이언트 측 함수 호출)도 지원하며 호출당 추가 요금은 없습니다
      operationId: grokResponsesReference
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
      responses:
        '200':
          description: >-
            응답 생성 성공 (JSON 객체, 또는 `stream=true`인 경우 `response.completed`로 끝나는
            SSE 이벤트 스트림)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
        '400':
          description: 잘못된 요청 매개변수 (인식되지 않는 `tools[].type` 값 포함, 모델에 도달하기 전에 거부됨)
          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:
    ResponsesRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: |-
            호출할 모델:

            | 모델 ID | 포지셔닝 |
            |---|---|
            | `grok-4.5` | xAI 추론 + 도구 호출 모델, 컨텍스트 윈도우 500K |
          enum:
            - grok-4.5
          example: grok-4.5
        input:
          description: >-
            모델에 전달할 입력: 일반 문자열 또는 OpenAI Responses 입력 항목 배열(예:
            `{"role":"user","content":[...]}`). 그대로 전달됩니다.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
          example: >-
            Search the web for the latest SpaceX launch and summarize it in one
            sentence.
        stream:
          type: boolean
          description: 스트리밍으로 응답을 반환할지 여부 (SSE 이벤트, `response.completed`로 종료). 기본값 `false`.
          default: false
          example: false
        max_output_tokens:
          type: integer
          description: 생성할 최대 토큰 수 (추론 토큰 포함).
          example: 2048
        tools:
          type: array
          description: >-
            도구 선언. xAI 서버 측 도구(성공한 호출당 과금, 요금은 롱 컨텍스트 배수의 영향을 받지 않음):


            | 도구 유형 | 기능 | 호출당 가격 |

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

            | `web_search` | 인터넷 검색 및 웹 페이지 열람 | $0.005 |

            | `x_search` | X의 게시물, 프로필, 스레드 검색 | $0.005 |

            | `code_execution` | 샌드박스에서 Python 실행 (`code_interpreter`도 별칭으로 사용
            가능) | $0.005 |

            | `attachment_search` | 대화에 첨부된 파일 검색 (입력에 파일이 포함되면 자동으로 활성화될 수 있음)
            | $0.01 |

            | `collections_search` | 업로드된 문서 컬렉션 조회 (`file_search`도 별칭으로 사용 가능)
            | $0.0025 |


            일반 `function` 도구(클라이언트 측 함수 호출)도 지원하며, 호출당 추가 요금은 없습니다.


            ⚠️ `image_generation`은 현재 사용할 수 없습니다: 호환성을 위해 선언은 허용되지만 요청이 모델에 도달하기
            전에 제거됩니다. 인식되지 않는 도구 유형은 `400`으로 거부됩니다.
          items:
            $ref: '#/components/schemas/Tool'
          example:
            - type: web_search
        tool_choice:
          description: >-
            도구 선택을 제어합니다: `"auto"`(기본값) / `"none"` / `"required"`, 또는 특정 도구를
            지정하는 객체(예: `{"type": "web_search"}`).
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - type: object
        max_tool_calls:
          type: integer
          description: >-
            이 요청에서 허용할 서버 측 도구 호출의 최대 횟수. 생략하거나 `null`로 두면 플랫폼이 사용 가능한 잔액에 따라 최대
            10회까지 자동으로 상한을 적용합니다. 선언된 유료 도구는 최악의 경우 예산을 먼저 예약하며, 사용하지 않은 부분은 정산
            시 환불됩니다.
          example: 5
    ResponsesResponse:
      type: object
      properties:
        id:
          type: string
          description: 응답의 고유 식별자
          example: 55d44212-8d5e-90cc-975f-36d341ce21f5
        object:
          type: string
          enum:
            - response
          description: 응답 유형
          example: response
        status:
          type: string
          description: 응답 상태
          enum:
            - completed
            - incomplete
            - failed
          example: completed
        model:
          type: string
          description: 실제 사용된 모델 이름
          example: grok-4.5
        created_at:
          type: integer
          description: 생성 타임스탬프
          example: 1786538000
        output:
          type: array
          description: >-
            생성 순서대로 나열된 출력 항목: `reasoning` 항목(사고 과정 요약), `web_search_call` /
            `code_interpreter_call` 등 서버 측 도구 호출 항목(상태 `completed`는 성공하여 과금되는
            호출을 의미), 마지막으로 `output_text` 콘텐츠를 담은 `message` 항목.
          items:
            $ref: '#/components/schemas/OutputItem'
        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: 오류 발생 시 제안
    Tool:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: 도구 유형
          enum:
            - web_search
            - x_search
            - code_execution
            - code_interpreter
            - attachment_search
            - collections_search
            - file_search
            - function
          example: web_search
    OutputItem:
      type: object
      properties:
        id:
          type: string
          description: 출력 항목 식별자
        type:
          type: string
          description: 출력 항목 유형
          enum:
            - reasoning
            - message
            - web_search_call
            - x_search_call
            - code_interpreter_call
            - code_execution_call
            - attachment_search_call
            - file_search_call
            - function_call
          example: web_search_call
        status:
          type: string
          description: 출력 항목 상태. 과금 대상은 `completed` 상태의 도구 호출입니다
          example: completed
        content:
          type: array
          description: 메시지 콘텐츠 파트(`output_text`). `message` 항목에 포함됩니다
          items:
            type: object
    Usage:
      type: object
      description: >-
        토큰 및 도구 사용 통계. 프롬프트가 200K 토큰 이상이면 모든 토큰 유형이 2배로 과금되며, 도구 요금은 배수의 영향을 받지
        않습니다.
      properties:
        input_tokens:
          type: integer
          description: 입력 토큰 수
          example: 10329
        output_tokens:
          type: integer
          description: 출력 토큰 수 (추론 토큰 포함)
          example: 299
        total_tokens:
          type: integer
          description: 총 토큰 수
          example: 10628
        input_tokens_details:
          type: object
          description: 상세 입력 토큰 정보
          properties:
            cached_tokens:
              type: integer
              description: 캐시에 적중한 프롬프트 토큰 수 (더 저렴한 캐시 입력 요금으로 과금, 캐싱은 자동 적용)
              example: 6016
        output_tokens_details:
          type: object
          description: 상세 출력 토큰 정보
          properties:
            reasoning_tokens:
              type: integer
              description: 추론 토큰 수
              example: 128
        num_server_side_tools_used:
          type: integer
          description: 이 응답의 서버 측 도구 호출 총 횟수
          example: 2
        server_side_tool_usage_details:
          type: object
          description: >-
            도구별 호출 횟수 (일부 서드파티 경로에서는 이 객체가 없을 수 있으며, 그 경우 완료된 도구 호출 출력 항목 수로
            과금합니다)
          properties:
            web_search_calls:
              type: integer
              example: 2
            x_search_calls:
              type: integer
              example: 0
            code_interpreter_calls:
              type: integer
              example: 0
            document_search_calls:
              type: integer
              description: 첨부 파일 검색 호출 수
              example: 0
            file_search_calls:
              type: integer
              description: 컬렉션 검색 호출 수
              example: 0
            mcp_calls:
              type: integer
              example: 0
  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
        ```

````