跳转到主要内容
POST
文本生成:Gemini 3.5 Flash-Lite(Gemini 原生格式)
右侧 Playground 可直接调试:在 x-goog-api-keysk-your-api-key(API易令牌,无需 Google Key),点击发送即可看到响应——默认零思考,速度很快。
模型默认不输出思考;需要深度推理传 thinkingConfig: {"thinkingLevel": "high"}(实测仅 high 档稳定触发)。搜索 grounding、代码执行、URL context、Maps 等工具仅本原生端点支持。模型能力、定价详见 Gemini 3.5 Flash-Lite 概览
  • 流式请求把 URL 改为 :streamGenerateContent?alt=sse(Playground 演示非流式)
  • 代码执行工具实测可用,但 executableCode / codeExecutionResult 字段暂不回显,结果在正文中呈现
  • :countTokens 与显式缓存 cachedContents 平台暂未开通;Computer Use 本模型官方不支持

参数说明速查

响应要点

  • 思考消耗看 usageMetadata.thoughtsTokenCount(默认 0)
  • grounding 工具命中时 candidates[0].groundingMetadata 返回来源;URL context 看 urlContextMetadata
  • 本模型实测未观测到隐式缓存命中,勿按命中做成本测算

授权

x-goog-api-key
string
header
必填

API易令牌,直接填 sk- 开头的 Key

请求体

application/json
contents
object[]
必填

对话内容数组,多模态 part 混排

systemInstruction
object

系统指令

generationConfig
object

生成配置

tools
object[]

工具:google_search / url_context / codeExecution / functionDeclarations 等

响应

生成成功

candidates
object[]
usageMetadata
object

用量统计,thoughtsTokenCount 为思考消耗

modelVersion
string