Model: gemini-3.1-flash-image
SDK: google-genai (Python)
Date: 2026-07-10
1. Image output tokens: generateContent vs Interactions
Same model, same prompt (“A white woman wearing a blue dress”),
aspect_ratio=“1:1”, thinking_level=“low”. All returned images had the
correct dimensions.
| image_size | pixels | generateContent | Interactions |
|---|---|---|---|
| 512 | 512x512 | 747 | 1120 |
| 1K | 1024x1024 | 1120 | 1120 |
| 2K | 2048x2048 | 1680 | 1120 |
| 4K | 4096x4096 | 2520 | 1120 |
generateContent: usage_metadata.candidates_tokens_details[IMAGE].token_count
Interactions: usage.output_tokens_by_modality[image].tokens
generateContent matches its documented table exactly.
Interactions reports 1120 regardless of resolution.
2. Documentation
This page has two versions, selectable by a toggle at the top of the page.
Their token tables differ.
| image_size | Interactions page | generateContent page | Interactions observed |
|---|---|---|---|
| 512 | 747 | 747 | 1120 |
| 1K | 1120 | 1120 | 1120 |
| 2K | 1120 | 1680 | 1120 |
| 4K | 2000 | 2520 | 1120 |
Two issues with the Interactions page’s table:
(a) It lists 2K = 1120 and 4K = 2000 for 3.1 Flash Image. These are exactly
the values in the 3.1 Pro Image table on the same page. Also, pixel count
quadruples at each step but tokens go up (747->1120), then stay flat
(1120->1120), then go up again (1120->2000). That is not monotone in any
obvious way.
(b) The observed value is 1120 at every resolution, matching neither column.
3. The question
For the same 4096x4096 image from the same model:
generateContent reports IMAGE: 2520
Interactions reports image: 1120
Which value is billed?
- If 1120: the Interactions API bills a flat rate per generated image
regardless of resolution, and the documented table is wrong. - If 2520:
usage.output_tokens_by_modalityon the Interactions API is
misreporting, and users have no way to see actual image token consumption.
Either the documentation or the usage metadata needs correcting.
I have not included AI Studio Spend figures because the dashboard appears to
update on roughly a 10-minute interval and I cannot attribute a delta to an
individual call.
4. Separate issue: multi-turn fails with 404 at 2K and 4K, on both APIs
Two-turn conversation:
turn 0: “A white woman wearing a blue dress”
turn 1: “with white hat”
| image_size | generateContent turn 1 | Interactions turn 1 |
|---|---|---|
| 512 | OK | OK |
| 1K | OK | OK |
| 2K | 404 | 404 |
| 4K | 404 | 404 |
turn 0 always succeeds and returns a correctly sized image.
generateContent (client.chats.create() then chat.send_message() twice):
ClientError: 404 NOT_FOUND
{'error': {'code': 404, 'message': 'Requested entity was not found.',
'status': 'NOT_FOUND'}}
Interactions (previous_interaction_id = turn 0’s id):
NotFoundError: Error code: 404
{'error': {'message': 'Requested entity was not found.',
'code': 'not_found'}}
At 512 and 1K the white hat is correctly applied and the subject is preserved,
so multi-turn editing itself works. It is specifically 2K and 4K that fail.
Note: on turn 1, prompt_tokens_details[IMAGE].token_count is 258 at every
resolution, so the prior image appears to be downsampled before being fed
back as context. Yet 2K/4K still fail.
5. Minor: thinking_level documentation
The Interactions page states thinking_level supports “minimal” and “high”,
default “minimal”. The API returns:
400 - "'minimal' is not a supported thinking level for this model.
Allowed values are: high, low."