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

# Grok Image 2 Text to Image API

> xAI Grok Imagine Image 2.0 — strong in-scene typography, 13 aspect ratios, low/medium quality tiers at 1K/2K (via fal).

[← Grok Image](https://docs.creatify.ai/api-documentation/ai-generation/models/grok-image.md)

**Model name:** `grok-imagine-image/v2.0`\
**Generation type:** `text_to_image`\
**Endpoint:** [`POST /api/asset_generator/`](https://docs.creatify.ai/api-reference/ai-generation/post-ai-generation)

## Pricing

| Quality | 1k | 2k |
| - | - | - |
| low | **0.5** | **1.0** |
| medium | **1.0** | **1.0** |

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

## Quick start

```bash cURL theme={null}
curl --request POST \
  --url https://api.creatify.ai/api/asset_generator/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-ID: your-api-id' \
  --header 'X-API-KEY: your-api-key' \
  --data '{
    "model_name": "grok-imagine-image/v2.0",
    "input_params": {
      "prompt": "A product photo of a ceramic mug on a marble counter, soft daylight."
    }
  }'
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.creatify.ai/api/asset_generator/",
    headers={"X-API-ID": "your-api-id", "X-API-KEY": "your-api-key"},
    json={
        "model_name": "grok-imagine-image/v2.0",
        "input_params": {
            "prompt": "A product photo of a ceramic mug on a marble counter, soft daylight."
        },
    },
)
print(response.json()["id"])
```

## Input parameters

Send these fields in `input_params`.

**prompt** `string` *required*

The text prompt for image generation.

Minimum characters: `3`.
Maximum characters: `5000`.

**aspect\_ratio** `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"`.

**resolution** `string` (default: 1k)

Output resolution.

Allowed values: `"1k"`, `"2k"`.

**quality** `string` (default: medium)

Quality level of the generated image.

Allowed values: `"low"`, `"medium"`.

**num\_images** `integer` (default: 1)

Number of images to generate.

Minimum: `1`.
Maximum: `4`.

> [accordion] Complete JSON schema
>
> ```json theme={null}
> {
>   "$schema": "http://json-schema.org/draft-07/schema#",
>   "required": [
>     "prompt"
>   ],
>   "properties": {
>     "prompt": {
>       "type": "string",
>       "title": "Prompt",
>       "maxLength": 5000,
>       "minLength": 3,
>       "description": "The text prompt for image generation."
>     },
>     "aspect_ratio": {
>       "enum": [
>         "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"
>       ],
>       "type": "string",
>       "title": "Aspect Ratio",
>       "default": "1:1",
>       "description": "The aspect ratio of the generated image."
>     },
>     "resolution": {
>       "enum": [
>         "1k",
>         "2k"
>       ],
>       "type": "string",
>       "title": "Resolution",
>       "default": "1k",
>       "description": "Output resolution.",
>       "x-advance-settings": true
>     },
>     "quality": {
>       "enum": [
>         "low",
>         "medium"
>       ],
>       "type": "string",
>       "title": "Quality",
>       "default": "medium",
>       "description": "Quality level of the generated image.",
>       "x-advance-settings": true
>     },
>     "num_images": {
>       "type": "integer",
>       "title": "Number of Images",
>       "default": 1,
>       "minimum": 1,
>       "maximum": 4,
>       "x-ui-name": "output_nums",
>       "description": "Number of images to generate."
>     }
>   }
> }
> ```

## Response

The request returns the task with `status: "initializing"`. Poll [GET /api/asset\_generator/\{id}/](https://docs.creatify.ai/api-reference/ai-generation/get-ai-generation-.md) 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`.


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