Create Grok Image
POST
/v1/images/generationsGenerate an image with a Grok image model.
Request Body
application/jsonprompt:requiredstringText instruction describing the requested output.
aspect_ratio:optionalstringAspect 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.
n:optionalintegerNumber of results to generate.
resolution:optionalstringResolution of the generated media.
Allowed
1k2kresponse_format:optionalstringFormat 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.