We at 302 have made 2 optimizations to this endpoint: 1.Support for returning url or raw bs64 data 2.Support for editing images by passing in image_url
{
"contents": [
{
"parts": [
{
"text": "Hi, can you create a 3d rendered image of a pig with wings and a top hat flying over a happy futuristic scifi city with lots of greenery?"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
]
}
}
curl --location --request POST 'https://api.302.ai/v1/v1beta/models/gemini-2.5-flash-image-preview:generateContent?response_format' \
--header 'x-goog-api-key: sk-jls4AaVBGoe1GwZD64qZA1qyKTN1MPHa4NmvH1cT68z7K1Zz' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"parts": [
{
"text": "Hi, can you create a 3d rendered image of a pig with wings and a top hat flying over a happy futuristic scifi city with lots of greenery?"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
]
}
}'
{
"completed_at": "",
"created_at": "",
"error": "",
"id": "",
"model": "",
"output": "",
"started_at": "",
"status": ""
}