xAI, the artificial intelligence company spearheaded by Elon Musk, unveiled a new application programming interface (API) on Wednesday. This API is notable for being the first developer tool to incorporate image generation capabilities. Recently, the firm has shifted its focus toward developer tools, launching a total of five APIs since its initial release in November 2024. The pricing structure appears to be on the higher side, and currently, there are no options for users to customize the generated output.
xAI Unveils API Featuring Image Generation Capabilities
Prior to this release, xAI had four available API models for developers. Two of these models were derived from the original version of the Grok large language model (LLM), while the other two were based on Grok 2. While the company previously provided image understanding functionalities, it lacked the ability to generate images directly through the API.
This limitation is likely attributed to xAI having previously relied on an external provider for image generation capabilities via its chat platform. Until the previous year, Black Forest Labs managed image generation for Grok. However, in December, xAI announced the launch of Aurora, an image generation model utilizing a mixture of experts (MoE) network, suggesting an expansion of this model into its developer offerings.
In its updated documentation, xAI has introduced a new API model named ‘grok-2-image-1212,’ which includes image generation capabilities. The process is streamlined: users send a text prompt, which is then refined by a chat model for improved clarity before being processed by the image generation model to produce output.
Developers can request the generation of up to 10 images in a single query by adjusting specific parameters. There is a limit of five requests permitted per second, exceeding which will result in an error notification. The generated images are provided in JPEG format. A recent report from TechCrunch indicated that xAI will charge $0.07 (approximately ₹6) per image.
This pricing positions the service on the higher end of the market, especially when compared to Black Forest Labs’ Flux API, which charges $0.05 (roughly ₹4) per image, and Google’s Imagen 3, priced at $0.03 (approximately ₹2.5) per image. Conversely, Ideogram remains the most expensive option at $0.08 (around ₹7) per image.
Moreover, xAI noted that the current API does not allow for output customizations, such as alterations to image quality, size, or style. It is worth mentioning that the API’s endpoint is compatible with the OpenAI SDK, enabling users to utilize the same base_url; however, it does not work with the Anthropic SDK.