Pricing
Compare models →- Billing is based on the number of images generated.
- Each image will cost $0.07.
Input schema
| Parameter | Type | Description |
|---|---|---|
promptRequired | string | The positive prompt for the generation. |
num_images | integer | Number of images to be generated.Default: 1Minimum: 1 · Maximum: 4 |
README
Grok 2 Image
What is Grok 2 Image?
Grok 2 Image turns a natural-language text prompt into vivid, realistic images.
It’s xAI’s flagship image generation model, tuned for marketing creatives, social posts, product visuals, concept art, and more.
In the API, you use the grok-2-image. A single request can generate multiple images, making it easy to explore variations on a single idea.
Why it looks great
- Photorealistic, high-fidelity imagery
Trained to produce detailed textures, convincing lighting, and sharp compositions that work well for ads, hero images, and product renders.
- Strong prompt following
Optimized for following descriptive prompts closely, capturing objects, layouts, and styles specified in your text while minimizing “prompt drift.”
- Flexible visual styles
Handles realistic photography, digital illustration, stylized artwork, and concept sketches, making it useful for storyboards, thumbnails, and creative exploration.
- Multi-image generation in one shot
A single request can generate up to 10 JPG images, so you can explore multiple creative directions from one prompt.
- Competitive per-image pricing
Images are billed per output image, keeping costs predictable for batch runs and A/B creative testing.
- Prompt refinement under the hood
Before reaching the image model, your text prompt can be lightly revised by a chat model to improve clarity, often leading to more accurate results without extra work on your side.
Pricing
- Billing is based on the number of images generated.
- Each image will cost $0.07.
How to Use
- Write your prompt
- Describe the subject, scene, style, and mood, for example:
- “ultra-wide shot of a neon city at night, rainy streets, cinematic”
- “product photo of wireless earbuds on a marble surface, soft studio lighting”
- Send the generation job
- Call the image API with model: "grok-2-image" (or grok-2-image-1212) and your prompt.
- Optionally specify how many variations to generate (up to 10 images per request).
- Download or display the results
- The API returns JPG images via URLs or encoded data, which you can save, display in an app, or feed into downstream editing/compositing tools.
Note
- Output format:
Images are returned in JPG format.
- Per-job limits:
- Up to 4 images per request
- Additional throughput limits depend on your account/plan.
- Prompt tips:
- Be concrete about objects, layout, and style (e.g., “centered product on plain background”).
- Avoid contradictory instructions in a single prompt.
- Iterate: start simple, then gradually add details once you like the base composition.
More Image Generation Model Choices
High-quality text-to-image generation from Google, suitable for product shots, concept art, and creative visuals.
A versatile image generation model from, tuned for detailed scenes, characters, and stylized compositions.
A flagship image model from Kwaivgi/Kuaishou’s Kling series, focused on sharp, high-fidelity visuals and strong prompt adherence.
An Qwen-based generator hosted by OpenSIAI, delivering robust semantic understanding and reliable text-to-image rendering across diverse styles.
Catalog rates and input examples are published for reference. Contact OpenSI about access and applicable pricing.
Grok 2 Image Text-to-Image API example
The catalog lists POST https://api.opensi.com.ai/api/v3/x-ai/grok-2-image for the submission step. Confirm the endpoint and access with your supplier before sending a request.
HTTP request body
{
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"num_images": 1
}Grok 2 Image Text-to-Image API — Frequently asked questions
What is the Grok 2 Image API?
Grok 2 Image is a xAI model for image generation, exposed as a REST API on OpenSIAI. Grok 2 Image is xAI’s latest image generation model that turns simple text prompts into sharp, photorealistic visuals in seconds. From product shots to social posts and concept art, it follows your instructions closely so you can go from idea to production-ready image with just one prompt. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing. You can call it programmatically or try it from the playground above.
How do I call the Grok 2 Image API?
POST your input parameters to the model's REST endpoint (shown in the API tab of this playground) with your OpenSIAI API key in the Authorization header. Submission returns a prediction ID. Poll the result endpoint starting around every 2 seconds, increase the interval for long-running tasks, and stop on any terminal status. The playground generates Python, JavaScript, and cURL examples for submitting requests and polling results. Full request/response shape is documented at /docs/docs-api/x-ai/grok-2-image.
How much does Grok 2 Image cost per run or per second?
Grok 2 Image starts at $0.07 per run or per second. That figure is the base price — the final charge scales with the parameters you set in the form (output size, length, count, references, or whatever knobs this model exposes), so a higher-quality or larger output costs more than a minimal one. The exact cost for your current input is shown live next to the Generate button before you submit, and the actual per-call charge is recorded on the prediction afterwards.
What inputs does Grok 2 Image accept?
Key inputs: prompt, num_images. The full JSON schema (types, defaults, allowed values) is rendered above the Generate button and mirrored in the API reference at /docs/docs-api/x-ai/grok-2-image.
How long does Grok 2 Image take to generate?
Reported generation time on OpenSIAI is around 5 seconds per request. This is an estimate, not a latency guarantee; queue time and input settings can change the total wait. live status is visible in the prediction record.
Can I use Grok 2 Image outputs commercially?
Commercial usage rights depend on the model's license, set by its provider (xAI). Check the provider's applicable terms and OpenSIAI's Terms of Service before commercial use.
