gemini-3.1-pro-preview

由 Google 提供文本

通过 OpenAI 兼容 Gemini 聊天接口调用 Gemini 3.1 Pro 预览版。

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

Turn these engineering notes into a release plan with owners, milestones, and rollback checks. Keep the answer practical for a gemini-3.1-pro-preview integration.

gemini-3.1-pro-preview 标志
gemini-3.1-pro-preview

Start with the goal and release window, assign an owner for each milestone, define an observable success condition, and include a tested rollback path before launch. This example is tailored to the gemini-3.1-pro-preview model page.

生成示例

请求与回复示例

01 · 发布计划gemini-3.1-pro-preview
你

Turn these engineering notes into a release plan with owners, milestones, and rollback checks. Keep the answer practical for a gemini-3.1-pro-preview integration.

gemini-3.1-pro-preview 标志
gemini-3.1-pro-preview

Start with the goal and release window, assign an owner for each milestone, define an observable success condition, and include a tested rollback path before launch. This example is tailored to the gemini-3.1-pro-preview model page.

02 · 数据契约gemini-3.1-pro-preview
你

Design a JSON data contract for an asynchronous generation job, including validation and status transitions. Keep the answer practical for a gemini-3.1-pro-preview integration.

gemini-3.1-pro-preview 标志
gemini-3.1-pro-preview

Use one immutable request ID, validate the input schema at ingestion, model status as a small state machine, and record timestamps plus result URLs for every terminal state. This example is tailored to the gemini-3.1-pro-preview model page.

03 · 客户通知gemini-3.1-pro-preview
你

Rewrite this technical outage note as a calm customer update with clear next steps. Keep the answer practical for a gemini-3.1-pro-preview integration.

gemini-3.1-pro-preview 标志
gemini-3.1-pro-preview

Lead with impact and current status, state the mitigation in plain language, avoid speculative causes, and tell customers exactly when the next update will arrive. This example is tailored to the gemini-3.1-pro-preview model page.

模型能力

gemini-3.1-pro-preview 能做什么

根据提示词生成

提交简洁的提示词,通过一个 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-pro-preview","messages":[{"role":"user","content":"Review this migration plan and identify the three highest risks."}],"stream":false}'