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

# Gemini 3.5 Flash - OpenAI SDK - 전체 레퍼런스

> - OpenAI SDK 형식을 사용하여 Gemini-3.5-flash 모델 호출
- 동기 처리 모드, 대화 내용을 실시간으로 반환
- **일반 텍스트 대화**: 단일 턴 또는 다중 턴 컨텍스트 대화, 코드 샘플의 simple_text 및 multi_turn 예제 참조
- **시스템 프롬프트**: AI 역할 및 동작 사용자 정의, 코드 샘플의 system_prompt 예제 참조
- **멀티모달 입력**: 텍스트 + 이미지 혼합 입력 지원, 코드 샘플의 vision 및 multi_image 예제 참조

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


## OpenAPI

````yaml ko/api-manual/language-series/gemini-3.5-flash/openai-sdk/openai-sdk-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Gemini-3.5-flash 전체 레퍼런스
  description: Gemini-3.5-flash 채팅 인터페이스의 전체 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: Gemini-3.5-flash Chat API
      description: >-
        - OpenAI SDK 형식을 사용하여 Gemini-3.5-flash 모델 호출

        - 동기 처리 모드, 대화 내용을 실시간으로 반환

        - **일반 텍스트 대화**: 단일 턴 또는 다중 턴 컨텍스트 대화, 코드 샘플의 simple_text 및 multi_turn
        예제 참조

        - **시스템 프롬프트**: AI 역할 및 동작 사용자 정의, 코드 샘플의 system_prompt 예제 참조

        - **멀티모달 입력**: 텍스트 + 이미지 혼합 입력 지원, 코드 샘플의 vision 및 multi_image 예제 참조
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: 단일 턴 텍스트 대화
                value:
                  model: gemini-3.5-flash
                  messages:
                    - role: user
                      content: Please introduce yourself
              multi_turn:
                summary: 다중 턴 대화 (컨텍스트 이해)
                value:
                  model: gemini-3.5-flash
                  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: gemini-3.5-flash
                  messages:
                    - role: system
                      content: >-
                        You are a professional Python programming assistant,
                        answering questions concisely.
                    - role: user
                      content: How to read a file?
              vision:
                summary: 멀티모달 입력 (텍스트 + 이미지)
                value:
                  model: gemini-3.5-flash
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: >-
                            Please describe the scene and main elements in this
                            image in detail.
                        - type: image_url
                          image_url:
                            url: https://example.com/image.png
              multi_image:
                summary: 다중 이미지 입력
                value:
                  model: gemini-3.5-flash
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: Compare the differences between these two images
                        - type: image_url
                          image_url:
                            url: https://example.com/image1.png
                        - type: image_url
                          image_url:
                            url: https://example.com/image2.png
      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
                  fallback_suggestion: https://evolink.ai/dashboard/billing
        '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
                  fallback_suggestion: gemini-3.5-flash
        '413':
          description: 요청 본문이 너무 큼
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Image file too large
                  type: request_too_large_error
                  param: content
                  fallback_suggestion: compress image to under 10MB
        '429':
          description: 랜덤 시드, 범위 `[0, 2147483647]`, 동일한 시드 값을 사용하면 생성 결과를 일관되게 유지할 수 있습니다
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: >-
                    랜덤 시드, 범위 `[0, 2147483647]`, 동일한 시드 값을 사용하면 생성 결과를 일관되게 유지할
                    수 있습니다
                  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: 내부 서버 오류
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: 업스트림 서비스 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Upstream AI service unavailable
                  type: upstream_error
                  fallback_suggestion: try different model
        '503':
          description: 서비스 일시적으로 사용 불가
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: 서비스 일시적으로 사용 불가
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: 채팅 모델 이름
          enum:
            - gemini-3.5-flash
          default: gemini-3.5-flash
          example: gemini-3.5-flash
        messages:
          type: array
          description: 채팅 메시지 목록, 다중 턴 대화 및 멀티모달 입력 지원
          items:
            $ref: '#/components/schemas/Message'
          minItems: 1
        stream:
          type: boolean
          description: |-
            스트리밍 모드로 응답을 반환할지 여부

            - `true`: 스트리밍 반환, 실시간 청크로 내용 수신
            - `false`: 완전한 응답을 한 번에 반환
          example: false
          default: false
        max_completion_tokens:
          type: integer
          nullable: true
          description: >-
            Maximum number of completion tokens for the generated response,
            corresponding to Gemini's maxOutputTokens.
          minimum: 1
          example: 2000
          maximum: 65536
        max_tokens:
          type: integer
          description: >-
            Maximum number of tokens for the generated response, compatible with
            the legacy OpenAI parameter.
          minimum: 1
          example: 2000
          maximum: 65536
        temperature:
          type: number
          description: |-
            샘플링 온도, 출력의 무작위성을 제어합니다

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

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

            **권장 사항**: temperature와 top_p를 동시에 조정하지 마세요
          minimum: 0
          maximum: 1
          example: 0.9
          default: 1
        frequency_penalty:
          type: number
          nullable: true
          description: >-
            Frequency penalty coefficient. Range: -2.0 to 2.0. Corresponds to
            Gemini's frequencyPenalty.
          minimum: -2
          maximum: 2
          default: 0
          example: 0
        presence_penalty:
          type: number
          nullable: true
          description: >-
            Presence penalty coefficient. Range: -2.0 to 2.0. Corresponds to
            Gemini's presencePenalty.
          minimum: -2
          maximum: 2
          default: 0
          example: 0
        stop:
          nullable: true
          description: >-
            Stop sequences. Supports a string or string array, corresponding to
            Gemini's stopSequences.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        'n':
          type: integer
          nullable: true
          description: Number of generated candidates.
          minimum: 1
          default: 1
          example: 1
        reasoning_effort:
          type: string
          nullable: true
          description: >-
            추론 부담을 제한합니다. Gemini 3은 low/high 사고 수준을 지원하며, medium은 더 높은 수준에 매핑되고
            none은 지원되지 않습니다.
          enum:
            - low
            - medium
            - high
          default: medium
          example: medium
        seed:
          type: integer
          nullable: true
          description: >-
            Random seed used to make output as reproducible as possible,
            corresponding to Gemini's seed.
          example: 12345
        logprobs:
          type: boolean
          nullable: true
          description: >-
            Whether to return token logprob information, corresponding to
            Gemini's responseLogprobs.
          example: true
          default: false
        top_logprobs:
          type: integer
          nullable: true
          description: >-
            Number of top logprob values returned for each token, corresponding
            to Gemini's logprobs.
          minimum: 0
          maximum: 20
          example: 5
        response_format:
          description: >-
            Response format settings, supporting JSON mode and JSON Schema,
            corresponding to Gemini's responseMimeType, responseSchema and
            responseJsonSchema.
          oneOf:
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - json_object
                  example: json_object
                  description: Response format type.
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - json_schema
                  example: json_schema
                  description: Response format type.
                json_schema:
                  type: object
                  nullable: true
                  description: JSON Schema definition.
        stream_options:
          type: object
          nullable: true
          description: Streaming response options. Can be set when stream is true.
          properties:
            include_usage:
              type: boolean
              nullable: true
              description: >-
                Whether to include token usage for this request before streaming
                finishes.
              default: false
              example: true
        tools:
          type: array
          nullable: true
          description: List of tool definitions for Function Calling.
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          description: Controls tool-calling behavior.
          oneOf:
            - type: string
              enum:
                - none
                - auto
                - required
            - $ref: '#/components/schemas/ToolChoiceObject'
        extra_body:
          type: object
          nullable: true
          description: Gemini extension parameters.
          properties:
            google:
              type: object
              nullable: true
              description: Gemini-specific extension parameters.
              properties:
                cached_content:
                  type: string
                  nullable: true
                  description: Gemini content cache.
                thinking_config:
                  type: object
                  nullable: true
                  description: Gemini ThinkingConfig.
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 채팅 완성의 고유 식별자
          example: chatcmpl-20251010015944503180122WJNB8Eid
        model:
          type: string
          description: 실제 사용된 모델 이름
          example: gemini-3.5-flash
        object:
          type: string
          enum:
            - chat.completion
          description: 응답 유형
          example: chat.completion
        created:
          type: integer
          description: 생성 타임스탬프
          example: 1760032810
        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: |-
            메시지 역할

            - `user`: 사용자 메시지
            - `assistant`: AI 어시스턴트 메시지 (다중 턴 대화용)
            - `system`: 시스템 프롬프트 (AI의 역할 및 동작 설정)
          enum:
            - user
            - assistant
            - system
            - tool
          example: user
        content:
          description: >-
            Message content. Supports two formats:


            **1. Plain text string**: You can pass a string directly, e.g.
            `"content":"Please introduce yourself"`


            **2. Object array** (supports text and multimodal input): see the
            example structure below
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentPart'
        tool_call_id:
          type: string
          nullable: true
          description: Tool call ID, used only when role=tool.
    Tool:
      type: object
      required:
        - type
        - function
      description: Tool definition for Function Calling.
      properties:
        type:
          type: string
          enum:
            - function
          description: Tool type. Currently only function is supported.
        function:
          type: object
          required:
            - name
          description: Function definition.
          properties:
            name:
              type: string
              description: Name of the function to call.
            description:
              type: string
              description: >-
                Function description used by the model to decide whether to call
                the tool.
            parameters:
              type: object
              description: Function request parameters described in JSON Schema format.
    ToolChoiceObject:
      type: object
      required:
        - type
        - function
      description: Scope of the tool to call.
      properties:
        type:
          type: string
          enum:
            - function
          description: Call type.
        function:
          type: object
          required:
            - name
          properties:
            name:
              type: string
              description: Name of the tool to call.
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: 선택 인덱스
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        logprobs:
          type: object
          nullable: true
          description: Token logprob information for this choice.
          properties:
            content:
              type: array
              nullable: true
              description: Logprob details for each output token.
              items:
                $ref: '#/components/schemas/LogProbToken'
        finish_reason:
          type: string
          description: 종료 이유
          enum:
            - stop
            - length
            - content_filter
            - tool_calls
          example: stop
    Usage:
      type: object
      description: 토큰 사용 통계
      properties:
        prompt_tokens:
          type: integer
          description: 입력 콘텐츠의 토큰 수
          example: 13
        completion_tokens:
          type: integer
          description: 출력 콘텐츠의 토큰 수
          example: 1891
        total_tokens:
          type: integer
          description: 총 토큰 수
          example: 1904
        prompt_tokens_details:
          type: object
          description: 상세 입력 토큰 정보
          properties:
            cached_tokens:
              type: integer
              description: 캐시 적중 토큰 수
              example: 0
            text_tokens:
              type: integer
              description: 텍스트 토큰 수
              example: 13
            audio_tokens:
              type: integer
              description: 오디오 토큰 수
              example: 0
            image_tokens:
              type: integer
              description: 이미지 토큰 수
              example: 0
        completion_tokens_details:
          type: object
          description: Detailed completion token information.
          properties:
            text_tokens:
              type: integer
              description: Number of text tokens.
              example: 0
            audio_tokens:
              type: integer
              description: Number of audio tokens.
              example: 0
            reasoning_tokens:
              type: integer
              description: Number of reasoning tokens.
              example: 1480
        input_tokens:
          type: integer
          description: Input token count (compatibility field).
          example: 0
        output_tokens:
          type: integer
          description: Output token count (compatibility field).
          example: 0
        input_tokens_details:
          type: object
          nullable: true
          description: Detailed input token information (compatibility field).
          example: null
    ContentPart:
      oneOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/ImageContent'
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 메시지 발신자 역할
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AI 응답 메시지 내용
          example: >-
            Hello! I'm pleased to introduce myself.


            I'm a Large Language Model, trained and developed by Google.


            Simply put, you can think of me as a "smart brain" that has been
            trained on massive amounts of text data and is able to understand
            and generate human language. My core capability is processing and
            generating text. Specifically, I can do the following:


            **1. Information Query & Knowledge Answering**

            I can act like a "talking encyclopedia," answering various
            questions, whether they're about scientific knowledge, historical
            events, or everyday facts.


            **2. Creative Writing & Text Generation**

            I can create various types of text based on your requirements, such
            as:

            *   **Writing**: Poetry, stories, scripts, emails, speeches,
            advertising copy, etc.

            *   **Planning**: Travel plans, study outlines, event proposals,
            etc.

            *   **Brainstorming**: Working with you to generate new ideas and
            spark creativity.


            **3. Translation & Language Processing**

            I'm proficient in multiple languages and can provide fast, fluent
            translation services. I can also help you polish, proofread,
            summarize, or rewrite text to make your expression clearer and more
            professional.


            **4. Programming & Code Assistance**

            I can write code snippets, explain code logic, debug errors, or
            "translate" code from one programming language to another, making me
            a helpful companion for programmers.


            **5. Logical Analysis & Reasoning**

            I can help you analyze complex problems, organize logical chains,
            and make inferences and summaries based on the information you
            provide.


            ---


            **In summary**, my goal is to be a powerful and useful tool that
            helps you obtain information more efficiently, complete tasks, and
            spark creativity through natural language communication.


            **Remember:** I'm an artificial intelligence, my knowledge comes
            from the data I've learned, and it may not be the most up-to-date.
            Sometimes I may also make mistakes, so for very important
            information, I recommend you verify it again.
          nullable: true
        tool_calls:
          type: array
          nullable: true
          description: List of tool calls.
          items:
            $ref: '#/components/schemas/ToolCall'
    LogProbToken:
      type: object
      description: Logprob details for a single token.
      properties:
        token:
          type: string
          description: Token text.
        logprob:
          type: number
          description: Logprob value of the token.
        bytes:
          type: array
          nullable: true
          description: UTF-8 byte sequence of the token.
          items:
            type: integer
        top_logprobs:
          type: array
          nullable: true
          description: Candidate tokens at the same position and their logprobs.
          items:
            $ref: '#/components/schemas/TopLogProb'
    TextContent:
      title: 텍스트 콘텐츠
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          description: 콘텐츠 유형
        text:
          type: string
          description: 텍스트 내용
          example: Please describe this image in detail
    ImageContent:
      title: 이미지 콘텐츠
      type: object
      required:
        - type
        - image_url
      properties:
        type:
          type: string
          enum:
            - image_url
          description: 콘텐츠 유형
        image_url:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: |-
                이미지 URL 주소

                **제한 사항**:
                - 이미지당 최대 크기: `10MB`
                - 지원 형식: `.jpeg`, `.jpg`, `.png`, `.webp`
                - URL 요구 사항: 공개적으로 접근 가능해야 하며, 일반적으로 이미지 확장자로 끝나야 합니다
              example: https://example.com/image.png
    ToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
          description: Tool call ID.
        type:
          type: string
          enum:
            - function
          description: Tool call type.
        function:
          type: object
          required:
            - name
            - arguments
          properties:
            name:
              type: string
              description: Function name.
            arguments:
              type: string
              description: Function arguments as a JSON string.
    TopLogProb:
      type: object
      description: Logprob details for a candidate token.
      properties:
        token:
          type: string
          description: Candidate token text.
        logprob:
          type: number
          description: Logprob value of the candidate token.
        bytes:
          type: array
          nullable: true
          description: UTF-8 byte sequence of the candidate token.
          items:
            type: integer
  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
        ```

````