
Text-to-image plus multi-reference editing with up to five source images, automatic or pinned quality tiers, and 1K or 2K output resolution.
Text-to-image plus multi-reference editing with up to five source images, automatic or pinned quality tiers, and 1K or 2K output resolution.
Also known as Grok Imagine Image, xAI Grok Imagine Image 2.0
grok-imagine-image-2-0/v1/images/generationsPOST/v1/images/editsgrok-imagine-image-2grok-imagine-image-2.0xai/grok-imagine-image-2-0xai/grok-imagine-image-2xai/grok-imagine-image-2.0Live pay-as-you-go rates from the EmpirioLabs catalog. You are billed only for what you use, with no monthly minimum.
Grok Imagine Image 2.0 runs through POST /v1/images/generations. The request returns a job_id right away; poll GET /v1/jobs/{job_id} until the job completes and read the output URLs from the result. Or add "sync": true to skip polling: the request stays open and returns the finished OpenAI-style image response directly, so OpenAI SDKs work as-is. Get an API key from the EmpirioLabs dashboard.
curl https://api.empiriolabs.ai/v1/images/generations \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image-2-0",
"prompt": "Describe what you want Grok Imagine Image 2.0 to generate."
}'curl https://api.empiriolabs.ai/v1/jobs/JOB_ID \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY"import requests
response = requests.post(
"https://api.empiriolabs.ai/v1/images/generations",
headers={"Authorization": "Bearer YOUR_EMPIRIOLABS_API_KEY"},
json={
"model": "grok-imagine-image-2-0",
"prompt": "Describe what you want Grok Imagine Image 2.0 to generate.",
},
)
job = response.json()
# Generation runs as an async job. Poll until it completes.
import time
while True:
status = requests.get(
f"https://api.empiriolabs.ai/v1/jobs/{job['job_id']}",
headers={"Authorization": "Bearer YOUR_EMPIRIOLABS_API_KEY"},
).json()
if status.get("status") in ("completed", "failed"):
print(status)
break
time.sleep(5)Request parameters supported by the Grok Imagine Image 2.0 API on EmpirioLabs. Defaults apply when a field is omitted.
| Parameter | Type | Default | Range / values | Description |
|---|---|---|---|---|
| prompt | string | - | - | Describe the image to create. With source images attached, this becomes the editing instruction. Refer to multiple images as <IMAGE_0>, <IMAGE_1>, and so on. Up to... |
| image | array | - | - | One to five source images to edit, as URLs, data URIs, or uploaded image objects. Leave empty to generate from the prompt alone. |
| images | array | - | - | Plural alias for multiple uploaded image references. |
| quality | enum | auto | auto, low, medium | Rendering quality. Auto lets the model choose the tier for each request, and billing follows the tier it serves. Low returns in a few seconds and costs less per... |
| resolution | enum | 1k | 1k, 2k | Output resolution tier. 2k renders more pixels and costs more per image than 1k. |
| aspect_ratio | enum | auto | auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 21:9, 5:... | Output aspect ratio. Auto lets the model pick the best fit for the prompt. For an edit, auto follows the first source image. Includes the 21:9 and 5:2 widescreen and... |
| num_images | number | 1 | 1 to 10 | Number of output images. Each output image is billed separately. |
| response_format | enum | url | url, b64_json | Return signed image URLs by default, or include base64 image data when b64_json is requested. |
Generates images from a text prompt, or edits up to five source images from a natural-language instruction.
Place the product from <IMAGE_0> onto the marble surface in <IMAGE_1>.Quality selects how much work goes into the render. Auto lets the model choose the tier for each request and currently serves low for a text prompt and medium for an edit. Low returns in a few seconds. Medium takes longer and resolves finer detail. Resolution selects the 1K or 2K output tier. Quality and resolution combine into four price points, so a low 1K image is the cheapest option and a medium 2K image the most detailed.
Supports prompt, source images (URL or upload), quality, resolution, aspect ratio across sixteen ratios including auto and the 21:9 and 5:2 widescreen formats, number of images, and response format.
Generated images pass an automated content-safety check. An image flagged as explicit is not returned. Because the image is generated before the check runs, a flagged generation is still billed.
On EmpirioLabs, Grok Imagine Image 2.0 is billed pay as you go: Low quality, 1K $0.048 per image; Low quality, 2K $0.072 per image; Medium quality, 1K $0.072 per image. The live rate card on this page always matches what the API charges.
Grok Imagine Image 2.0 is served through POST /v1/images/generations on api.empiriolabs.ai with standard bearer-token authentication.
Yes. The EmpirioLabs playground runs Grok Imagine Image 2.0 in the browser with the same parameters the API exposes, so you can test prompts before writing code.
Create an EmpirioLabs account, then generate a key under API Keys in the dashboard. Billing is pay-as-you-go credits, so you only pay for the requests you make.
Check out our pricing or reach out if you want your own model deployed on our stack.