对话补全
Google Gemini
Chat Completion
Call Gemini models in OpenAI-compatible format to generate responses.
POST
对话补全
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
用于补全的 Gemini 模型 ID。
Available options:
gemini-3.1-pro-preview, gemini-3.1-flash-image-preview, gemini-3.1-flash-lite-preview, gemini-3-pro-preview, gemini-3-pro-image-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash Example:
"gemini-2.5-pro"
组成当前对话的消息列表。
Minimum array length:
1Example:
[{ "role": "user", "content": "你好!" }]对话补全中生成的最大 token 数。
Required range:
x >= 1采样温度,范围 0 到 2。
Required range:
0 <= x <= 2Example:
1
核采样阈值。
Required range:
0 <= x <= 1根据新 token 在文本中的现有频率进行惩罚。
Required range:
-2 <= x <= 2根据新 token 是否已出现在文本中进行惩罚。
Required range:
-2 <= x <= 2如果为 true,将通过 SSE 流式发送部分消息。
API 将在生成这些序列时停止继续生成。
为每条输入消息生成多少个补全选项。
Required range:
x >= 1指定模型必须输出的格式。设置为 {"type": "json_object"} 可启用 JSON 模式。

