{
"model": "gemini-2.5-flash-image-preview",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Create an Image: A Cat"
}
]
}
],
"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": "Create an Image: A Cat"
}
]
}
],
"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
}
}