# OpenAI GPT Image 2.5 Flare Specification

OpenAI GPT Image 2.5 Flare is the fast, balanced model in the GPT Image 2.5 family. It is optimized for everyday generative imagery, rapid iteration, social media creatives, concept drafting, and low-latency image editing across multiple resolutions and quality tiers.

---

## 1. Quick Overview

* **Model Slug:** `gpt-image-2.5-flare` (or `gpt-image-2-5-flare`)
* **Endpoint:** `POST https://api.amandevelops.com/v1/gpt-image-2.5-flare/`
* **Category:** Fast Text-to-Image & Image-to-Image (Edit)
* **Automatic Mode Switching:** Operates in Text-to-Image mode when `image_input` is empty, or automatically switches to Edit mode when reference images are provided.
* **Output Formats:** PNG (`png`), JPEG (`jpeg`), or WebP (`webp`)
* **Resolution Tiers:** `1k`, `2k`, `4k`
* **Quality Tiers:** `low`, `medium` (default), `high`, `xhigh`, `max`
* **Status Polling:** Pure-database polling at `GET /v1/tasks/{task_id}`
* **Webhooks:** Optional signed webhook callbacks upon job completion

---

## 2. API Request Specification

* **HTTP Method:** `POST`
* **Path:** `/v1/gpt-image-2.5-flare/`
* **Headers:**
  ```http
  Authorization: Bearer <YOUR_API_KEY>
  Content-Type: application/json
  ```

### Example 1: Fast Text-to-Image Generation

```json
{
  "prompt": "Vibrant cyberpunk street market at night with glowing pink and cyan neon signs, rain slicked streets, cinematic lighting",
  "aspect_ratio": "16:9",
  "resolution": "1k",
  "quality": "medium",
  "output_format": "png",
  "webhook_url": "https://your-domain.com/api/webhooks/image-completed"
}
```

### Example 2: Fast Image-to-Image / Edit Mode

When `image_input` contains one or more reference images, the model automatically operates in Edit mode:

```json
{
  "prompt": "Add flying futuristic hover vehicles in the sky above the street",
  "image_input": [
    "https://your-domain.com/assets/sample-street.jpg"
  ],
  "aspect_ratio": "16:9",
  "resolution": "1k",
  "quality": "medium",
  "output_format": "png"
}
```

---

## 3. Parameter Reference

| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
| `prompt` | `string` | **Required** | — | Detailed natural language instruction or edit description (up to 20,000 characters). |
| `aspect_ratio` | `string` | Optional | `"auto"` | Target canvas proportion: `"1:1"`, `"1:2"`, `"2:1"`, `"1:3"`, `"3:1"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:3"`, `"4:5"`, `"5:4"`, `"9:16"`, `"16:9"`, `"9:21"`, `"21:9"`, or `"auto"`. |
| `resolution` | `string` | Optional | `"1k"` | Output resolution: `"1k"`, `"2k"`, or `"4k"`. |
| `quality` | `string` | Optional | `"medium"` | Rendering fidelity tier: `"low"` (fast draft), `"medium"` (balanced default), `"high"`, `"xhigh"`, or `"max"` (highest fidelity). |
| `output_format` | `string` | Optional | `"png"` | Target file format: `"png"`, `"jpeg"`, or `"webp"`. |
| `image_input` | `array` | Optional | `[]` | Array of public HTTP/HTTPS image URLs or base64 Data URIs to edit or use as reference (Max 14 images). Adding images switches the request to Edit mode. |
| `webhook_url` | `string` | Optional | `null` | Your webhook URL to receive an automated HTTP POST notification when generation completes. |

---

## 4. Pricing & Wallet Economics

Requests to `gpt-image-2.5-flare` are billed dynamically from your prepaid wallet balance based on the selected resolution, quality tier, and the number of reference images:

$$\text{Total Cost} = \text{Base Price}(\text{resolution}, \text{quality}) + (\text{Input Images} \times \$0.0150)$$

### Base Rate Matrix (Text-to-Image)

| Resolution | `low` | `medium` (Default) | `high` | `xhigh` | `max` |
|---|---|---|---|---|---|
| **1k** | $0.0100 | **$0.0240** | $0.0900 | $0.1600 | $0.3600 |
| **2k** | $0.0200 | **$0.0400** | $0.1500 | $0.2700 | $0.6000 |
| **4k** | $0.0300 | **$0.0700** | $0.2700 | $0.4800 | $1.0000 |

### Input Image Surcharge
* Each reference image provided in `image_input` adds **+$0.0150 USD** to the base rate.
* **Examples:**
  * 1k, medium (default) text-to-image: **$0.0240 USD**
  * 1k, medium with 1 reference image (edit): **$0.0390 USD**
  * 2k, medium with 2 reference images: $\$0.0400 + (2 \times \$0.0150) = \mathbf{\$0.0700\text{ USD}}$
  * 4k, max with 10 reference images: $\$1.0000 + (10 \times \$0.0150) = \mathbf{\$1.1500\text{ USD}}$

> [!TIP]
> **Automated Failure Refund:**
> If an inference task encounters a timeout or upstream failure, reserved funds are automatically refunded back to your wallet balance immediately.

---

## 5. Integration Code Examples

### cURL
```bash
curl -X POST https://api.amandevelops.com/v1/gpt-image-2.5-flare/ \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "An anime hero looking at a neon-lit futuristic skyline at night, cinematic lighting",
    "aspect_ratio": "16:9",
    "resolution": "1k",
    "quality": "medium"
  }'
```

### Python
```python
import requests

url = "https://api.amandevelops.com/v1/gpt-image-2.5-flare/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "prompt": "Cozy Scandinavian living room with a fireplace, warm ambient glow, minimalist modern furniture",
    "aspect_ratio": "16:9",
    "resolution": "1k",
    "quality": "medium"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

### JavaScript (Node.js)
```javascript
const response = await fetch("https://api.amandevelops.com/v1/gpt-image-2.5-flare/", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "prompt": "Portrait of an astronaut floating in deep space with reflection of Earth in the gold visor",
    "aspect_ratio": "1:1",
    "resolution": "1k",
    "quality": "medium"
  })
});

const data = await response.json();
console.log("Task Queued:", data);
```