xai

xAI: Grok 2 Image Latest

models/Grok 2 Image Latest

Grok 2 Image Latest is xAI's most current image generation model. It processes text prompts to generate high quality images. This model internally uses a chat model to revise the prompt before generating the image, enhancing the quality and relevance of the output. This alias always points to the latest version with the newest features.

Price range: $0.07 - $0.07
  • Standard: $0.07 for size 1024x1024
(Per image)
Currency$USD

Generate API Key Generate your API Key to securely access IndoxHub's AI models. Integrate with OpenAI-compatible tools, run queries, and build powerful AI applications — all with a single secure key.
Endpoint
POSThttps://api.indoxhub.com/api/v1/images/generations
Configxai/grok-2-image-latest
from indoxhub import Client
 
client = Client(api_key="[LOGIN TO GET API KEY]")
 
# Generate an image
response = client.images(
    prompt="A serene mountain landscape with a lake at sunset",
    model="xai/grok-2-image-latest"
)
 
# Get the image URL
image_url = response["data"][0]["url"]
print(f"Generated image URL: {image_url}")