Chat Completions Format
Gemini
OpenAI Chat Format
根据对话历史创建模型响应。支持流式和非流式响应。
兼容 OpenAI Chat Completions API。
POST
Chat Completions Format
Authorizations
Use Bearer Token authentication Format: Authorization: Bearer sk-xxxxxx
Body
application/json
Model ID
Example:
"gpt-4"
List of conversation messages
Sampling Temperature
Required range:
0 <= x <= 2Nucleus sampling parameter (top_p)
Required range:
0 <= x <= 1Number of completions to generate
Required range:
x >= 1Enable streaming response
Stop sequences
Maximum tokens for generation
Maximum tokens for completion
Required range:
-2 <= x <= 2Required range:
-2 <= x <= 2Available options:
none, auto, required Reasoning effort level (for reasoning-capable models)
Available options:
low, medium, high Available options:
text, audio 