Grok Imagine Image 2

Grok Imagine Image 2.0 API

Grok Imagine Image 2.0 API integration method.

Use a Bearer API key from your own backend, submit text-to-image prompts, poll task status, list recent jobs, and keep credentials out of browser-side code.

Authentication

Send your API key with every request using Authorization: Bearer <YOUR_API_KEY>. Store the key on your server and do not expose it in frontend JavaScript.

Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json

Generate

POST https://imagineimage2.org/api/image/grok-imagine/generate

{
  "model": "grok-imagine-image-2-0/text-to-image",
  "input": {
    "prompt": "A clean product poster for a silver perfume bottle, readable headline, studio lighting",
    "aspect_ratio": "16:9"
  }
}

Status

Use the returned task_id to check generation progress and read result URLs when the task completes.

GET https://imagineimage2.org/api/image/grok-imagine/status?task_id=<TASK_ID>

History

List recent image generation tasks for the same API key with pagination.

GET https://imagineimage2.org/api/image/grok-imagine/list?page=1&limit=12

Model options

  • Aspect ratios: 1:1, 2:3, 3:2, 16:9, 9:16.
  • Common uses: product visuals, posters, portraits and social content.
  • Start with the online studio when you want to validate prompt quality before sending API traffic.