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/jsonGrok Imagine Image 2.0 API
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/jsonPOST 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"
}
}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>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