Skip to main content
POST
grok-imagine-image-2.0

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Must be one of: grok-imagine-image-2.0.

Available options:
grok-imagine-image-2.0
prompt
string
required

Required. Up to 5000 Unicode characters. Whitespace-only prompts are not allowed.

Conditional limits:

  • prompt must not contain only whitespace
Minimum string length: 1
images
string<url>[]

Omit for text-to-image generation. Provide 1 to 3 images for editing or reference-based generation. Valid inline images must be prepared as provider-accessible URLs.

Maximum array length: 3
quality
enum<string>
default:2K

Selects the SKU and output unit price. The current Router does not support 1.5K. Defaults to 2K.

Available options:
1K,
2K
generation_quality
enum<string>
default:medium

Selects the SKU and output unit price independently of the output resolution. Defaults to medium.

Available options:
low,
medium
max_images
integer
default:1

Request 1 to 10 images. Omitted or zero values fall back to 1 in code. Final billing must use the actual output count. Defaults to 1.

Required range: 1 <= x <= 10
size
enum<string>

Only for requests without reference images. The Provider defaults to 1:1 when omitted. Omit this field for editing; do not set a global size default.

Conditional limits:

  • size is not allowed for image editing; omit this field
Available options:
16x9,
19.5x9,
1x1,
1x2,
20x9,
2x1,
2x3,
3x2,
3x4,
4x3,
9x16,
9x19.5,
9x20

Response

Business response. code=0 means the task was accepted; validation failures can return HTTP 200 with code=400.

code
enum<integer>
required
Available options:
0
Example:

0

data
object
required
msg
string
required
Example:

"success"

request_id
string<uuid>
Example:

"250b66dd-e1fb-4bb6-b5f6-c668efadc35d"