Flash accepts the shared Gemini-native contents body and three YingTu billing
tiers. Put resolution inside generationConfig.imageConfig.
Choose a resolution deliberately
1K is the lowest-cost default for thumbnails, iteration, and most app UI.
2K provides more working pixels for editorial and product assets.
4K is the highest YingTu tier and should be selected only when the delivery
really uses the additional pixels.
The price is attached to the requested tier, not the output file’s byte size.
Do not send lowercase size values or top-level resolution fields.
Add inlineData beside the instruction. The verified edit accepted a JPEG
source and returned a 1024 × 1024 JPEG at 1K.
Actual output encoding is response data. Read mimeType; do not infer JPEG from the model ID.