gemini-3.8-flash

由 Google 提供文本

Gemini 3.8 Flash 支持快速多模态对话、分析和长上下文,通过 OpenAI 兼容 Gemini 接口接入。

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

Create a short security checklist for a browser client that submits API jobs. Keep the answer practical for a gemini-3.8-flash integration.

gemini-3.8-flash 标志
gemini-3.8-flash

Keep secrets server-side, authenticate every request, validate payloads before forwarding, use short-lived signed URLs for assets, and log security-relevant failures without recording secrets. This example is tailored to the gemini-3.8-flash model page.

生成示例

请求与回复示例

01 · 安全审查gemini-3.8-flash
你

Create a short security checklist for a browser client that submits API jobs. Keep the answer practical for a gemini-3.8-flash integration.

gemini-3.8-flash 标志
gemini-3.8-flash

Keep secrets server-side, authenticate every request, validate payloads before forwarding, use short-lived signed URLs for assets, and log security-relevant failures without recording secrets. This example is tailored to the gemini-3.8-flash model page.

02 · 架构选型gemini-3.8-flash
你

Compare polling and webhooks for a team that needs reliable job completion updates. Keep the answer practical for a gemini-3.8-flash integration.

gemini-3.8-flash 标志
gemini-3.8-flash

Polling is easier behind private networks and during early prototyping; webhooks reduce repeated requests in production but require a reachable verified endpoint and idempotent event handling. This example is tailored to the gemini-3.8-flash model page.

03 · SQL 数据迁移gemini-3.8-flash
你

Plan a safe migration that adds a required field to a large production table. Keep the answer practical for a gemini-3.8-flash integration.

gemini-3.8-flash 标志
gemini-3.8-flash

Add the field as nullable first, backfill in small observable batches, deploy readers that tolerate both states, validate completion, then enforce the constraint in a separate release. This example is tailored to the gemini-3.8-flash model page.

模型能力

gemini-3.8-flash 能做什么

根据提示词生成

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

常用参数

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

异步查询

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

接入产品

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

计费

按 token 计费

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

Gemini 3.8 Flash token 计费官方定价

每百万 token 的美元费率已含 TTAPI 40% 渠道优惠。官方活动价截至 2026 年 12 月 31 日,输出计费包含思考 token。

PeriodInput / 1M缓存输入 / 百万 tokenOutput / 1M
截至 2026 年 12 月 31 日$0.45$0.045$2.25
自 2027 年 1 月 1 日起$0.90$0.09$4.50
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.8-flash","messages":[{"role":"user","content":"Review this migration plan and identify the three highest risks."}],"stream":false}'