Be a bit careful playing with this one. I tried this:
curl -s -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-preview-image-generation:generateContent?key=$GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts": [
{"text": "Provide a vegetarian recipe for butter chicken but with chickpeas not chicken and include many inline illustrations along the way"}
]
}],
"generationConfig":{"responseModalities":["TEXT","IMAGE"]}
}' > /tmp/out.json
At 4c per image that's more than a dollar on that single prompt.
I built this quick tool https://tools.simonwillison.net/gemini-image-json for pasting that JSON into to see it rendered.