grok-imagine-image/v2.0/editGeneration type:
image_to_imageEndpoint:
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
The example uses sample media from our CDN. Swap in publicly accessible URLs for your own files.Input parameters
Send these fields ininput_params.
The text prompt describing the desired edit.Minimum characters:
3.
Maximum characters: 8000.List of URLs of input images for editing. Up to 3 reference images.Minimum items:
1.
Maximum items: 3.Aspect ratio of the edited image. ‘auto’ preserves the first input image’s aspect ratio.Allowed values:
"auto", "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".Complete JSON schema
Complete JSON schema
Response
The request returns the task withstatus: "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.
