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

# flux-kontext-pro

> API usage guide for flux-kontext-pro.

{/* source_model_id: flux-kontext-pro */}

{/* source_updated_at: 1759794184 */}

**Model ID**

```bash theme={null}
flux-kontext-pro
```

**Calling method:** sync

# Flux Kontext Pro API Usage Guide

## Overview

**Flux Kontext Pro** is a production-grade text-to-image model optimized for quality, speed, and controllability. It supports common aspect ratios, guidance scaling, seed control, step tuning, and flexible response formats. Designed for creative generation and enterprise workflows, it produces consistent, detailed images from natural language prompts.

## Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Submit Image Generation Request

### Base URL

```
https://console.gmicloud.ai
```

### Endpoint

```
POST /api/v1/ie/requestqueue/apikey/requests
```

### Request Format

```bash theme={null}
curl -X POST "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-kontext-pro",
    "payload": {
      "prompt": "A majestic eagle soaring through a mountain landscape at sunset",
      "aspect_ratio": "16:9",
      "prompt_upsampling": false,
      "safety_tolerance": "2",
      "seed": 0
    }
  }'
```

### Request Parameters

| Parameter           | Type    | Required | Description                                                                                                                                                                                                            | Default | Constraints                                         |
| ------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | --------------------------------------------------- |
| `prompt`            | string  | Yes      | Text description of the desired image (max 2000 characters).                                                                                                                                                           | -       | Required                                            |
| `aspect_ratio`      | string  | No       | Desired aspect ratio of the generated image (e.g., 16:9). Supported Range: Aspect ratios can range from 3:7 (portrait) to 7:3 (landscape). All outputs are approximately 1MP total. Use null to let the system decide. | "1:1"   | Options: "1:1", "16:9", "9:16", "4:3", "3:7", "7:3" |
| `seed`              | integer | No       | Random seed for reproducible results (0 for random).                                                                                                                                                                   | 0       | 0 to 2147483647                                     |
| `prompt_upsampling` | boolean | No       | If true, performs upsampling/enhancement on the prompt for improved detail and adherence.                                                                                                                              | false   | Optional                                            |
| `safety_tolerance`  | integer | No       | Moderation level for inputs and outputs. 0 is most strict, 6 is more permissive.                                                                                                                                       | 2       | 0 to 6                                              |
| `output_format`     | string  | No       | Desired format of the output image.                                                                                                                                                                                    | "jpeg"  | Options: "jpeg", "png"                              |

### Response

```json theme={null}
{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "model": "flux-kontext-pro",
  "status": "queued",
  "created_at": 1750442925,
  "updated_at": 1750442925,
  "queued_at": 1750442925
}
```

## Check Request Status

### Endpoint

```
GET /api/v1/ie/requestqueue/apikey/requests/{request_id}
```

### Example

```bash theme={null}
curl -X GET "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response

```json theme={null}
{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "org_id": "your-org-id",
  "model": "flux-kontext-pro",
  "status": "success",
  "is_public": false,
  "payload": {
      "prompt": "A majestic eagle soaring through a mountain landscape at sunset",
      "aspect_ratio": "16:9",
      "prompt_upsampling": false,
      "safety_tolerance": "2",
      "seed": 0
  },
  "outcome": {
    "media_urls": [
      {
        "id": "0",
        "url": "https://storage.googleapis.com/gmi-generated-assets/.../output_0.jpg"
      },
    ]
  },
  "created_at": 1750442925,
  "updated_at": 1750442930,
  "queued_at": 1750442925
}
```

## Request Status Values

| Status       | Description                             |
| ------------ | --------------------------------------- |
| `queued`     | Request is waiting to be processed      |
| `processing` | Video generation is in progress         |
| `success`    | Video generation completed successfully |
| `failed`     | Video generation failed                 |
| `cancelled`  | Request was cancelled                   |

## List Your Requests

### Endpoint

```
GET api/v1/ie/requestqueue/apikey/requests?model_id=flux-kontext-pro
```

### Example

```bash theme={null}
curl -X GET "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests?model_id=flux-kontext-pro" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Get Model Information

### Endpoint

```
GET /api/v1/ie/requestqueue/apikey/models/Veo3
```

### Example

```bash theme={null}
curl -X GET "https://api.example.com/api/v1/apikey/models/flux-kontext-pro" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## List Available Models

### Endpoint

```
GET /api/v1/apikey/models
```

### Example

```bash theme={null}
curl -X GET "https://api.example.com/api/v1/apikey/models" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response

```json theme={null}
{
    "model_ids": [
        "flux-kontext-pro",
        "other-model-1",
        "other-model-2"
    ]
}
```

## Pricing

* **Pricing Type**: Per-image request
* **Price**: \$0.05 per image
* **Unit**: Image

## Tips for Better Results

1. **Prompt Clarity**: Use detailed, specific prompts for precise results.
2. **Seed Usage**: Use the same seed with identical parameters for reproducible results
