Create Grok Image
POST
/v1/images/generationsGenerate an image with a Grok image model.
Request Body
application/jsonprompt:requiredstringText instruction describing the requested output.
Example
A collage of London landmarks in a stenciled street‑art styleaspect_ratio:requiredstringAspect ratio of the generated media.
Allowed
1:13:44:39:1616:92:33:29:19.519.5:99:2020:91:22:1autoExample
automodel:requiredstringModel identifier used for this request.
Example
grok-imagine-image-qualityn:requiredintegerNumber of results to generate.
resolution:requiredstringResolution of the generated media.
Allowed
1k2kresponse_format:requiredstringFormat used to return generated media.
Allowed
urlb64_jsonExample
urlResponse
200A successful request returns a JSON response. The complete example is shown in the code panel.