xai/grok-imagine-image
The base Grok Imagine text-to-image model, suited to batch generation. Served through the OpenAI-compatible /v1/images/generations endpoint: set the frame with aspect_ratio, choose 1k or 2k resolution, and generate up to 4 images per request, billed per image. Image editing is not supported yet.
Use either ID to call this model via the API.
xai/grok-imagine-imageReplace the ONEHOP_KEY placeholder with your API key. Create one →
from openai import OpenAI
client = OpenAI(
base_url="https://api.onehop.ai/v1",
api_key="<ONEHOP_KEY>",
)
response = client.images.generate(
model="xai/grok-imagine-image",
prompt="A red panda coding under the moonlight",
n=1,
)
print(response.data[0].url)