Authorization: ********************{
"contents": [
{
"role": "user",
"parts": [
{
"text": "draw a cat"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
],
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "1K"
}
}
}curl --location '/v1beta/models/gemini-2.5-flash-image:generateContent/' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "draw a cat"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
],
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "1K"
}
}
}'{
"candidates": [
{
"content": {
"parts": [
{
"inlineData": {
"data": "BASE64",
"mimeType": "image/png"
}
}
],
"role": "model"
},
"finishReason": "STOP",
"index": 0
}
],
"modelVersion": "gemini-2.5-flash-image",
"usageMetadata": {
"candidatesTokenCount": 1235,
"promptTokenCount": 2,
"totalTokenCount": 1237
}
}