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

# Kimi API(모든 모델) - Chat Completions 전체 참조

> OpenAI Chat Completions 형식으로 Kimi 모델을 호출하며 일반 JSON 및 SSE 스트리밍 응답을 지원합니다. 여러 턴의 대화에서는 assistant 메시지의 reasoning_content와 tool_calls를 모두 보존하세요.

웹 검색이 tool_calls를 반환하면 각 호출의 function.arguments를 동일한 tool_call_id를 가진 tool 메시지의 내용으로 다시 보내고 요청을 이어서 최종 답변을 생성하세요.

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


## OpenAPI

````yaml ko/api-manual/language-series/kimi/chat-completions/chat-completions-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Kimi API(모든 모델) - Chat Completions 전체 참조
  description: >-
    OpenAI Chat Completions 프로토콜로 Kimi 텍스트 모델을 호출합니다. `model`로 `kimi-k3.1-pro`,
    `kimi-k3.1-pro-highspeed`, `kimi-k3`를 선택합니다. 모두 컨텍스트 창은 1,048,576 tokens이며
    여러 턴의 대화, 스트리밍, 도구 호출, 웹 검색, 구조화된 출력, 이미지 및 비디오 입력을 지원합니다.


    세 모델 모두 추론이 항상 활성화되며 `reasoning_content`로 반환됩니다. 추론 강도와 캐시 쓰기 TTL은 모델에 따라
    다릅니다. `model` 필드 설명을 확인하세요. 여러 턴의 대화에서는 추론과 도구 호출 기록을 모두 보존하세요.
  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 Completions
    description: OpenAI Chat Completions 호환 API
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat Completions
      summary: Kimi 채팅 API(모든 모델, OpenAI 호환)
      description: >-
        OpenAI Chat Completions 형식으로 Kimi 모델을 호출하며 일반 JSON 및 SSE 스트리밍 응답을 지원합니다.
        여러 턴의 대화에서는 assistant 메시지의 reasoning_content와 tool_calls를 모두 보존하세요.


        웹 검색이 tool_calls를 반환하면 각 호출의 function.arguments를 동일한 tool_call_id를 가진
        tool 메시지의 내용으로 다시 보내고 요청을 이어서 최종 답변을 생성하세요.
      operationId: createChatCompletionKimi
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple:
                summary: Pro 최소 요청
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
              highspeed:
                summary: Highspeed 최소 요청
                value:
                  model: kimi-k3.1-pro-highspeed
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
              k3:
                summary: Kimi K3 최소 요청
                value:
                  model: kimi-k3
                  messages:
                    - role: user
                      content: Reply with OK.
                  max_completion_tokens: 1024
              streaming:
                summary: SSE 스트리밍 출력
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  stream: true
              multimodal:
                summary: 이미지 입력
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content:
                        - type: image_url
                          image_url:
                            url: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAA...
                        - type: text
                          text: 이 이미지를 설명해 주세요.
                  reasoning_effort: low
                  max_completion_tokens: 1024
              function_calling:
                summary: Function Calling
                value:
                  model: kimi-k3.1-pro
                  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: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Use web search to find the official Kimi homepage URL.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  tools:
                    - type: web_search
              structured_output:
                summary: 엄격한 JSON Schema
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Return a JSON object with result equal to OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  response_format:
                    type: json_schema
                    json_schema:
                      name: result
                      strict: true
                      schema:
                        type: object
                        properties:
                          result:
                            type: string
                        required:
                          - result
                        additionalProperties: false
              cache_1h:
                summary: 1h 캐시 자동 쓰기(K3.1 시리즈만 지원)
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  prompt_cache_options:
                    mode: implicit
                    ttl: 1h
      responses:
        '200':
          description: Chat completion 응답입니다. 스트리밍 요청은 SSE 이벤트 스트림을 반환합니다
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
            text/event-stream:
              schema:
                type: string
                description: 'OpenAI Chat Completions 형식의 SSE 데이터이며 `data: [DONE]`으로 끝납니다.'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          enum:
            - kimi-k3.1-pro
            - kimi-k3.1-pro-highspeed
            - kimi-k3
          default: kimi-k3.1-pro
          description: >-
            호출할 모델:


            | 모델 ID | 특성 | 추론 강도 |

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

            | `kimi-k3.1-pro` | 최신 세대 모델(권장) | `low` / `high` / `max`, 기본값 `max`
            |

            | `kimi-k3.1-pro-highspeed` | Pro와 동일한 매개변수, 더 빠른 생성 |
            `kimi-k3.1-pro`와 동일 |

            | `kimi-k3` | 이전 세대 모델 | `max`만 지원 |


            세 모델 모두 컨텍스트 창은 1,048,576 tokens이며 추론이 항상 활성화됩니다.


            캐시 쓰기 TTL(`prompt_cache_options`)은 K3.1 시리즈만 지원하며 `kimi-k3`는 이 매개변수를
            지원하지 않습니다.
        messages:
          type: array
          minItems: 1
          description: 대화 메시지입니다. 여러 턴 대화에서는 과거 assistant 메시지 전체를 포함하세요.
          items:
            $ref: '#/components/schemas/ChatMessage'
        max_completion_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          default: 131072
          description: >-
            추론과 최종 답변을 포함한 최대 생성 토큰 수입니다. 기본값은 131072, 최대값은 1048576이며 남은 컨텍스트의
            제한도 받습니다.
        reasoning_effort:
          type: string
          enum:
            - low
            - high
            - max
            - medium
            - xhigh
            - minimal
            - none
          default: max
          description: >-
            추론 강도. 추론은 항상 활성화됩니다.


            - `kimi-k3.1-pro` / `kimi-k3.1-pro-highspeed`: `low` / `high` /
            `max`를 권장하며 기본값은 `max`입니다. 범용 클라이언트 호환을 위해 `medium`은 `high`,
            `xhigh`는 `max`, `minimal` / `none`은 `low`로 처리합니다. `none`도 추론을 끄지
            않습니다.

            - `kimi-k3`: `max`만 지원합니다(기본값).


            강도를 높이면 일반적으로 추론 토큰과 지연 시간이 증가합니다. 추론 토큰은 출력에 포함됩니다.
        stream:
          type: boolean
          default: false
          description: 응답을 SSE 스트림으로 반환할지 여부입니다.
        tools:
          type: array
          maxItems: 128
          description: 함수 도구 또는 웹 검색입니다. 검색은 {"type":"web_search"}로 선언합니다.
          items:
            oneOf:
              - $ref: '#/components/schemas/FunctionTool'
              - $ref: '#/components/schemas/WebSearchTool'
        tool_choice:
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - $ref: '#/components/schemas/NamedToolChoice'
          description: 모델이 도구를 호출할지 또는 특정 함수를 강제로 호출할지 제어합니다.
        prompt_cache_options:
          type: object
          description: >-
            컨텍스트 캐시 쓰기 옵션. `kimi-k3.1-pro` / `kimi-k3.1-pro-highspeed`만 지원하며
            `kimi-k3`는 이 매개변수를 지원하지 않습니다. 생략하면 기본적으로 5m 캐시에 자동으로 기록합니다. 쓰기와 읽기는
            별도로 과금됩니다.
          properties:
            mode:
              type: string
              enum:
                - implicit
              default: implicit
            ttl:
              type: string
              enum:
                - 5m
                - 1h
              default: 5m
              description: 캐시 유효 기간은 5m 또는 1h이며 기본값은 5m입니다.
        response_format:
          type: object
          description: >-
            출력 형식입니다. text는 일반 텍스트, json_object는 JSON 객체, json_schema는 지정한 JSON
            Schema를 따르는 구조화 출력입니다.
          properties:
            type:
              type: string
              enum:
                - text
                - json_object
                - json_schema
              description: >-
                출력 형식입니다. text: 기본 일반 텍스트. json_object: 유효한 JSON 객체.
                json_schema: 지정한 스키마를 따르는 출력(권장, json_schema도 지정).
            json_schema:
              type: object
              description: type이 json_schema일 때 출력이 따라야 하는 JSON Schema입니다.
              properties:
                name:
                  type: string
                  description: 식별에 사용하는 스키마 이름입니다.
                strict:
                  type: boolean
                  default: true
                  description: 지정한 JSON Schema를 엄격히 따를지 여부이며 기본값은 true입니다.
                schema:
                  type: object
                  description: 출력 구조를 정의하는 JSON Schema입니다.
                  additionalProperties: true
              required:
                - name
                - schema
        max_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          deprecated: true
          description: >-
            이전 클라이언트용 출력 제한 별칭입니다. 새 요청에는 max_completion_tokens를 사용하고 둘을 동시에
            지정하지 마세요.
        temperature:
          type: number
          default: 1
          description: >-
            샘플링 온도. 모델에서 `1`로 고정하므로 전달할 필요가 없습니다. `kimi-k3.1-pro` /
            `kimi-k3.1-pro-highspeed`는 이 필드를 자동으로 무시하며 `kimi-k3`는 지원하지 않는 값에 대해
            오류를 반환합니다.
        top_p:
          type: number
          default: 0.95
          description: >-
            핵 샘플링 임계값. 모델에서 `0.95`로 고정하므로 전달할 필요가 없습니다. `kimi-k3.1-pro` /
            `kimi-k3.1-pro-highspeed`는 이 필드를 자동으로 무시하며 `kimi-k3`는 지원하지 않는 값에 대해
            오류를 반환합니다.
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: chat.completion
        created:
          type: integer
        model:
          type: string
          example: kimi-k3.1-pro
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                $ref: '#/components/schemas/ChatMessage'
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - tool_calls
        usage:
          $ref: '#/components/schemas/ChatUsage'
    ChatMessage:
      type: object
      required:
        - role
      properties:
        role:
          type: string
          description: '메시지 역할: system, user, assistant 또는 tool.'
          enum:
            - system
            - user
            - assistant
            - tool
        content:
          description: >-
            메시지 내용입니다. 순수 텍스트는 문자열로 전달하며, 멀티모달 입력은 콘텐츠 블록 배열(텍스트 + 이미지 + 비디오)로
            전달합니다. 도구 호출 시 assistant content는 null일 수 있습니다.
          oneOf:
            - type: string
              description: 순수 텍스트 메시지 내용입니다.
            - type: array
              description: 멀티모달 콘텐츠 블록 배열입니다.
              items:
                $ref: '#/components/schemas/ContentPart'
            - type: 'null'
        reasoning_content:
          type: string
          description: >-
            assistant의 추론 내용입니다. 여러 턴 대화에서는 전체 assistant 메시지의 일부로 변경하지 말고 다시
            전달하세요.
        tool_calls:
          type: array
          description: assistant가 반환한 도구 호출입니다. 이후 도구 사용 턴에서 변경하지 말고 다시 전달하세요.
          items:
            $ref: '#/components/schemas/ToolCall'
        tool_call_id:
          type: string
          description: '`role=tool`일 때 대응하는 도구 호출 ID입니다.'
    FunctionTool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          description: 도구 유형입니다. 현재 function으로 고정됩니다.
          enum:
            - function
        function:
          type: object
          description: 모델이 사용할 수 있는 함수 정의입니다.
          required:
            - name
            - parameters
          properties:
            name:
              type: string
              description: 함수 이름입니다.
            description:
              type: string
              description: 모델이 함수를 언제 호출할지 판단하는 데 도움이 되는 설명입니다.
            parameters:
              type: object
              additionalProperties: true
              description: JSON Schema 형식의 함수 매개변수 정의입니다.
            strict:
              type: boolean
              description: 함수 인수가 parameters의 JSON Schema를 엄격히 따라야 하는지 여부입니다.
    WebSearchTool:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - web_search
          description: 웹 검색 도구입니다.
    NamedToolChoice:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          description: 이름으로 지정한 도구 선택 유형입니다. function으로 고정됩니다.
          enum:
            - function
        function:
          type: object
          description: 모델이 반드시 호출해야 하는 함수입니다.
          required:
            - name
          properties:
            name:
              type: string
              description: 모델이 반드시 호출해야 하는 함수 이름입니다.
    ChatUsage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: >-
            일반 입력, 캐시 읽기, 캐시 쓰기를 포함한 전체 입력 토큰. K3.1 시리즈의 일반 입력 =
            prompt_tokens-cached_tokens-cache_write_tokens. `kimi-k3`의 일반 입력 =
            prompt_tokens-cached_tokens.
        completion_tokens:
          type: integer
          description: 추론 tokens를 포함합니다.
        total_tokens:
          type: integer
          description: 입력과 출력 tokens의 합계입니다.
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: 캐시에서 제공된 입력 tokens입니다.
            cache_write_tokens:
              type: integer
              minimum: 0
              description: >-
                이번 요청의 전체 캐시 쓰기 토큰. 5m / 1h 쓰기를 포함합니다. K3.1 시리즈는 별도로 과금하며 일반
                입력으로 중복 과금하지 않습니다. `kimi-k3`는 별도로 구분하지 않고 일반 입력으로 과금합니다.
        completion_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: 추론 tokens이며 completion_tokens에 이미 포함되어 있습니다.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type:
                - string
                - 'null'
    ContentPart:
      description: 멀티모달 콘텐츠 블록입니다. `type`이 사용할 필드를 결정합니다.
      oneOf:
        - type: object
          required:
            - type
            - text
          properties:
            type:
              type: string
              enum:
                - text
            text:
              type: string
              description: '`type=text`일 때의 텍스트 내용입니다.'
        - type: object
          required:
            - type
            - image_url
          properties:
            type:
              type: string
              enum:
                - image_url
            image_url:
              description: '`type=image_url`일 때의 이미지입니다. URL 문자열을 직접 전달할 수도 있습니다.'
              oneOf:
                - type: string
                - type: object
                  required:
                    - url
                  properties:
                    url:
                      type: string
                      description: >-
                        Base64 Data URL 형식의 이미지
                        콘텐츠(data:image/png;base64,...)입니다.
        - type: object
          required:
            - type
            - video_url
          properties:
            type:
              type: string
              enum:
                - video_url
            video_url:
              description: '`type=video_url`일 때의 비디오입니다. URL 문자열을 직접 전달할 수도 있습니다.'
              oneOf:
                - type: string
                - type: object
                  required:
                    - url
                  properties:
                    url:
                      type: string
                      description: >-
                        Base64 Data URL 형식의 비디오
                        콘텐츠(data:video/mp4;base64,...)입니다.
    ToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
          description: 이후 tool 메시지를 tool_call_id로 연결하는 도구 호출 ID입니다.
        type:
          type: string
          description: >-
            도구 호출 유형: 클라이언트 함수는 `function`, 내장 `$web_search` 도구는
            `builtin_function`입니다.
          enum:
            - function
            - builtin_function
        function:
          type: object
          description: 모델이 요청한 함수와 인수입니다.
          properties:
            name:
              type: string
              description: 함수 이름입니다.
            arguments:
              type: string
              description: JSON 문자열로 인코딩된 함수 인수입니다.
      description: 멀티턴에서는 ID, 유형, 함수 이름, 인수 및 추론을 포함한 도구 호출 전체를 보존하세요.
  responses:
    BadRequest:
      description: 잘못된 요청 매개변수
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API Key가 없거나 유효하지 않습니다
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: 요청 한도 초과 또는 할당량 부족
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: 내부 서비스 오류
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  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
        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.