Bearer auth
Send your API key in the Authorization header for generation, status and history requests.
Developer API
Call the public Grok Imagine Image 2.0 endpoints from your own backend with an API key, submit text-to-image jobs, poll status and read generation history.

Send your API key in the Authorization header for generation, status and history requests.
Submit prompts, monitor generation progress and retrieve completed images through documented endpoints.
Grok Imagine Image 2.0 generations normally cost 5 credits per image.
Create an API key in your account, then send it as Authorization: Bearer <YOUR_API_KEY>. Keep the key on your server and never expose it in public browser code.
Send the provider model ID with an input object containing prompt and aspect_ratio. Status and history responses return the task state and generated result URLs when available.
curl -X POST https://imagineimage2.org/api/image/grok-imagine/generate \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"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"
}
}'curl "https://imagineimage2.org/api/image/grok-imagine/status?task_id=<TASK_ID>" \
-H "Authorization: Bearer <YOUR_API_KEY>"curl "https://imagineimage2.org/api/image/grok-imagine/list?page=1&limit=12" \
-H "Authorization: Bearer <YOUR_API_KEY>"Sign in, create or copy your API key, and store it in your backend secret manager.
POST to the generation endpoint with the text-to-image model ID plus input.prompt and input.aspect_ratio.
Use task_id to query status, then render completed image URLs in your own product flow.
Yes. API generations use the same credit system as the online workspace, and Grok Imagine Image 2.0 normally costs 5 credits per image.
No. Call it from your backend so the API key stays private. Your frontend should call your own server, not store the key in browser code.