> ## Documentation Index
> Fetch the complete documentation index at: https://docs.evolink.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# DeepSeek - 전체 API 레퍼런스

> - OpenAI SDK 형식으로 DeepSeek 모델 호출
- 동기 처리 모드, 실시간 응답
- `deepseek-chat` (일반 대화) 및 `deepseek-reasoner` (심층 추론) 모델 지원
- **텍스트 채팅**: 단일 또는 다중 턴 컨텍스트 대화
- **시스템 프롬프트**: AI 역할 및 동작 사용자 정의
- **스트리밍**: SSE 스트리밍 출력 지원
- **도구 호출**: Function Calling 지원

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


## OpenAPI

````yaml ko/api-manual/language-series/deepseek/deepseek-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: DeepSeek 전체 API 레퍼런스
  description: DeepSeek 채팅 인터페이스의 전체 API 레퍼런스, 모든 파라미터 및 고급 기능 포함
  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 채팅 완성 관련 API
paths:
  /v1/chat/completions:
    post:
      tags:
        - 채팅 완성
      summary: DeepSeek Chat API
      description: |-
        - OpenAI SDK 형식으로 DeepSeek 모델 호출
        - 동기 처리 모드, 실시간 응답
        - `deepseek-chat` (일반 대화) 및 `deepseek-reasoner` (심층 추론) 모델 지원
        - **텍스트 채팅**: 단일 또는 다중 턴 컨텍스트 대화
        - **시스템 프롬프트**: AI 역할 및 동작 사용자 정의
        - **스트리밍**: SSE 스트리밍 출력 지원
        - **도구 호출**: Function Calling 지원
      operationId: createChatCompletionDeepSeek
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: 간단한 텍스트 채팅
                value:
                  model: deepseek-chat
                  messages:
                    - role: user
                      content: Tell me about yourself
              multi_turn:
                summary: 다중 턴 대화
                value:
                  model: deepseek-chat
                  messages:
                    - role: user
                      content: What is Python?
                    - role: assistant
                      content: Python is a high-level programming language...
                    - role: user
                      content: What are its advantages?
              system_prompt:
                summary: 시스템 프롬프트 사용
                value:
                  model: deepseek-chat
                  messages:
                    - role: system
                      content: >-
                        You are a professional Python programming assistant.
                        Answer questions concisely.
                    - role: user
                      content: How to read a file?
              reasoner:
                summary: 심층 추론 모델 사용
                value:
                  model: deepseek-reasoner
                  messages:
                    - role: user
                      content: Prove that the square root of 2 is irrational
      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: 잘못된 요청 매개변수
                  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: 할당량 부족
                  type: insufficient_quota_error
        '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
        '413':
          description: 요청 본문이 너무 큼
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: 요청 본문이 너무 큼
                  type: request_too_large_error
                  param: messages
        '429':
          description: 랜덤 시드, 범위 `[0, 2147483647]`, 동일한 시드 값을 사용하면 생성 결과를 일관되게 유지할 수 있습니다
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: >-
                    랜덤 시드, 범위 `[0, 2147483647]`, 동일한 시드 값을 사용하면 생성 결과를 일관되게 유지할
                    수 있습니다
                  type: rate_limit_error
        '500':
          description: 내부 서버 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: 내부 서버 오류
                  type: internal_server_error
        '502':
          description: 업스트림 서비스 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Upstream AI service unavailable
                  type: upstream_error
        '503':
          description: 서비스 일시적으로 사용 불가
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: 서비스 일시적으로 사용 불가
                  type: service_unavailable_error
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: >-
            채팅 모델 이름


            - `deepseek-chat`: 일반 대화 모델

            - `deepseek-reasoner`: 심층 추론 모델, 수학, 코딩 및 복잡한 논리 추론에 뛰어남


            **참고**: `deepseek-reasoner`는 `temperature`, `top_p`, `tools`,
            `tool_choice`, `response_format` 파라미터를 지원하지 않습니다. 이러한 파라미터를 전달하면
            업스트림에서 거부됩니다
          enum:
            - deepseek-chat
            - deepseek-reasoner
          default: deepseek-chat
          example: deepseek-chat
        messages:
          type: array
          description: |-
            대화 메시지 목록, 다중 턴 대화 지원

            역할에 따라 필드 구조가 다르며, 해당 역할을 선택하여 확인하세요
          items:
            oneOf:
              - $ref: '#/components/schemas/SystemMessage'
              - $ref: '#/components/schemas/UserMessage'
              - $ref: '#/components/schemas/AssistantRequestMessage'
              - $ref: '#/components/schemas/ToolMessage'
            discriminator:
              propertyName: role
              mapping:
                system:
                  $ref: '#/components/schemas/SystemMessage'
                user:
                  $ref: '#/components/schemas/UserMessage'
                assistant:
                  $ref: '#/components/schemas/AssistantRequestMessage'
                tool:
                  $ref: '#/components/schemas/ToolMessage'
          minItems: 1
        thinking:
          type: object
          description: |-
            사고 모드 제어 (Beta)

            **상세 정보**:
            - `deepseek-reasoner` 모델의 심층 사고 기능을 제어합니다
            - 활성화 시 모델이 응답 전에 심층 추론을 수행합니다
          properties:
            type:
              type: string
              description: |-
                사고 모드 스위치

                - `enabled`: 심층 사고 활성화
                - `disabled`: 심층 사고 비활성화
              enum:
                - enabled
                - disabled
        frequency_penalty:
          type: number
          description: |-
            반복 콘텐츠를 줄이기 위한 빈도 패널티 파라미터

            **상세 설명**:
            - 양수 값은 생성된 텍스트에서의 빈도에 따라 토큰에 패널티를 부여합니다
            - 높은 값은 기존 콘텐츠를 반복할 가능성을 줄입니다
            - 기본값: 0 (패널티 없음)
          minimum: -2
          maximum: 2
          default: 0
          example: 0
        max_tokens:
          type: integer
          description: |-
            생성할 최대 토큰 수

            **상세**:
            - 이 제한에 도달하면 모델이 생성을 중단합니다
            - 설정하지 않으면 모델이 생성 길이를 결정합니다
          minimum: 1
          example: 4096
        presence_penalty:
          type: number
          description: |-
            새로운 주제를 장려하기 위한 존재 페널티 매개변수

            **상세**:
            - 양수 값은 텍스트에 나타났는지 여부에 따라 토큰에 페널티를 부여합니다
            - 높은 값은 새로운 주제 논의를 장려합니다
            - 기본값: 0 (페널티 없음)
          minimum: -2
          maximum: 2
          default: 0
          example: 0
        response_format:
          type: object
          description: |-
            응답 형식을 지정합니다

            **상세 정보**:
            - `{"type": "json_object"}`로 설정하여 JSON 모드를 활성화합니다
            - JSON 모드에서 모델은 유효한 JSON 콘텐츠를 출력합니다
          properties:
            type:
              type: string
              enum:
                - text
                - json_object
              description: 응답 형식 유형
              default: text
        stop:
          description: |-
            중지 시퀀스. 모델이 이 문자열을 만나면 생성을 중지합니다

            **상세 정보**:
            - 단일 문자열 또는 문자열 배열이 가능합니다
            - 최대 16개 중지 시퀀스
          oneOf:
            - type: string
            - type: array
              items:
                type: string
              maxItems: 16
        stream:
          type: boolean
          description: |-
            응답을 스트리밍할지 여부

            - `true`: SSE (Server-Sent Events)를 통해 스트리밍하며, 실시간 청크로 콘텐츠를 반환합니다
            - `false`: 완전한 응답을 기다린 후 반환합니다
          default: false
          example: false
        stream_options:
          type: object
          description: |-
            스트리밍 응답 옵션

            `stream=true`일 때만 적용됩니다
          properties:
            include_usage:
              type: boolean
              description: 스트림 끝에 사용량 통계 반환
        temperature:
          type: number
          description: |-
            샘플링 온도, 출력의 무작위성을 제어합니다

            **상세 정보**:
            - 낮은 값 (예: 0.2): 더 결정적이고 집중된 출력
            - 높은 값 (예: 1.5): 더 무작위적이고 창의적인 출력
            - 기본값: 1
          minimum: 0
          maximum: 2
          default: 1
          example: 1
        top_p:
          type: number
          description: |-
            Nucleus Sampling 매개변수

            **설명**:
            - 누적 확률에서 토큰 샘플링을 제어합니다
            - 예를 들어, 0.9는 누적 확률 90%까지의 토큰에서 선택하는 것을 의미합니다
            - 기본값: 1.0 (모든 토큰 고려)

            **권장사항**: temperature와 topP를 동시에 조정하지 마세요
          minimum: 0
          maximum: 1
          default: 1
          example: 1
        tools:
          type: array
          description: |-
            Function Calling을 위한 도구 정의 목록

            **상세 정보**:
            - 최대 128개 도구 정의
            - 각 도구에는 이름, 설명 및 매개변수 스키마가 필요합니다
          items:
            $ref: '#/components/schemas/Tool'
          maxItems: 128
        tool_choice:
          description: |-
            도구 호출 동작을 제어합니다

            **옵션**:
            - `none`: 도구를 호출하지 않음
            - `auto`: 모델이 도구 호출 여부를 결정
            - `required`: 모델이 하나 이상의 도구를 호출하도록 강제

            **기본값**: 도구가 제공되지 않으면 `none`, 도구가 제공되면 `auto`
          oneOf:
            - type: string
              enum:
                - none
                - auto
                - required
            - type: object
              description: 호출할 특정 도구를 지정합니다
              properties:
                type:
                  type: string
                  enum:
                    - function
                function:
                  type: object
                  properties:
                    name:
                      type: string
                      description: 호출할 함수의 이름
                  required:
                    - name
        logprobs:
          type: boolean
          description: |-
            토큰 로그 확률을 반환할지 여부

            **상세 정보**:
            - `true`로 설정하면 응답에 각 토큰의 로그 확률 정보가 포함됩니다
          default: false
        top_logprobs:
          type: integer
          description: |-
            상위 N개의 가장 가능성 높은 토큰의 로그 확률 반환

            **상세**:
            - `logprobs`를 `true`로 설정해야 합니다
            - 범위: `[0, 20]`
          minimum: 0
          maximum: 20
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 채팅 완성의 고유 식별자
          example: 930c60df-bf64-41c9-a88e-3ec75f81e00e
        model:
          type: string
          description: 실제 사용된 모델 이름
          example: deepseek-chat
        object:
          type: string
          enum:
            - chat.completion
          description: 응답 유형
          example: chat.completion
        created:
          type: integer
          description: 생성 타임스탬프
          example: 1770617860
        choices:
          type: array
          description: 채팅 완성 선택지 목록
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
        system_fingerprint:
          type: string
          description: 시스템 핑거프린트 식별자
          example: fp_eaab8d114b_prod0820_fp8_kvcache
    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: 관련 매개변수 이름
    SystemMessage:
      title: 시스템 메시지
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
          description: 역할 식별자, `system`으로 고정
        content:
          type: string
          description: 시스템 프롬프트 내용, AI 역할 및 동작을 정의하는 데 사용됩니다
        name:
          type: string
          description: 참가자 이름, 서로 다른 시스템 프롬프트 소스를 구분하는 데 사용
    UserMessage:
      title: 사용자 메시지
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
          description: 역할 식별자, `user`로 고정
        content:
          type: string
          description: 사용자 메시지 내용 (일반 텍스트 문자열)
        name:
          type: string
          description: 참가자 이름, 서로 다른 사용자를 구분하는 데 사용
    AssistantRequestMessage:
      title: Assistant 메시지
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - assistant
          description: 역할 식별자, `assistant`로 고정
        content:
          type:
            - string
            - 'null'
          description: |-
            Assistant 메시지 콘텐츠

            **상세 설명**:
            - 다중 턴 대화에서 이전 assistant 응답을 전달하는 데 사용됩니다
            - `tool_calls`가 있을 때 `null`일 수 있습니다
        name:
          type: string
          description: 참가자 이름
        prefix:
          type: boolean
          description: |-
            접두사 연속 모드 활성화 (Beta)

            **상세 설명**:
            - 마지막 메시지에서만 사용
            - `true`일 때, 모델이 이 메시지의 `content`를 접두사로 하여 계속 생성합니다
          default: false
        reasoning_content:
          type:
            - string
            - 'null'
          description: |-
            Chain of Thought 콘텐츠 (Beta)

            **상세 설명**:
            - `deepseek-reasoner` 모델 사용 시에만 유효합니다
            - 다중 턴 대화에서 이전 추론 과정을 전달하는 데 사용됩니다
            - `prefix`를 `true`로 설정해야 합니다
        tool_calls:
          type: array
          description: |-
            도구 호출 목록

            다중 턴 대화에서 이전 도구 호출 정보를 전달하는 데 사용됩니다
          items:
            type: object
            properties:
              id:
                type: string
                description: 도구 호출의 고유 식별자
              type:
                type: string
                enum:
                  - function
              function:
                type: object
                properties:
                  name:
                    type: string
                    description: 호출된 함수의 이름
                  arguments:
                    type: string
                    description: 함수 인수 (JSON 문자열)
    ToolMessage:
      title: 도구 메시지
      type: object
      required:
        - role
        - content
        - tool_call_id
      properties:
        role:
          type: string
          enum:
            - tool
          description: 역할 식별자, `tool`로 고정
        content:
          type: string
          description: 도구 호출 결과 내용
        tool_call_id:
          type: string
          description: |-
            도구 호출 ID

            어시스턴트 메시지의 `tool_calls`에서 반환된 `id` 필드에 해당합니다
    Tool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          enum:
            - function
          description: 도구 유형, 현재 `function`만 지원됩니다
        function:
          type: object
          required:
            - name
          properties:
            name:
              type: string
              description: |-
                호출할 함수의 이름

                **상세**:
                - a-z, A-Z, 0-9 문자로 구성되거나 밑줄과 하이픈을 포함해야 합니다
                - 최대 길이 64자
            description:
              type: string
              description: 함수 설명, 모델이 언제 어떻게 이 함수를 호출해야 하는지 이해하는 데 도움을 줍니다
            parameters:
              type: object
              description: |-
                JSON Schema 객체로 설명된 함수 입력 파라미터

                **상세 설명**:
                - `parameters`를 생략하면 빈 파라미터 목록을 가진 함수를 정의합니다
            strict:
              type: boolean
              description: |-
                엄격 모드 활성화 (Beta)

                **상세 설명**:
                - `true`로 설정하면, API가 함수 호출에 엄격 모드를 사용합니다
                - 출력이 항상 함수의 JSON Schema 정의를 준수하도록 보장합니다
              default: false
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: 선택 인덱스
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: |-
            종료 이유

            - `stop`: 자연 완료 또는 중지 시퀀스 도달
            - `length`: 최대 토큰 제한 도달
            - `content_filter`: 안전 정책에 의해 출력 필터링됨
            - `tool_calls`: 모델이 도구를 호출함
            - `insufficient_system_resource`: 백엔드 리소스 제약
          enum:
            - stop
            - length
            - content_filter
            - tool_calls
            - insufficient_system_resource
          example: stop
    Usage:
      type: object
      description: 토큰 사용 통계
      properties:
        prompt_tokens:
          type: integer
          description: 입력의 토큰 수
          example: 16
        completion_tokens:
          type: integer
          description: 출력의 토큰 수
          example: 10
        total_tokens:
          type: integer
          description: 총 토큰 수
          example: 26
        prompt_cache_hit_tokens:
          type: integer
          description: 입력의 캐시 히트 토큰 수
          example: 0
        prompt_cache_miss_tokens:
          type: integer
          description: 입력의 캐시 미스 토큰 수
          example: 16
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 메시지 발신자의 역할
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AI 응답 콘텐츠
          example: >-
            Hello! I'm DeepSeek, a powerful AI assistant. I excel at general
            conversation, code generation, mathematical reasoning and many other
            tasks.
        reasoning_content:
          type: string
          description: |-
            추론 과정 콘텐츠 (`deepseek-reasoner` 모델에서만 반환)

            **상세**:
            - 모델의 Chain of Thought 추론 과정을 포함합니다
          example: Let me analyze this problem...
        tool_calls:
          type: array
          description: 도구 호출 목록 (모델이 도구 호출을 결정할 때 반환됨)
          items:
            type: object
            properties:
              id:
                type: string
                description: 도구 호출의 고유 식별자
              type:
                type: string
                enum:
                  - function
              function:
                type: object
                properties:
                  name:
                    type: string
                    description: 호출된 함수의 이름
                  arguments:
                    type: string
                    description: 함수 인수 (JSON 문자열)
  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
        ```

````