> ## 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 - Native API - 快速开始

> - 使用 Google 原生 API 格式调用 gemini-3.5-flash 模型
- 同步处理模式，实时返回对话内容
- 最简化参数，快速上手
- 💡 需要更多功能？查看 [完整参数文档](./native-api-reference)

<Tip>
  **流式调用**：将 URL 中的 `generateContent` 替换为 `streamGenerateContent` 即可启用流式返回，逐块实时接收内容。
</Tip>

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


## OpenAPI

````yaml cn/api-manual/language-series/gemini-3.5-flash/native-api/native-api-quickstart.json POST /v1beta/models/gemini-3.5-flash:generateContent
openapi: 3.1.0
info:
  title: Gemini 原生 API - 快速开始
  description: 快速上手 Google Gemini 原生 API，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: Gemini AI 内容生成相关接口
paths:
  /v1beta/models/gemini-3.5-flash:generateContent:
    post:
      tags:
        - 内容生成
      summary: gemini-3.5-flash 快速对话
      description: |-
        - 使用 Google 原生 API 格式调用 gemini-3.5-flash 模型
        - 同步处理模式，实时返回对话内容
        - 最简化参数，快速上手
        - 💡 需要更多功能？查看 [完整参数文档](./native-api-reference)
      operationId: generateContentQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateContentQuickRequest'
      responses:
        '200':
          description: 内容生成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateContentResponse'
        '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
        '404':
          description: 资源不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Model not found
                  type: not_found_error
        '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 again later
        '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:
    GenerateContentQuickRequest:
      type: object
      required:
        - contents
      properties:
        contents:
          type: array
          description: 对话内容列表
          items:
            $ref: '#/components/schemas/ContentSimple'
          minItems: 1
          example:
            - role: user
              parts:
                - text: 你好，介绍一下自己
    GenerateContentResponse:
      type: object
      properties:
        candidates:
          type: array
          description: 候选响应列表
          items:
            $ref: '#/components/schemas/Candidate'
        promptFeedback:
          $ref: '#/components/schemas/PromptFeedback'
        usageMetadata:
          $ref: '#/components/schemas/UsageMetadata'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP状态错误代码
            message:
              type: string
              description: 错误描述信息
            type:
              type: string
              description: 错误类型
            fallback_suggestion:
              type: string
              description: 错误时的建议
    ContentSimple:
      type: object
      required:
        - role
        - parts
      properties:
        role:
          type: string
          description: 内容角色
          enum:
            - user
          example: user
        parts:
          type: array
          description: 内容片段列表（纯文本）
          items:
            $ref: '#/components/schemas/TextPart'
          minItems: 1
    Candidate:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/ContentResponse'
        finishReason:
          type: string
          description: 完成原因
          enum:
            - STOP
            - MAX_TOKENS
            - SAFETY
            - RECITATION
            - OTHER
          example: STOP
        index:
          type: integer
          description: 候选索引
          example: 0
        safetyRatings:
          type: array
          nullable: true
          description: 安全评分
          items:
            type: object
    PromptFeedback:
      type: object
      properties:
        safetyRatings:
          type: array
          nullable: true
          description: 提示词安全评分
          items:
            type: object
    UsageMetadata:
      type: object
      description: 使用量统计
      properties:
        promptTokenCount:
          type: integer
          description: 输入内容的 token 数量
          example: 4
        candidatesTokenCount:
          type: integer
          description: 输出内容的 token 数量
          example: 611
        totalTokenCount:
          type: integer
          description: 总 token 数量
          example: 2422
        thoughtsTokenCount:
          type: integer
          description: 推理 token 数量
          example: 1807
        promptTokensDetails:
          type: array
          description: 输入 token 详细信息（按模态分类）
          items:
            $ref: '#/components/schemas/TokenDetail'
    TextPart:
      type: object
      required:
        - text
      properties:
        text:
          type: string
          description: 文本内容
          example: |-
            你好！很高兴能向你介绍我自己。

            我是一个大型语言模型，由 Google 训练和开发...
    ContentResponse:
      type: object
      properties:
        role:
          type: string
          description: 响应角色
          enum:
            - model
          example: model
        parts:
          type: array
          description: 响应内容片段
          items:
            $ref: '#/components/schemas/TextPart'
    TokenDetail:
      type: object
      description: Token 详细信息（按模态统计）
      properties:
        modality:
          type: string
          description: 内容模态类型
          enum:
            - TEXT
            - IMAGE
            - AUDIO
            - VIDEO
          example: TEXT
        tokenCount:
          type: integer
          description: 该模态的 token 数量
          example: 4
  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
        ```

````