🚀 Z-Image Turbo Image-to-Image is Live — Unlimited Generations for Premium Users

Try Now
Skip to main content

xAI/Grok Imagine Text To Image

grok-imagine-image-t2i
Grok Image Text To ImageLLMs.txt
API PlaygroundAPI Documentation

API Endpoint URL

Base URL for all API requests to this endpoint.

https://modelslab.com/api/v7/images/text-to-image

API Authentication

Authentication requires a valid API key included in the request. Generate and manage your API keys from your developer dashboard. Include the key in the key parameter for all API requests.

Integration Examples

Production-ready code samples for API integration

{
"prompt": "a dramatic scene with a large, menacing dragon and a cloaked figure. The dragon, with its intricate scales and sharp horns, dominates the background, its wings partially spread and its mouth slightly open, revealing sharp teeth. Its scales are a mix of dark red and gray, adding to its intimidating presence. In the foreground, a person stands with their back to the viewer, wearing a detailed, medieval-style cloak and armor. The cloak is deep red with intricate patterns, and the armor is metallic, with a weathered appearance. The setting is a rugged, mountainous landscape with snow-covered peaks and a cloudy sky, enhancing the epic and mystical atmosphere of the scene.",
"model_id": "grok-imagine-image-t2i",
"aspect_ratio": "1:1",
"resolution": "2k",
"key": "YOUR_API_KEY"
}

SDKs

Official SDKs

Production-ready SDKs and client libraries for all major programming languages

API Parameters

Technical specifications for API request parameters.

Field NameParameterTechnical Description
PromptpromptDescribe in text how the image that need to be generated should appear.
Modelmodel_idModel id
Aspect ratioaspect_ratioSelect the aspect ratio
ResolutionresolutionSelect the Resolution acceptable resolution are 1K and 2K