gemini-3.1-flash-lite

由 Google 提供文本

通过 OpenAI 兼容接口调用轻量的 Gemini 3.1 Flash Lite。

更新于:
输入MessagesGemini 请求格式
模型11当前文档所列模型
返回方式同步或流式聊天请求可选 stream
价格优惠 40%官方价
gemini-3.1-flash-lite对话示例
你

Review a TypeScript webhook handler for reliability risks and propose the highest-value fixes. Keep the answer practical for a gemini-3.1-flash-lite integration.

gemini-3.1-flash-lite 标志
gemini-3.1-flash-lite

Verify signatures against the raw body, reject stale events, deduplicate by event ID, acknowledge quickly, and move slow work to a retried background queue. This example is tailored to the gemini-3.1-flash-lite model page.

生成示例

请求与回复示例

01 · 代码审查gemini-3.1-flash-lite
你

Review a TypeScript webhook handler for reliability risks and propose the highest-value fixes. Keep the answer practical for a gemini-3.1-flash-lite integration.

gemini-3.1-flash-lite 标志
gemini-3.1-flash-lite

Verify signatures against the raw body, reject stale events, deduplicate by event ID, acknowledge quickly, and move slow work to a retried background queue. This example is tailored to the gemini-3.1-flash-lite model page.

02 · 查询设计gemini-3.1-flash-lite
你

Explain how to choose indexes for a job table filtered by owner, status, and creation time. Keep the answer practical for a gemini-3.1-flash-lite integration.

gemini-3.1-flash-lite 标志
gemini-3.1-flash-lite

Begin from the most common filter order, use a composite index that supports the leading predicates, measure the actual query plan, and retain a simple retention strategy for old rows. This example is tailored to the gemini-3.1-flash-lite model page.

03 · 产品简报gemini-3.1-flash-lite
你

Summarize a product brief for a developer API in five concise bullets. Keep the answer practical for a gemini-3.1-flash-lite integration.

gemini-3.1-flash-lite 标志
gemini-3.1-flash-lite

Cover the customer problem, primary workflow, integration surface, pricing or quota rule, and the measurable outcome that defines adoption. This example is tailored to the gemini-3.1-flash-lite model page.

模型能力

gemini-3.1-flash-lite 能做什么

根据提示词生成

提交简洁的提示词,通过一个 TTAPI 任务获取回复。

常用参数

设置提示词、模型、输出参数和回调即可接入。

异步查询

通过轮询或 Webhook 接收结果,避免耗时生成阻塞界面。

接入产品

Gemini 的输出可以展示、保存或交给后续流程处理。

计费

按 token 计费

支持的文本模型共用 API 密钥和账户余额。

token 计费规则官方定价
平台TTAPI 计费
Gemini比官方价低 40%
API 请求

按操作查看请求

选择一个操作,查看对应接口和请求字段。

Gemini

Gemini Completions

兼容聊天格式。在请求体发送 messages 和 model,stream 为可选布尔值。

POSThttps://api.ttapi.io/gemini/chat/completions

请求头

TT-API-KEYstring必填

填写 TTAPI API 密钥。

Content-Typestring必填

使用 application/json。

请求体

messagesobject[]必填

按 TTAPI 文档传入带 role 和 content 的对话消息。

messages[].rolestring选填

消息角色,例如 user。

messages[].contentstring选填

这条对话消息的文本内容。

modelstring必填

填写请求示例中使用的 Gemini 模型 ID。

streamboolean选填

通过服务端发送事件逐步返回响应,默认 false。

查看当前渠道的接入文档
接入示例

查看选中渠道的代码示例

选择渠道和操作,再复制相应的接口地址、请求体或代码示例。

Gemini

Gemini Completions 接入示例

POST https://api.ttapi.io/gemini/chat/completions

curl --request POST \
  --url https://api.ttapi.io/gemini/chat/completions \
  --header "TT-API-KEY: $TTAPI_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"model":"gemini-3.1-flash-lite","messages":[{"role":"user","content":"Review this migration plan and identify the three highest risks."}],"stream":false}'