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
| Model | Resolution | Aspect ratios |
|---|---|---|
grok-imagine-image | 1K, 2K | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 |
grok-imagine-image-quality | Currently configured for 2K; check the live page | The 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
| Field | Type | Description |
|---|---|---|
model | string | Required public model ID |
prompt | string | Required generation or editing instruction |
resolution | string | 1K or 2K |
aspect_ratio | string | One of the seven ratios above |
size | string | WIDTHxHEIGHT, converted by PopGo |
n | integer | Optional result count, normally 1 |
response_format | string | Optional url or b64_json |
image | file | Multipart 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.