Built on xAI's Aurora engine
It runs on Aurora, an autoregressive mixture-of-experts model (now in its Aurora-2 generation) trained for photorealistic rendering and precise text-instruction following.
Generate AI images with xAI's Grok image model through one unified API. A single REST endpoint, async jobs, and webhooks, with no separate xAI account to manage.
Integrate Grok Imagine with a single API call — one key, one unified endpoint, and shared billing across every model on Apiframe.
model: "grok-imagine-image"
It runs on Aurora, an autoregressive mixture-of-experts model (now in its Aurora-2 generation) trained for photorealistic rendering and precise text-instruction following.
It leans into realistic, "imperfect by design" imagery rather than the over-polished stock-photo feel, which reads as more authentic in brand and social content.
It renders readable text inside images and follows detailed prompts closely, which suits ads, posters, and labels.
Beyond text-to-image, it edits existing images with natural language, combines multiple input images in one pass, applies style transfer, and refines across multiple turns.
A higher-fidelity mode aimed at business use, for photorealistic product renders, hero images, social assets, icons, and ad variations at scale.
Image outputs flow into the broader Imagine toolset, and on Apiframe pricing is low and flat at 4 credits ($0.04) per image, for both generation and editing.
A few outputs generated through the Grok Imagine API on Apiframe.
A photorealistic product render of a matte black water bottle on a concrete ledge, natural daylight.
An event ad with the headline 'LAUNCH NIGHT', the date and venue beneath, bold modern layout.
Combine this logo and this product photo into a single branded hero image.
Restyle this portrait as a 1970s film photograph, keeping the subject's face.
A candid lifestyle shot of friends laughing at an outdoor cafe, natural light, realistic skin.
A clean app icon of a paper plane on a blue gradient, simple flat design.
Send a single POST /v2/images/generate request with your API key to
generate with Grok Imagine. The call returns a jobId you can poll or
receive via webhook.
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
"model": "grok-imagine-image",
"grokParams": {
"image": "https://example.com/input.jpg"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
"model": "grok-imagine-image",
"grokParams": {
"image": "https://example.com/input.jpg"
}
},
)
print(response.json()) # { "jobId": "...", "status": "QUEUED" }const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
"model": "grok-imagine-image",
"grokParams": {
"image": "https://example.com/input.jpg"
}
}),
});
const { jobId } = await response.json();
console.log(jobId);Generation is asynchronous. A successful submission returns 202 Accepted with a jobId. Poll GET /v2/jobs/{id} (or supply a webhook_url) until the status is COMPLETED; the result field then holds the output URL(s).
{
"jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"status": "QUEUED"
}curl https://api.apiframe.ai/v2/jobs/JOB_ID \
-H "X-API-Key: afk_your_api_key_here"import requests, time
while True:
job = requests.get(
"https://api.apiframe.ai/v2/jobs/JOB_ID",
headers={"X-API-Key": "afk_your_api_key_here"},
).json()
if job["status"] in ("COMPLETED", "FAILED"):
break
time.sleep(2)
print(job["result"])let job;
do {
await new Promise((r) => setTimeout(r, 2000));
job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
headers: { "X-API-Key": "afk_your_api_key_here" },
}).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);Request parameters accepted by the Grok Imagine endpoint. Model-specific options are nested under the params object shown below.
| Parameter | Type | Required | Default | Allowed / range | Description |
|---|---|---|---|---|---|
| prompt | string | required | — | — | Text description of what to generate. |
| model | string | required | "grok-imagine-image" | "grok-imagine-image" | The model identifier for this endpoint. |
| grokParams.image | string (URL) | optional | — | — | Reference image (URL) |
Common questions about the Grok Imagine API.
Yes. Grok Imagine creates images from text prompts and also edits existing ones with natural language.
xAI's Aurora model, an autoregressive mixture-of-experts system now in its Aurora-2 generation.
Yes. It supports natural-language edits, combining multiple reference images, style transfer, and multi-turn refinement.
A higher-fidelity setting built for production work like product renders, hero images, and ad variations.
On Apiframe, a flat 4 credits ($0.04) per image, whether you generate or edit.
Through Apiframe, as well as the Grok app and the xAI API.
Still have questions?
Get your API key and integrate Grok Imagine in minutes — Pay-as-you-go.
Questions? Join our Discord or contact sales.