Authorization: Bearer ********************{
"contents": [
{
"role": "user",
"parts": [
{
"text": "一张未来感 AI 工作台场景,冷色氛围,电影级布光"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
],
"temperature": 1,
"topP": 0.95,
"maxOutputTokens": 8192,
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "2K"
}
}
}curl --location '/v1beta/models/gemini-3-pro-image-preview:generateContent' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "一张未来感 AI 工作台场景,冷色氛围,电影级布光"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
],
"temperature": 1,
"topP": 0.95,
"maxOutputTokens": 8192,
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "2K"
}
}
}'{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"inlineData": {
"mimeType": "image/png",
"data": "BASE64_OR_URL"
}
}
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 456,
"totalTokenCount": 579,
"trafficType": "ON_DEMAND"
},
"modelVersion": "gemini-3-pro-image-preview",
"createTime": "2026-05-21T00:00:00Z"
}