Skip to main content

Grok Imagine

grok-imagine-image and grok-imagine-image-quality use PopGo's OpenAI Images-compatible endpoints for synchronous image generation and editing. PopGo converts standard size, resolution, and aspect_ratio values to the model's image parameters.

Endpoints

POST https://api.popgo.site/v1/images/generations
POST https://api.popgo.site/v1/images/edits
Authorization: Bearer YOUR_API_KEY

Generation uses JSON and editing uses multipart file upload. No video-style polling is needed.

Supported specifications

ModelResolutionAspect ratios
grok-imagine-image1K, 2K1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3
grok-imagine-image-qualityCurrently configured for 2K; check the live pageThe same seven ratios

For example, 2048x1152 is converted to 2K and 16:9. If sending all three of resolution, aspect_ratio, and size, make them describe the same output.

Fields

FieldTypeDescription
modelstringRequired public model ID
promptstringRequired generation or editing instruction
resolutionstring1K or 2K
aspect_ratiostringOne of the seven ratios above
sizestringWIDTHxHEIGHT, converted by PopGo
nintegerOptional result count, normally 1
response_formatstringOptional url or b64_json
imagefileMultipart editing reference
curl https://api.popgo.site/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL",
"prompt": "A neon city street in the rain, realistic photography",
"resolution": "2K",
"aspect_ratio": "16:9",
"n": 1
}'

Editing uses the same /v1/images/edits multipart shape as the other image pages. Results use data[].url or data[].b64_json; the latter is Base64 without the Data URL prefix.

Errors and billing

resolution accepts only 1K or 2K; 4K is not supported. Ratios must be one of the seven listed values and dimensions must remain inside the 2K range. Do not send quality or style unless the live model page lists them. The word quality in the model ID is not a request field. Billing follows the live model configuration.