> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yingtu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 3.1 Flash Image parameters

> Configure 1K, 2K, or 4K generation and editing requests for gemini-3.1-flash-image on YingTu.

Flash accepts the shared Gemini-native `contents` body and three YingTu billing
tiers. Put resolution inside `generationConfig.imageConfig`.

| Field                | Value for this model                      |
| -------------------- | ----------------------------------------- |
| Model path           | `gemini-3.1-flash-image`                  |
| `imageSize`          | `1K`, `2K`, or `4K`; omitted means 1K     |
| `aspectRatio`        | Optional; `1:1` was verified at 1K and 2K |
| `responseModalities` | Include `IMAGE`; `TEXT` is optional       |
| `candidateCount`     | Omit or use `1`                           |
| 1K / 2K / 4K price   | USD 0.025 / USD 0.037 / USD 0.055         |

```json theme={"system"}
{
  "contents": [{
    "role": "user",
    "parts": [{"text": "An editorial product scene with crisp typography space"}]
  }],
  "generationConfig": {
    "responseModalities": ["TEXT", "IMAGE"],
    "imageConfig": {"aspectRatio": "4:3", "imageSize": "2K"}
  }
}
```

## 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.

## Editing input

Add `inlineData` beside the instruction. The verified edit accepted a JPEG
source and returned a 1024 × 1024 JPEG at `1K`.

```json theme={"system"}
{
  "contents": [{
    "role": "user",
    "parts": [
      {"text": "Keep the product geometry and change the background to pale blue"},
      {"inlineData": {"mimeType": "image/jpeg", "data": "BASE64_SOURCE_IMAGE"}}
    ]
  }],
  "generationConfig": {
    "responseModalities": ["TEXT", "IMAGE"],
    "imageConfig": {"aspectRatio": "1:1", "imageSize": "1K"}
  }
}
```

<Warning>Actual output encoding is response data. Read `mimeType`; do not infer JPEG from the model ID.</Warning>
