{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hi, This is a picture of me. Can you add a llama next to me"
},
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "BASE64编码"
}
},
// 支持多图,总请求大小小于 20MB
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "BASE64编码"
}
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
]
}
}curl --location --request POST 'https://one.api4gpt.com/v1beta/models/gemini-3-pro-image-preview:generateContent' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hi, This is a picture of me. Can you add a llama next to me"
},
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "BASE64编码"
}
},
// 支持多图,总请求大小小于 20MB
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "BASE64编码"
}
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
]
}
}'{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"inlineData": {
"mimeType": "image/jpeg",
"data": "BASE64编码"
}
}
]
},
"finishReason": "STOP",
"index": 0,
"safetyRatings": null
}
],
"promptFeedback": {
"safetyRatings": null
},
"usageMetadata": {
"promptTokenCount": 3,
"candidatesTokenCount": 2071,
"totalTokenCount": 2196,
"thoughtsTokenCount": 122,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
]
}
}