Overview
The model ID remainsgrok-image. Use the preferred REST URLs below. The previous /generateTask/grok-image and /statusTask/grok-image URLs remain supported with the same parameters and pricing.
Grok Imagine Image is an xAI image model for text-to-image generation and multi-reference image-to-image workflows. Use this page when you are ready to call the API after trying the model in the APIXO playground.
Endpoint and authentication
Base URL:
All requests require your APIXO API key:
Copy-paste async quickstart
This minimal request submits a text-to-image task and returns ataskId.
taskId; you need it to poll for the final result.
Poll for result
resultJson after state becomes success:
Request body
Text-to-image
Image-to-image
Parameters
string
default:"async"
Result delivery mode. Omit this field or use
async for polling with statusTask, or use callback for webhook delivery.string
Required when
request_type is callback. Provide a public HTTPS URL that can receive the final task payload. See Webhooks.object
required
Grok Imagine Image input parameters.
Response format
Submit task response
POST /generateTask/grok-imagine-image returns a task ID when the task is accepted:
integer
API status code.
200 means the task was accepted.string
Human-readable status message.
string
Unique task identifier used with the status endpoint.
Status response fields
string
Unique task identifier.
string
Current task state:
pending, processing, success, or failed.string
JSON string containing the generated image URLs. Present when
state is success.string
Machine-readable failure code. Present when
state is failed.string
Human-readable failure message. Present when
state is failed.integer
Task creation timestamp in Unix milliseconds.
integer
Task completion timestamp in Unix milliseconds. Present after completion.
integer
Processing duration in milliseconds. Present after completion.
Webhook callback mode
Use callback mode when your backend should receive the final result automatically instead of polling.Billing
New non-LLM requests use 1 credit =$0.001. Calculate the full amount, including billable quantity and add-ons, apply the applicable account discount, then round the request total upward to the next whole credit. Agreed fixed unit prices retain their precision and replace the standard price and discount; final rounding still applies. See credit conversion and rounding.
The rates below match the main API Pricing catalog’s public base-price table updated on October 30, 2026. Check that page for current rates and any account discount before budgeting.
Text-to-image is billed once per request and returns two images by default. The request price covers those outputs. Image-to-image is billed per generated image.
The market display reference is a separately specified comparison value and does not affect the amount charged.
For example, a text-to-image request that returns its default two images costs
$0.040 in total, before any account discount.
For current API rates in USD, see API pricing.
Latency and polling
Actual latency may vary by prompt complexity, reference image access, queue load, and result storage time.
Result URLs are valid for 15 days. Download and store important outputs promptly.
Prompts can be written in English or Chinese. More specific scene, style, lighting, and composition details usually produce better results. Output is PNG by default; if you need transparency, describe that requirement in the prompt.
Rate limits and concurrency can vary by account, API key, and route. If you receive
429, slow down requests and retry with backoff. For account-level details, see System APIs.
Errors and troubleshooting
HTTP errors
Validation notes
Task failure codes
failCode identifies the task failure. Common values include:
See Error Codes for the full error reference.
To animate an image after generation, use a successful
grok-image task with Grok Imagine Video. This creates a new video from an image result; it does not extend an existing video.
MCP integration
The complete model schema declares result decoding inmcp.result and supported file bindings in mcp.attachments. These are client integration metadata, not generation input parameters. Attachment paths: image_urls. Preserve the user’s file order. Model parameter validation remains on the API.