> ## 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モデルを呼び出し
- 同期処理モード、会話内容をリアルタイムで返却
- 最小限のパラメータですぐに開始
- 💡 より多くの機能が必要ですか？[完全なAPIリファレンス](./openai-sdk-reference)をご確認ください

<Note>
  **BaseURL**：デフォルトの BaseURL は `https://direct.evolink.ai` で、テキストモデルへの対応が優れており、長時間接続をサポートします。`https://api.evolink.ai` はマルチモーダルの主力エンドポイントで、テキストモデルに対しては代替アドレスとして使用されます。
</Note>


## OpenAPI

````yaml ja/api-manual/language-series/gemini-3.5-flash/openai-sdk/openai-sdk-quickstart.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Gemini-3.5-flashクイックスタート
  description: 5分でGemini-3.5-flashチャットAPIを始めて、最初のAI会話を体験しましょう
  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 クイックチャット
      description: |-
        - OpenAI SDK形式でGemini-3.5-flashモデルを呼び出し
        - 同期処理モード、会話内容をリアルタイムで返却
        - 最小限のパラメータですぐに開始
        - 💡 より多くの機能が必要ですか？[完全なAPIリファレンス](./openai-sdk-reference)をご確認ください
      operationId: createChatCompletionQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionQuickRequest'
      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
        '429':
          description: レート制限を超過しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: レート制限を超過しました
                  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:
    ChatCompletionQuickRequest:
      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/MessageSimple'
          minItems: 1
          example:
            - role: user
              content: Hello, introduce yourself
    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: エラー発生時の提案
    MessageSimple:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: メッセージのロール
          enum:
            - user
        content:
          type: string
          description: メッセージ内容（プレーンテキスト）
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: 選択インデックス
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: 終了理由
          enum:
            - stop
            - length
            - content_filter
          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: 出力トークンの詳細情報
          properties:
            text_tokens:
              type: integer
              description: テキストトークン数
              example: 0
            audio_tokens:
              type: integer
              description: オーディオトークン数
              example: 0
            reasoning_tokens:
              type: integer
              description: 推論トークン数
              example: 1480
        input_tokens:
          type: integer
          description: 入力トークン数（互換性フィールド）
          example: 0
        output_tokens:
          type: integer
          description: 出力トークン数（互換性フィールド）
          example: 0
        input_tokens_details:
          type: object
          nullable: true
          description: 入力トークンの詳細情報（互換性フィールド）
          example: null
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: メッセージ送信者のロール
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AIレスポンスメッセージの内容
          example: |-
            Note: This is sample code!

            Hello! I'm pleased to introduce myself.

            I'm a Large Language Model, trained and developed by Google...
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべてのAPIにBearer Token認証が必要です##

        **APIキーの取得：**

        [APIキー管理ページ](https://evolink.ai/dashboard/keys)にアクセスしてAPIキーを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````