Image Generation
/v1/images/generations calls image generation models from the LLMTR catalog through one JSON endpoint. For Meta, meta/muse-image-1.0 performs text-to-image. For OpenAI, openai/gpt-image-2 is supported for text-to-image. For Recraft, V2, V3, and V4 raster/vector models are available for text-to-image. For Krea, krea/krea-2-medium and krea/krea-2-large perform text-to-image. For Google, Imagen 4 (fast/generate/ultra) text-to-image remains available until August 17, 2026; after that date those model IDs are rejected. Gemini image models support both text-to-image and reference-image generation (image-to-image, try-on, image merging). For xAI, xai/grok-imagine-image and xai/grok-imagine-image-quality perform text-to-image; xAI's image editing flow lives on the separate /v1/images/edits endpoint.
Which endpoint?
Section titled “Which endpoint?”| What you want to do | Endpoint | Supported providers | Key fields |
|---|---|---|---|
| Generate an image from scratch (text-to-image) | /v1/images/generations | Meta, OpenAI, Google, Recraft, Krea, xAI | prompt |
| Generate from a reference image (image-to-image, try-on, image merging) | /v1/images/generations | Google Gemini image models | file_ids, image_urls |
| Edit an image (xAI image edits) | /v1/images/edits | xAI only (xai/grok-imagine-image, xai/grok-imagine-image-quality) | image |
/v1/images/edits is available only for xAI image models. Calling it with a Google or OpenAI model returns 400 unsupported_operation and the response body steers you to the correct endpoint: Google routes to /v1/images/generations with file_ids; OpenAI and Recraft route to text-to-image. To enumerate every image-capable model, use model discovery: the entries in GET /v1/models whose supported_operations includes IMAGES_GENERATIONS.
Recraft
Section titled “Recraft”curl "$LLMTR_BASE_URL/v1/images/generations" \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "recraft/recraft-v4-pro", "prompt": "Premium coffee packaging product visual on a white background with soft shadows", "size": "1:1", "response_format": "url", "n": 1 }'Recraft Parameters
Section titled “Recraft Parameters”| Field | Values | Notes |
|---|---|---|
model | recraft/recraft-v4, recraft/recraft-v4-vector, recraft/recraft-v4-pro, recraft/recraft-v4-pro-vector, recraft/recraft-v3, recraft/recraft-v3-vector | Canonical LLMTR model ID. |
size | 1:1, 16:9, 9:16, and other Recraft-supported aspect ratios; supported explicit sizes for raster models | Vector models use aspect ratios rather than explicit pixel sizes. |
response_format | url, b64_json | Defaults to url. |
n | 1-6 | Number of images to generate in one request. |
For Recraft, this first version accepts text-to-image JSON requests only. image_url, image_urls, file_id, file_ids, mask, stream, partial_images, style, style_id, negative_prompt, text_layout, and controls are rejected on this endpoint.
recraft/recraft-v2 and recraft/recraft-v2-vector model IDs are rejected by LLMTR with HTTP 410 model_retired as of 24 August 2026; the provider stopped responding to requests for these two models. Use recraft/recraft-v3 and recraft/recraft-v3-vector instead — pricing rises by about 82% per image (see "Pricing" below).
Krea 2
Section titled “Krea 2”Krea 2 is a foundation image model trained for full creative control. The request is synchronous: you do not poll a job status, you get the result in a single response. Krea 2 Medium is fast and cost-effective; Krea 2 Large is stronger for photographic realism and rawer textures.
curl "$LLMTR_BASE_URL/v1/images/generations" \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "krea/krea-2-medium", "prompt": "A cinematic glass cabin beside a frozen lake at sunrise", "aspect_ratio": "16:9", "resolution": "1K", "creativity": "medium", "response_format": "url" }'Krea Parameters
Section titled “Krea Parameters”| Field | Values | Notes |
|---|---|---|
model | krea/krea-2-medium, krea/krea-2-large | Canonical LLMTR model ID. |
aspect_ratio | 1:1, 4:3, 3:2, 16:9, 2.35:1, 4:5, 2:3, 9:16 | Defaults to 1:1. |
resolution | 1K | Krea 2 currently supports only 1K. |
creativity | raw, low, medium, high | Controls how much the model expands your prompt. Uses the provider default (medium) when omitted. |
seed | integer | Reuse the same seed + prompt to reproduce a generation. |
response_format | url, b64_json | Defaults to url. |
For Krea, this first version does text-to-image only and returns a single image per request (n may only be 1). image_url, image_urls, file_id, file_ids, mask, size, stream, and partial_images are rejected on this endpoint. Krea returns the output image as a hosted url; if you send response_format: "b64_json", LLMTR downloads the image and responds with base64.
Meta Muse Image
Section titled “Meta Muse Image”curl "$LLMTR_BASE_URL/v1/images/generations" \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "meta/muse-image-1.0", "prompt": "A minimalist product photo of a ceramic coffee mug on a wooden table, natural light", "n": 1, "size": "1024x1024", "response_format": "b64_json", "output_format": "webp" }'Meta Parameters
Section titled “Meta Parameters”| Field | Values | Notes |
|---|---|---|
model | meta/muse-image-1.0 | Canonical LLMTR model ID. |
n | 1-6 | Number of images to generate in one request. The provider accepts up to 10, but LLMTR's shared image-generation request schema caps this field at 6 across every provider. |
size | a "WxH" string, e.g. 1024x1536 | Sets the aspect ratio, not the exact pixel size; the image is produced at the model's own resolution. Omit for the default aspect ratio. |
response_format | url, b64_json | Defaults to b64_json. |
output_format | png, jpeg, webp | Defaults to webp. |
Muse Image is text-to-image only on this endpoint. image_url, image_urls, file_id, file_ids, mask, quality, background, moderation, output_compression, resolution, aspect_ratio, creativity, seed, stream: true, and partial_images are rejected (omitting stream or sending false works normally). Image editing and multi-turn refinement are not available through LLMTR yet.
Muse Image can look up real-world references before it renders (a known place, product, logo, or style; a current fact such as a price or date) — this lookup step is automatic, needs no configuration on your part, and is included in the flat per-image price described below.
OpenAI GPT Image 2
Section titled “OpenAI GPT Image 2”curl "$LLMTR_BASE_URL/v1/images/generations" \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/gpt-image-2", "prompt": "A minimalist product photo of a coffee mug on a white background with natural light", "size": "1024x1024", "quality": "medium", "output_format": "png", "background": "opaque", "moderation": "auto", "n": 1 }'OpenAI Parameters
Section titled “OpenAI Parameters”| Field | Values | Notes |
|---|---|---|
size | 1024x1024, 1024x1536, 1536x1024 | Defaults to 1024x1024. |
quality | low, medium, high | Defaults to medium. |
output_format | png, jpeg, webp | Defaults to png. |
output_compression | 0-100 | Only valid with jpeg and webp. |
background | opaque, auto | transparent is not supported by gpt-image-2. |
moderation | auto, low | Uses the provider default when omitted. |
n | 1-4 | Number of images to generate in one request. |
For OpenAI, image_url, image_urls, file_id, file_ids, mask, stream, and partial_images are rejected on this endpoint. Those fields belong to edits and streaming flows and require separate security and billing support.
Google Models
Section titled “Google Models”Google image models use the same endpoint. The google/imagen-4.0-generate-001, google/imagen-4.0-ultra-generate-001, and google/imagen-4.0-fast-generate-001 model IDs are rejected by LLMTR with HTTP 410 model_retired starting August 17, 2026 at 00:00 Europe/Istanbul. LLMTR does not automatically forward these Imagen 4 requests to gemini-3.1-flash-image or any other model; your integration must explicitly choose an active Google image model.
Gemini image models accept reference images through file_id, file_ids, image_url, and image_urls. Use the Google image generation page for Google-specific image-to-image and multi-reference examples.
curl "$LLMTR_BASE_URL/v1/images/generations" \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-3.1-flash-image", "prompt": "A minimalist modern workspace", "size": "1K", "aspect_ratio": "16:9", "n": 1 }'xAI Grok Imagine
Section titled “xAI Grok Imagine”curl "$LLMTR_BASE_URL/v1/images/generations" \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "xai/grok-imagine-image", "prompt": "Studio product photo of a matte black mechanical keyboard", "aspect_ratio": "16:9", "resolution": "1k", "response_format": "url", "n": 1 }'xAI image edits send one or more reference images in JSON:
curl "$LLMTR_BASE_URL/v1/images/edits" \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "xai/grok-imagine-image", "prompt": "Keep the product, replace the background with a clean white studio", "image": { "type": "image_url", "url": "https://example.com/input.png" }, "response_format": "b64_json" }'xAI response url fields (on the imgen.x.ai domain) are short-lived; the TTL is inherited from upstream and LLMTR does not extend it. To display the image persistently in your UI:
- Use
response_format: "b64_json"— the response carries base64-encoded bytes you can store yourself; this is the recommended default shown above. - Or, if you received a
url, download it as soon as the response comes back and mirror it on your own CDN. Do not surface theimgen.x.aiURL directly to end users.
Response
Section titled “Response”{ "created": 1773000000, "model": "openai/gpt-image-2", "data": [ { "b64_json": "iVBORw0KGgoAAAANSUhEUgAA...", "mime_type": "image/png" } ], "usage": { "input_tokens": 20, "output_tokens": 400, "total_tokens": 420, "input_tokens_details": { "text_tokens": 20 } }}Pricing
Section titled “Pricing”meta/muse-image-1.0 is billed at a flat $0.01 per image; this rate is unaffected by size, output_format, or whether the model used its lookup/reference step, and only images that are successfully generated and returned are charged. gpt-image-2 is billed by tokens: input text, input image, and output image tokens are calculated with separate price rules. Recraft models are billed per image: V4 $0.04, V4 Vector $0.08, V4 Pro $0.25, V4 Pro Vector $0.30, V3 $0.04, V3 Vector $0.08. (The retired V2 $0.022 and V2 Vector $0.044 prices no longer apply; these IDs no longer accept requests, see above.) xAI grok-imagine-image is cataloged at $0.02 per image, and grok-imagine-image-quality at $0.04 per image. When xAI reports the actual cost, billing follows that cost; when it does not, the per-image price above applies. Image edit requests count both the images you send and the images produced. Krea models are billed per image: krea/krea-2-medium $0.030, krea/krea-2-large $0.060; Krea is always billed at that per-image price. LLMTR does not add platform margin to model prices; the 8% platform margin only applies when credits are topped up.