Image editing with Gemini
POST
https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp-image-generation:generateContent
Limitations
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp-image-generation:generateContent?key=' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [{
"parts":[
{"text": "'\''Hi, This is a picture of me. Can you add a llama next to me"},
{
"inline_data": {
"mime_type":"image/jpeg",
"data": "$IMG_BASE64"
}
}
]
}],
"generationConfig": {"responseModalities": ["TEXT", "IMAGE"]}
}'
Response Response Example
{}
Request
Query Params
key
string
required
Example:
{{GEMINI_API_KEY}}
Header Params
Content-Type
string
required
Example:
application/json
Body Params application/json