Image Generation
Google image generation models are exposed through /v1/images/generations.
Text-to-image
Section titled “Text-to-image”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 }'Image-to-image (reference image)
Section titled “Image-to-image (reference image)”Upload a source image via Files API first, then pass the file_id:
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 }'Parameters
Section titled “Parameters”| Field | Values |
|---|---|
size | 512, 1K, 2K |
aspect_ratio | 1:1, 3:4, 4:3, 9:16, 16:9 |
n | 1-4 |
file_id | Optional reference image |
Response
Section titled “Response”{ "created": 1739200000, "data": [ { "b64_json": "iVBORw0KGgoAAAANSUhEUgAA...", "revised_prompt": "A minimalist modern..." } ]}Pricing
Section titled “Pricing”Billed per image by native unit. See the model card in Dashboard > Models.