Create an image
Create a Grok image from a text prompt.
This API reuses the OpenAI Images Generations path and supports Grok-specific parameters such as aspect_ratio and resolution.
/v1/images/generationsCreate one or more images from a text prompt. This API reuses the OpenAI-style POST /v1/images/generations endpoint and adds aspect-ratio and resolution parameters for Grok image models.
Example model IDs include grok-imagine-image-pro and grok-imagine-image. Before calling the API, use the model list for the current API key to confirm which model IDs are available.
A single request can create up to 10 images. URL results are temporary and should be downloaded or processed promptly. Generated content may be filtered by content policies, and output images are typically in JPG format.
Authorization
bearerAuth Use Bearer your-api-key in the Authorization header.
In: header
Request Body
application/json
Grok image-generation request parameters.
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json