grok-imagine-image-2.0. The xAI API supports configurable aspect ratio, resolution, output count, and response format through OpenAI-compatible image endpoints.Grok API for Imagine Image 2.0

Choose the Right Grok Image Workflow
Text-to-Image Generation
grok-imagine-image-2.0 model and configure aspect ratio, resolution, output count, and response format for your application.
Natural-Language Image Editing

OpenAI-Compatible Integration
https://api.x.ai/v1 as its base URL.
Grok Imagine Image 2.0 API Capabilities
Dedicated image model
model to grok-imagine-image-2.0 for current Imagine Image 2.0 generation and editing.Text-to-image generation
/v1/images/generations and request up to 10 generated images in one call.Configurable output
Image editing
/v1/images/edits.Up to three edit references
Bearer authentication
Authorization header and keep credentials out of browser code, logs, and repositories.Grok API Pricing for Imagine Image 2.0
Generation output pricing
Media input pricing
Prompt length does not set image cost
Recheck live pricing
Integrate the Grok Image API
1. Create and protect an API key
Authorization: Bearer $XAI_API_KEY. Keep the key server-side.2. Choose generation or editing
/v1/images/generations for prompt-only creation. Use /v1/images/edits when a source image should guide or be transformed.3. Build a validated request
model to grok-imagine-image-2.0, add the prompt, and explicitly choose only the output options your product supports.4. Submit and inspect the response
5. Download and retain assets intentionally
What Developers Build with Grok Imagine Image 2.0
Campaign creative variants
Product and concept visualization
Reference-guided edits
Localized visual production
Grok API FAQ
What is the Grok Imagine Image 2.0 API endpoint?
For image generation, send a bearer-authenticated POST request to https://api.x.ai/v1/images/generations. For image editing, use https://api.x.ai/v1/images/edits.
Which model name should I use?
Use grok-imagine-image-2.0 for current Grok Imagine Image 2.0 generation and editing requests.
How much does the Grok API cost for images?
xAI currently lists Imagine Image 2.0 output from $0.04 to $0.08 per generated image depending on resolution and quality. Image inputs are listed at $0.01 each. Confirm current pricing before deployment.
Can I generate more than one image per request?
Yes. xAI documents configurable output count with up to 10 images in one generation request.
Does the API support image-to-image workflows?
Yes. The image-editing endpoint accepts a public image URL or base64 data URI. Multi-image editing supports up to three source images.
Is the Grok image API OpenAI compatible?
The generation API can be called with an OpenAI client by setting the base URL to https://api.x.ai/v1 and supplying an xAI API key.
Is this page operated by or officially affiliated with xAI?
No. This is an independent developer guide. Grok, Imagine, and xAI names identify the model and provider; this page does not claim partnership, endorsement, or official API operation.
What does “imagine image 2.0 xAI API” refer to?
It refers to the grok-imagine-image-2.0 model exposed through xAI’s image generation and editing endpoints.
