gemini-3.1-pro-preview
gemini-3.1-pro-preview
텍스트GoogleGemini 3.1 Progemini-3.1-pro
谷歌最强推理模型
인증
- Base URL
https://api.dreamtoai.com- Authorization
Authorization: Bearer YOUR_API_KEY- Content-Type
application/json- 모델 이름 (model)
gemini-3.1-pro-preview
연동 프로토콜
이 프로토콜을 선택하는 이유
适合原本使用 Gemini SDK 或 generateContent 接口的用户直接迁移。
엔드포인트 URL
POST/v1beta/models/gemini-3.1-pro-preview:generateContent
Authorization: Bearer YOUR_API_KEYContent-Type: application/json요청 / 응답 JSON
요청
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你好,世界"
}
]
}
],
"generationConfig": {
"temperature": 0.7,
"topP": 1,
"maxOutputTokens": 4096
},
"tools": []
}응답
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Hello from Mix API"
}
]
}
}
],
"modelVersion": "gemini-3.1-pro-preview",
"usageMetadata": {
"promptTokenCount": 8,
"candidatesTokenCount": 16,
"totalTokenCount": 24
}
}요청 / 응답 필드
요청 필드
| 필드 | 타입 | 필수 |
|---|---|---|
| contents | array | Y |
| contents[] | object | Y |
| contents[].role | string | Y |
| contents[].parts | array | Y |
| contents[].parts[] | object | Y |
| contents[].parts[].text | string | Y |
| generationConfig | object | Y |
| generationConfig.temperature | number | Y |
| generationConfig.topP | integer | Y |
| generationConfig.maxOutputTokens | integer | Y |
| tools | array | Y |
응답 필드
| 필드 | 타입 | 필수 |
|---|---|---|
| output.text | string | N |
코드 예제
cURLrequest.sh
curl -X POST "https://api.dreamtoai.com/v1beta/models/gemini-3.1-pro-preview:generateContent" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你好,世界"
}
]
}
],
"generationConfig": {
"temperature": 0.7,
"topP": 1,
"maxOutputTokens": 4096
},
"tools": []
}'