> ## 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 模型
- 同步处理模式，实时返回对话内容
- 最简化参数，快速上手
- 💡 需要更多功能？查看 [完整参数文档](./openai-sdk-reference)

<Note>
  **BaseURL 说明**：默认 BaseURL 为 `https://direct.evolink.ai`，对文本模型支持更好，支持长连接；`https://api.evolink.ai` 是多模态主力地址，对文本模型作为备用地址使用。
</Note>


## OpenAPI

````yaml cn/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: 快速上手 gemini-3.5-flash 对话接口，5分钟完成第一次 AI 对话调用
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 生产环境（推荐）
  - url: https://api.evolink.ai
    description: 备用地址
security:
  - bearerAuth: []
tags:
  - name: 对话生成
    description: AI对话生成相关接口
paths:
  /v1/chat/completions:
    post:
      tags:
        - 对话生成
      summary: gemini-3.5-flash 快速对话
      description: |-
        - 使用 OpenAI SDK 格式调用 gemini-3.5-flash 模型
        - 同步处理模式，实时返回对话内容
        - 最简化参数，快速上手
        - 💡 需要更多功能？查看 [完整参数文档](./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: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未认证、Token无效或过期
          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
        '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: 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
        '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: Service temporarily unavailable
                  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: 你好，介绍一下自己
    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: Token 使用统计信息
      properties:
        prompt_tokens:
          type: integer
          description: 输入内容的 token 数量
          example: 13
        completion_tokens:
          type: integer
          description: 输出内容的 token 数量
          example: 1891
        total_tokens:
          type: integer
          description: 总 token 数量
          example: 1904
        prompt_tokens_details:
          type: object
          description: 输入 token 详细信息
          properties:
            cached_tokens:
              type: integer
              description: 击中缓存的 token 数量
              example: 0
            text_tokens:
              type: integer
              description: 文本 token 数量
              example: 13
            audio_tokens:
              type: integer
              description: 音频 token 数量
              example: 0
            image_tokens:
              type: integer
              description: 图像 token 数量
              example: 0
        completion_tokens_details:
          type: object
          description: 输出 token 详细信息
          properties:
            text_tokens:
              type: integer
              description: 文本 token 数量
              example: 0
            audio_tokens:
              type: integer
              description: 音频 token 数量
              example: 0
            reasoning_tokens:
              type: integer
              description: 推理 token 数量
              example: 1480
        input_tokens:
          type: integer
          description: 输入 token 数量（兼容字段）
          example: 0
        output_tokens:
          type: integer
          description: 输出 token 数量（兼容字段）
          example: 0
        input_tokens_details:
          type: object
          nullable: true
          description: 输入 token 详细信息（兼容字段）
          example: null
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 消息发送者的角色
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AI 回复的消息内容
          example: |-
            请注意此为示例代码！

            你好！很高兴能向你介绍自己。

            我是一个大型语言模型（Large Language Model），由 Google 训练和开发...
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##所有接口均需要使用Bearer Token进行认证##

        **获取 API Key：**

        访问 [API Key 管理页面](https://evolink.ai/dashboard/keys) 获取您的 API Key

        **使用时在请求头中添加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````