> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixroute.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok Imagine Image

> Grok Imagine Image: image generation model. Request examples and parameters for MixRoute.

Grok Imagine Image is available through the native image API described below.

Uses native aspect\_ratio and resolution fields rather than the GPT Image size field. The quality control is available only for Image 2.0.

<Tip>
  [Generation parameters](/api-reference/endpoint/grok-imagine-image) | [Editing parameters](/api-reference/endpoint/grok-imagine-edit)
</Tip>

`POST https://api.mixroute.ai/v1/images/generations`

## Examples

Use your MixRoute key in the `MIXROUTE_API_KEY` environment variable. Requests use `Authorization: Bearer ...`. Replace source-image placeholders with accessible images or local files before editing.

```bash theme={null}
curl --request POST "https://api.mixroute.ai/v1/images/generations" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "grok-imagine-image",
  "prompt": "A clean product photograph of a red ceramic mug on a white background.",
  "n": 1,
  "response_format": "url"
}'
```

### Python

```python theme={null}
import json
import os
import requests

payload = json.loads(r'''
{
  "model": "grok-imagine-image",
  "prompt": "A clean product photograph of a red ceramic mug on a white background.",
  "n": 1,
  "response_format": "url"
}
''')
response = requests.post(
    "https://api.mixroute.ai/v1/images/generations",
    headers={"Authorization": "Bearer " + os.environ["MIXROUTE_API_KEY"]},
    json=payload,
    timeout=180,
)
response.raise_for_status()
result = response.json()
for item in result["data"]:
    print(item.get("url") or item.get("b64_json"))
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.