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

# gemini-3.5-flash-lite

> 使用 Gemini 3.5 Flash-Lite 生成响应。最后一个非空对话轮次必须使用 user 角色。



## OpenAPI

````yaml zh/api-reference/model-api/google/openapi/gemini-3.5-flash-lite/openapi.yaml POST /v1beta/models/gemini-3.5-flash-lite:generateContent
openapi: 3.1.0
info:
  title: Gemini 3.5 Flash-Lite
  description: 通过原生 Gemini API，根据文本和多模态输入生成文本与结构化数据。该模型已弃用 temperature、topP 和 topK。
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security: []
paths:
  /v1beta/models/gemini-3.5-flash-lite:generateContent:
    post:
      summary: 生成内容
      description: 使用 Gemini 3.5 Flash-Lite 生成响应。最后一个非空对话轮次必须使用 user 角色。
      operationId: gemini35FlashLiteGenerateContentZh
      parameters:
        - name: key
          in: query
          required: true
          description: AnyFast API 密钥。
          schema:
            type: string
          example: YOUR_API_KEY
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contents
              properties:
                contents:
                  type: array
                  minItems: 1
                  description: 对话轮次。请求不能以非空 model 轮次结尾。
                  items:
                    $ref: '#/components/schemas/Content'
                systemInstruction:
                  $ref: '#/components/schemas/SystemInstruction'
                generationConfig:
                  $ref: '#/components/schemas/GenerationConfig'
                tools:
                  type: array
                  description: 函数声明，或 Google 搜索、代码执行等受支持的 Gemini 内置工具。
                  items:
                    $ref: '#/components/schemas/Tool'
                toolConfig:
                  type: object
                  additionalProperties: true
                  description: 工具执行和函数调用配置。
                safetySettings:
                  type: array
                  description: 按内容类别设置安全阈值。
                  items:
                    $ref: '#/components/schemas/SafetySetting'
              example:
                contents:
                  - role: user
                    parts:
                      - text: 将发票编号、日期和总金额提取为 JSON。
                generationConfig:
                  thinkingConfig:
                    thinkingLevel: minimal
                  responseMimeType: application/json
                  maxOutputTokens: 1024
      responses:
        '200':
          description: 内容生成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateContentResponse'
        '400':
          description: 请求无效，包括以非空 model 轮次结尾的请求
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 请求频率超限
components:
  schemas:
    Content:
      type: object
      required:
        - parts
      properties:
        role:
          type: string
          enum:
            - user
            - model
          default: user
        parts:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Part'
    SystemInstruction:
      type: object
      properties:
        parts:
          type: array
          items:
            $ref: '#/components/schemas/Part'
    GenerationConfig:
      type: object
      description: 请勿传入 temperature、topP、topK、candidateCount 或 thinkingBudget。
      properties:
        thinkingConfig:
          type: object
          properties:
            thinkingLevel:
              type: string
              enum:
                - minimal
                - medium
                - high
              default: minimal
              description: minimal 适合最高吞吐量，medium/high 适合多步工具调用。
        maxOutputTokens:
          type: integer
          minimum: 1
          maximum: 65536
        responseMimeType:
          type: string
          example: application/json
        responseSchema:
          type: object
          additionalProperties: true
          description: 用于结构化输出的 JSON Schema。
        stopSequences:
          type: array
          items:
            type: string
    Tool:
      type: object
      properties:
        functionDeclarations:
          type: array
          items:
            type: object
            required:
              - name
              - description
              - parameters
            properties:
              name:
                type: string
              description:
                type: string
              parameters:
                type: object
                additionalProperties: true
                description: 函数参数的 JSON Schema。
        googleSearch:
          type: object
          additionalProperties: true
        codeExecution:
          type: object
          additionalProperties: true
        urlContext:
          type: object
          additionalProperties: true
    SafetySetting:
      type: object
      required:
        - category
        - threshold
      properties:
        category:
          type: string
        threshold:
          type: string
    GenerateContentResponse:
      type: object
      properties:
        candidates:
          type: array
          items:
            type: object
            properties:
              content:
                $ref: '#/components/schemas/Content'
              finishReason:
                type: string
                example: STOP
              index:
                type: integer
                example: 0
              safetyRatings:
                type: array
                nullable: true
                items:
                  type: object
                  additionalProperties: true
        usageMetadata:
          type: object
          properties:
            promptTokenCount:
              type: integer
            candidatesTokenCount:
              type: integer
            cachedContentTokenCount:
              type: integer
            thoughtsTokenCount:
              type: integer
            toolUsePromptTokenCount:
              type: integer
            totalTokenCount:
              type: integer
            serviceTier:
              type: string
              example: standard
            promptTokensDetails:
              type: array
              items:
                $ref: '#/components/schemas/ModalityTokenCount'
            toolUsePromptTokensDetails:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/ModalityTokenCount'
        modelVersion:
          type: string
          example: gemini-3.5-flash-lite
        responseId:
          type: string
        quota:
          type: integer
          description: AnyFast 返回的本次请求配额用量。
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
    Part:
      type: object
      description: 文本、媒体、函数调用或函数响应片段。
      properties:
        text:
          type: string
        thought:
          type: boolean
          description: 该片段是否包含模型推理内容。
        thoughtSignature:
          type: string
          description: 多轮工具调用中必须原样保留的不透明签名。
        inlineData:
          type: object
          required:
            - mimeType
            - data
          properties:
            mimeType:
              type: string
              example: image/jpeg
            data:
              type: string
              description: Base64 编码的图片、音频、视频或文档数据。
        fileData:
          type: object
          required:
            - mimeType
            - fileUri
          properties:
            mimeType:
              type: string
              example: application/pdf
            fileUri:
              type: string
              format: uri
              description: Gemini Files URI 或受支持的公开媒体 URL。
        functionCall:
          type: object
          properties:
            name:
              type: string
            args:
              type: object
              additionalProperties: true
        functionResponse:
          type: object
          properties:
            name:
              type: string
            id:
              type: string
              description: 模型返回的函数调用 ID。
            response:
              type: object
              additionalProperties: true
        executableCode:
          type: object
          properties:
            language:
              type: string
              example: PYTHON
            code:
              type: string
              description: 模型生成的可执行代码。
        codeExecutionResult:
          type: object
          properties:
            outcome:
              type: string
              example: OUTCOME_OK
            output:
              type: string
              description: 代码执行输出。
    ModalityTokenCount:
      type: object
      properties:
        modality:
          type: string
          example: TEXT
        tokenCount:
          type: integer

````