Skip to main content
POST
cURL
This is the core generation interface of the Grok Image API

Authorizations

TT-API-KEY
string
header
required

Please go to TTAPI Console to obtain the API key.

Body

application/json
prompt
string
required

Prompt word

model
enum<string>
default:grok-imagine-1.0

Image generation model.

Available options:
grok-imagine-1.0,
grok-imagine-2.0,
grok-imagine-image,
grok-imagine-image-quality
enable_pro
boolean
default:true

Only supported by grok-imagine-1.0 and grok-imagine-2.0; grok-imagine-2.0 only allows true. Not supported by other models.

aspect_ratio
enum<string>
default:1:1

Image aspect ratio. grok-imagine-1.0 supports: 1:1 (social media, avatars, thumbnails), 16:9 (landscape images, covers, desktop backgrounds), 9:16 (mobile portrait, short video covers, Stories), 3:2 (landscape photography), 2:3 (portrait photography, posters). grok-imagine-image and grok-imagine-image-quality additionally support: 4:3 (presentations, traditional landscape), 3:4 (portraits, vertical design), 2:1 (horizontal banners, headers), 1:2 (vertical banners, long images), 19.5:9 (horizontal smartphone screens), 9:19.5 (vertical smartphone wallpapers), 20:9 (horizontal ultra-wide screens), 9:20 (vertical ultra-wide screens), auto (model automatically selects ratio based on prompt).

Available options:
1:1,
16:9,
9:16,
3:2,
2:3,
4:3,
3:4,
2:1,
1:2,
19.5:9,
9:19.5,
20:9,
9:20,
auto
resolution
enum<string>
default:1k

Output resolution. 1k is standard (all models); 2k is higher resolution (only grok-imagine-image and grok-imagine-image-quality).

Available options:
1k,
2k
n
integer
default:1

Number of generated images (1 - 4)

hook_url
string

Callback URL. Notifications will be sent to this address when the task is completed or failed, and the notification data structure is consistent with the fetch structure [blocked]. If not set, you need to request the fetch endpoint [blocked] to query the result.

Example:

"https://example.com/callback"

Response

Request succeeded

status
string
required
Example:

"SUCCESS"

message
string
required
Example:

"success"

data
object
required
Example:
Last modified on March 23, 2026