Gemini image Interactions
This endpoint serves Gemini image models such as gemini-nano-banana-2.1, not Gemini text models or agent interactions. Check the Gemini image model guide for model IDs, size tiers and reference-image limits. Do not infer live capacity or key access from the presence of an API implementation.
Endpoint and first request
curl https://api.quotaflow.ai/v1beta/interactions \
-H "x-goog-api-key: $QUOTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model":"gemini-nano-banana-2.1",
"input":"An editorial illustration of a harbor at sunrise.",
"response_modalities":["IMAGE"],
"generation_config":{"image_config":{"aspect_ratio":"16:9","image_size":"2K"}},
"store":false,
"stream":false
}'
Read the result
The JSON resource has object: "interaction", a status, and steps. Read model_output steps, then their content image blocks (type: "image", data Base64 bytes, mime_type). Thought steps and text/image content may be interleaved; do not assume the first step is the image. This is the steps schema, not the older outputs / content.* event schema.
For streaming, add stream: true and use curl -N. Read interaction.created, step.start, step.delta, step.stop, then interaction.completed. The completed resource contains the same steps. The image may finish before the first chunk is delivered; this stream does not promise progressive preview frames.
Conversations and restrictions
inputcan be text, typed content blocks or conversation turns. Inline image content blocks usetype: "image",mime_typeand Base64data. Preserve thought/signature steps and model image output for follow-up edits.- This endpoint is stateless. Send the full input history;
previous_interaction_idis unsupported.storedoes not provide a retrievable history service. Background execution and agent interactions are unsupported. - Use
inputor nativecontents, not both. Do not pass OpenAI Chat Completionsmessagesor GPT image parameters. response_formataccepts an image-format object, an array of text/image format objects (for example[{"type":"text"},{"type":"image","aspect_ratio":"16:9","image_size":"1K"}]), or a modality string array such as["TEXT","IMAGE"]. Include image output, do not mix object/string entries, and avoid conflicting size/modality controls. The model-specific ratio/tier table still applies.- Google Search tools belong on native
generateContent, where search pricing is available; tools are not supported on this Interactions endpoint. - Input images use the same model limits as native generation; remote file URLs, cached-content resources and OpenAI
file_idare not supported. usagecan include input, output, thought and image-modality counts. Do not assume input is always omitted or that every image is billed at one flat per-image price.
For a Gemini-native chunk format instead, use :streamGenerateContent?alt=sse; for OpenAI-style image clients use the Images API. Their streaming flags and response schemas are not interchangeable.