gemini-3.8-flash
gemini-3.8-flash
TexteGooglegemini-3.8-flashgemini-3.8-flash
gemini-3.8-flash
Authentification
- Base URL
https://api.dreamtoai.com- Authorization
Authorization: Bearer YOUR_API_KEY- Content-Type
application/json- Nom du modèle (model)
gemini-3.8-flash
Protocole d'intégration
Pourquoi choisir ce protocole
适合原本使用 Gemini SDK 或 generateContent 接口的用户直接迁移。
URL de l'endpoint
POST/v1beta/models/gemini-3.8-flash:generateContent
Authorization: Bearer YOUR_API_KEYContent-Type: application/jsonJSON de requête et de réponse
Requête
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你好,世界"
}
]
}
],
"generationConfig": {
"temperature": 0.7,
"topP": 1,
"maxOutputTokens": 4096
},
"tools": []
}Réponse
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Hello from Mix API"
}
]
}
}
],
"modelVersion": "gemini-3.8-flash",
"usageMetadata": {
"promptTokenCount": 8,
"candidatesTokenCount": 16,
"totalTokenCount": 24
}
}Champs de requête et de réponse
Champs de requête
| Champ | Type | Obligatoire |
|---|---|---|
| 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 |
Champs de réponse
| Champ | Type | Obligatoire |
|---|---|---|
| candidates[].content.parts[].text | string | N |
| usageMetadata.promptTokenCount | integer | N |
| usageMetadata.candidatesTokenCount | integer | N |
| usageMetadata.totalTokenCount | integer | N |
Exemples de code
cURLrequest.sh
curl -X POST "https://api.dreamtoai.com/v1beta/models/gemini-3.8-flash: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": []
}'