Skip to content
Docs menu

Image models

Grok Imagine Image 2.0

On this page

xAI's Grok Imagine 2.0 — fast, stylised image generation with up to 12 images per request.

modelIdgrok-imagine-image-2-text-to-image
Modalityimage
PricingSee this model on the Pricing page for the current per-call price (with your markup).

Operations

OperationmodelIdEndpointRequired input
Defaultgrok-imagine-image-2-text-to-imagePOST /api/v1/generateprompt
Poll taskGET /api/v1/task/{id}?model=grok-imagine-image-2-text-to-image

Input parameters

FieldTypeRequiredValues / example
promptstringYesWhat to generate. Required, up to 10,000 characters. Max 4000 characters. (example: Ultra-photorealistic avant-garde fashion editorial of an original futuristic dragon, square 1:1. A sleek black cyberpunk dragon styled like a high-fashion… — full value in the request example)
sizestringNoFraming of the generated image. (options: 1:1 | 2:3 | 3:2 | 3:4 | 4:3 | 9:16 | 16:9) (default: 1:1)
nstringNoHow many images to generate. Each delivered image is charged. (options: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) (default: 1)

Example request

bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"grok-imagine-image-2-text-to-image","input":{"prompt":"Ultra-photorealistic avant-garde fashion editorial of an original futuristic dragon, square 1:1.\n\nA sleek black cyberpunk dragon styled like a high-fashion icon, wearing elegant asymmetrical couture, flowing black fabric, sculptural chrome accessories, glossy leather details and futuristic jewelry. Sophisticated, rebellious, strange and effortlessly cool — not bulky, not military, not generic fantasy.\n\nThe dragon stares directly into the camera with a sharp, confident, slightly arrogant expression. Head lowered slightly, eyes locked on the lens. Elegant S-curve neck, body angled diagonally, one wing dramatically raised, the other partially folded, tail sweeping through the frame. A slim glowing chrome crystal is held between its teeth.\n\nBackground: clean vivid golden-yellow studio backdrop.\n\nAdd minimal bright-red geometric shapes and diagonal lines arranged around the dragon in a sophisticated triangular composition.\n\nHigh-end luxury fashion photography, large-format camera, 50mm lens, dramatic studio lighting, realistic shadows, authentic fabric and chrome reflections, detailed reptilian skin, individual scales, natural imperfections, subtle film grain.\n\nYellow + red + black dominant color palette. Bold, graphic, premium, unconventional, iconic.\n\nThe final image must look like a real luxury fashion campaign photographed in a professional studio, not CGI or a videogame render.\n\nMinimal editorial text: “NO ORDINARY BEAST”.\n\nNo logos, watermark, copyrighted characters, extra limbs, duplicated wings, malformed anatomy, bulky armor or generic cyberpunk design.","size":"1:1","n":"1"}}'