> ## 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.

# Flux 2 pro Text to Image API

> Ideal for high-quality image manipulation, style transfer, and sequential editing workflows

[← Flux](https://docs.creatify.ai/api-documentation/ai-generation/models/flux.md)

**Model name:** `flux-2-pro`\
**Generation type:** `text_to_image`\
**Endpoint:** [`POST /api/asset_generator/`](https://docs.creatify.ai/api-reference/ai-generation/post-ai-generation)

## Pricing

**0.5** credits per output.

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": "flux-2-pro",
    "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": "flux-2-pro",
        "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*

Prompt

Minimum characters: `1`.
Maximum characters: `2500`.

**seed** `integer`

Random seed for reproducibility. If None, a random seed is chosen.

**image\_size** `string` (default: portrait\_16\_9)

The size of the image to generate. The width and height must be between 512 and 2048 pixels.

Allowed values: `"square_hd"`, `"square"`, `"portrait_4_3"`, `"portrait_16_9"`, `"landscape_4_3"`, `"landscape_16_9"`.

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

The number of images to generate.

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

> [accordion] Complete JSON schema
>
> ```json theme={null}
> {
>   "$schema": "http://json-schema.org/draft-07/schema#",
>   "required": [
>     "prompt"
>   ],
>   "properties": {
>     "seed": {
>       "type": "integer",
>       "title": "Seed",
>       "description": "Random seed for reproducibility. If None, a random seed is chosen.",
>       "x-advance-settings": true
>     },
>     "prompt": {
>       "type": "string",
>       "title": "Prompt",
>       "maxLength": 2500,
>       "minLength": 1
>     },
>     "image_size": {
>       "enum": [
>         "square_hd",
>         "square",
>         "portrait_4_3",
>         "portrait_16_9",
>         "landscape_4_3",
>         "landscape_16_9"
>       ],
>       "type": "string",
>       "title": "Aspect ratio",
>       "default": "portrait_16_9",
>       "x-ui-name": "aspect_ratio",
>       "description": "The size of the image to generate. The width and height must be between 512 and 2048 pixels."
>     },
>     "num_images": {
>       "type": "integer",
>       "title": "Num Images",
>       "default": 1,
>       "maximum": 1,
>       "minimum": 1,
>       "x-ui-name": "output_nums",
>       "description": "The 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.