{
"contents": [
{
"parts": [
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "输入Base64"
}
},
{
"text": "Caption this image."
}
]
}
]
}curl --location -g --request POST 'http://api.example.com/v1beta/models/gemini-2.5-flash:generateContent?key=sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"parts": [
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "输入Base64"
}
},
{
"text": "Caption this image."
}
]
}
]
}'{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Here are a few caption options for the image:\n\n1. An aerial view reveals a rural landscape dominated by agricultural fields, some showing contour farming patterns, and several prominent wind turbines.\n2. Agricultural fields, roads, and a small village are visible in this aerial image, alongside multiple wind turbines harnessing renewable energy in the rural environment.\n3. A satellite image displays a mix of green crops and tilled brown earth forming striped patterns across undulating rural terrain, with several wind turbines generating power.\n4. Wind turbines stand amidst a patchwork of agricultural fields and rolling hills in a rural setting."
}
]
},
"finishReason": "STOP",
"avgLogprobs": -3.5620666503906251
}
],
"usageMetadata": {
"promptTokenCount": 1294,
"candidatesTokenCount": 125,
"totalTokenCount": 2490,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 4
},
{
"modality": "IMAGE",
"tokenCount": 1290
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 125
}
],
"thoughtsTokenCount": 1071
},
"modelVersion": "gemini-2.5-flash",
"createTime": "2025-11-29T15:41:23.445792Z",
"responseId": "IxQraeCaG_O24_UP9PW30QQ"
}