xAI Launches Grok-2 API with Image Generation Support
xAI has announced the launch of the Grok-2 API, an interface that supports both text and image generation. Developers can now directly access high-performance models through the API, significantly expanding Grok’s capabilities in multimodal tasks. This update marks another major step forward for xAI in the field of generative artificial intelligence.
Core API Features Released
According to official reports, the Grok-2 API introduces a dedicated image generation model, grok-2-image-1212. Users can input text prompts to generate images, with the model supporting up to 10 images per single request. The output format is standardized as JPG, and the API allows for image editing and style transfer through natural language instructions.
Technical Parameters and Control Options
Developers can flexibly specify image aspect ratios, including 1:1, 16:9, 9:16, 4:3, and more, with support for 1k and 2k resolution options. A batch generation mode allows for the creation of multiple image variations in a single request, and the system also supports multi-turn conversational image refinement. All generation processes are subject to content moderation to ensure compliant use.
Pricing Model and Access Limits
The API uses a per-image billing model, charging $0.07 for each generated image. The request rate is limited to a maximum of 5 per second, suitable for most development scenarios. xAI previously launched its base API in October 2024, and this image functionality is a significant subsequent expansion. The official documentation provides SDK examples and supports OpenAI-compatible calling methods.
Developer Integration and Use Cases
Developers can quickly integrate image generation capabilities using the xAI SDK or standard API endpoints. The interface returns a temporary image URL or Base64 data for easy subsequent processing or display. The image editing feature supports inputting an existing image URL to perform prompt-based modifications or style transfers, further enhancing the development efficiency of multimodal applications.
Significance of Multimodal Capability Expansion
The combination of the Grok-2 API’s image generation function with its existing text model provides a unified solution for building end-to-end creative workflows. The official documentation and code examples are now available, and developers can apply for an API key to start testing immediately.