Skip to main content
POST
Create Grok Imagine Image — Edit

Overview

xAI Grok Imagine image — grok-imagine-image-quality (1K/2K), text-to-image and edit. Optimized for image to image via apisale.
Docs = API contract + Try it (snapshot). Explore = browser playground. Model page = product examples.

Endpoint

Pricing

From $0.035/image apisale price is 30% below the vendor’s official list price.
Official price = vendor list price. apisale price = what you pay through apisale.

Request

Parameters

Fields marked * are required. Use Authorization: Key YOUR_API_KEY for REST.
string
required
Text prompt describing the image. Maximum 10000 characters.
string
required
Input image URL.
number
Number of images to generate (1-4). Default: 1 Range: 1 – 4
string
Default: 1k Values: 1k, 2k
string
Default: 1:1 Values: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3
string
Default: jpeg Values: jpeg, png, webp
string
Optional HTTPS webhook when the run reaches a terminal state.
boolean
Block until completion (same Run response shape).

Submit response

Returns a Run with run_id. Poll with GET /v1/runs/{run_id} or use Try it above.
string
required
Unique run ID — save for polling and webhooks.
string
required
queued (async) or terminal state for sync runs.
object
Result when status is succeeded — see Output schema below.

Example (async submit)

Full lifecycle: Runs lifecycle.

Output

When status is succeeded, output follows this schema:

Example

Authorizations

Authorization
string
header
required

Key sk-... (native REST) or Bearer sk-... (vendor SDKs)

Body

application/json
input
object
required
Example:
webhook_url
string<uri>
sync
boolean
default:false

Response

201 - application/json

Run accepted

run_id
string
required

Unique run identifier

endpoint
string
required

Model slug

model
string
required
capability
string
required
mode
string
required
status
enum<string>
required
Available options:
queued,
processing,
succeeded,
failed,
timeout,
cancelled
created_at
string<date-time>
required
output
object | null
error
object | null
billing
object | null
started_at
string<date-time> | null
completed_at
string<date-time> | null
elapsed_ms
number | null