How do I choose Gemini image resolution: 1K, 2K or 4K?

Select 1K, 2K or 4K Gemini image output on TokenRex by model ID, set supported aspect ratios and compare live per-image prices.

Use the model ID

Gemini 3 Pro Image and Gemini 3.1 Flash Image use separate TokenRex model IDs for resolution: the base ID is 1K, then -2k and -4k select larger outputs.

This keeps the price clear before the request. Do not send a different image_size; TokenRex rejects a size that does not match the chosen ID.

Choose a size for its use

Aspect ratio

Set image_config.aspect_ratio for Gemini 3 Pro Image and Gemini 3.1 Flash Image. Other image models expose different controls, so check the model page before reusing a request.

Input media resolution is a different setting from generated-image size.

Sources

Example

from openai import OpenAI

client = OpenAI(api_key="YOUR_TOKENREX_KEY", base_url="https://tokenrex.ai/api/public")
image = client.images.generate(
    model="gemini-3.1-flash-image-2k",
    prompt="A product photo of a reusable water bottle on a marble counter",
    extra_body={"image_config": {"aspect_ratio": "16:9"}},
)
print(image.data[0].b64_json[:40])
Get API keyCost calculatorDocs

Questions

Can I request 4K with the base Gemini model ID?
No. Choose the -4k model ID so the request and price match.
Can Gemini generate transparent backgrounds on TokenRex?
No transparent background control is exposed for Gemini image models through TokenRex.

Related