Skip to content

Image Generation

Google image generation models are exposed through /v1/images/generations.

Terminal window
curl https://llmtr.com/v1/images/generations \
-H "Authorization: Bearer sk_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.1-flash-image-preview",
"prompt": "A minimalist modern workspace with warm light",
"size": "1K",
"aspect_ratio": "16:9",
"n": 1
}'

Upload a source image via Files API first, then pass the file_id:

Terminal window
curl https://llmtr.com/v1/images/generations \
-H "Authorization: Bearer sk_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.1-flash-image-preview",
"prompt": "Turn this product photo into an ad poster",
"file_id": "file_xxx",
"size": "1K",
"aspect_ratio": "1:1",
"n": 1
}'
FieldValues
size512, 1K, 2K
aspect_ratio1:1, 3:4, 4:3, 9:16, 16:9
n1-4
file_idOptional reference image
{
"created": 1739200000,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
"revised_prompt": "A minimalist modern..."
}
]
}

Billed per image by native unit. See the model card in Dashboard > Models.