Skip to main content
← Grok Image Model name: grok-imagine-image/v2.0
Generation type: text_to_image
Endpoint: POST /api/asset_generator/

Pricing

Prices are per output. When a request asks for several outputs, the charge is this price times the number of outputs.

Quick start

Input parameters

Send these fields in input_params.
string
required
The text prompt for image generation.Minimum characters: 3. Maximum characters: 5000.
string
default:"1:1"
The aspect ratio of the generated image.Allowed values: "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "2:1", "1:2", "20:9", "19.5:9", "9:19.5", "9:20".
string
default:"1k"
Output resolution.Allowed values: "1k", "2k".
string
default:"medium"
Quality level of the generated image.Allowed values: "low", "medium".
integer
default:1
Number of images to generate.Minimum: 1. Maximum: 4.

Response

The request returns the task with status: "initializing". Poll GET /api/asset_generator/{id}/ until status is done or failed, or pass a webhook_url to be notified. A finished task lists its files in assets and the credits it charged in credits_used.