{
"model": "gemini-2.5-flash-image-preview",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "A Cat" },
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAY1BMVEX6+vf///y+vrzAwL7S0s/19fIAAADKysj///+tratxcXALCwwYGBhqamkUFBQ+Pj2UlJLa2tempqSioqDo6OWAgH81NTQuLi5bW1qzs7F3d3ZERESOjo2Hh4UwMC8eHh5YWFfq+iHVAAAAsElEQVR4AdWRhQGDMBBFib1+iktd91+yroEFiJz7JVM9xpgXGNFZZxPjrQ0jOg/MZCEd+mqe5VkhlVmlgTKQ325QDU3salpooVMPi9hVy2z1+FpnjJTTqQV/L2nzH1dbCEpgLpNlO0XllKv9YX8sCdpHJZmUPAOynPZe0uHXVVV2Wp/P5/WpXErnjF/HBva6nzoq6VVO/6B6KGSg0teza1PzSt52xri2C3/bivc2vXMFd3UIkcH3xnEAAAAASUVORK5CYII="
}
}
]
}
],
"stream": false
}
curl --location --request POST '/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gemini-2.5-flash-image-preview",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "A Cat" },
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAY1BMVEX6+vf///y+vrzAwL7S0s/19fIAAADKysj///+tratxcXALCwwYGBhqamkUFBQ+Pj2UlJLa2tempqSioqDo6OWAgH81NTQuLi5bW1qzs7F3d3ZERESOjo2Hh4UwMC8eHh5YWFfq+iHVAAAAsElEQVR4AdWRhQGDMBBFib1+iktd91+yroEFiJz7JVM9xpgXGNFZZxPjrQ0jOg/MZCEd+mqe5VkhlVmlgTKQ325QDU3salpooVMPi9hVy2z1+FpnjJTTqQV/L2nzH1dbCEpgLpNlO0XllKv9YX8sCdpHJZmUPAOynPZe0uHXVVV2Wp/P5/WpXErnjF/HBva6nzoq6VVO/6B6KGSg0teza1PzSt52xri2C3/bivc2vXMFd3UIkcH3xnEAAAAASUVORK5CYII="
}
}
]
}
],
"stream": false
}'
{
"id": "chatcmpl-20250827125205880996676hyI5T7WK",
"model": "gemini-2.5-flash-image-preview",
"object": "chat.completion",
"created": 1756270332,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is a cat for you! \n![image](data:image/png;base64,XXXXXXXX"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 4,
"completion_tokens": 1298,
"total_tokens": 1302,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0
},
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": null
}
}