# GPT Image 2

GPT Image 2 costs $0.22 per image on LLM API. It generates and edits images.

Model ID: `gpt-image-2` · OpenAI · Image generation
Updated: 2026-10-13
Canonical: https://llmapi.ai/models/openai-gpt-image-2/

- Per image: $0.22
- Modes: Generate, Edit
- Input images: Up to 16

## Pricing

Lowest price among 2 providers, after discounts.

| Price | Amount | Per |
| --- | --- | --- |
| Image | $0.22 | per image |
| Input | $5 | per 1M tokens |
| Output | $30 | per 1M tokens |
| Cache read | $1.25 | per 1M tokens |

**Volume pricing.** At higher monthly volume, GPT Image 2 may cost less. Book a call and sales will quote a price for your usage. [Book a call with sales](https://meetings.hubspot.com/julia-andriienko/llmapi) or [Create an account first](https://app.llmapi.ai/signup).

## Providers

Prices after each provider’s discount; the lowest in bold.

| Provider | Per image | Input / 1M | Output / 1M | Cache read / 1M |
| --- | --- | --- | --- | --- |
| [OpenAI](https://llmapi.ai/providers/openai/) | $0.22 | $5 | $30 | $1.25 |
| [Azure](https://llmapi.ai/providers/microsoft-azure/) | $0.22 | $5 | $30 | $1.25 |

## Specifications

- Modes: Generate, Edit
- Output formats: PNG, JPEG, WebP
- Input images: Up to 16, 50 MB each
- Sizes: 18 sizes: 1024×1024, 1536×1024, 1024×1536, 2048×2048, 2048×1152, 3840×2160, 2160×3840, 1312×800, 2560×1440, 1440×480, 3840×1648, 1536×864, 2880×960, 1920×640, 3360×1120, 864×1536, 800×1312, 1248×832

## Call GPT Image 2

### Generate (`POST /v1/images/generations`)

Set LLMAPI_KEY to your LLM API key.

```python
import base64
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llmapi.ai/v1",
    api_key=os.environ["LLMAPI_KEY"],
)

result = client.images.generate(
    model="gpt-image-2",
    prompt="A lighthouse at dawn, watercolor",
)
with open(f"image.{result.output_format}", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))
```

Docs: [Generate docs](https://docs.llmapi.ai/api/v1/images)

### Edit (`POST /v1/images/edits`)

Set LLMAPI_KEY to your LLM API key.

```python
import base64
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llmapi.ai/v1",
    api_key=os.environ["LLMAPI_KEY"],
)

result = client.images.edit(
    model="gpt-image-2",
    image=open("photo.png", "rb"),
    prompt="Replace the sky with a sunset",
)
with open(f"edited.{result.output_format}", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))
```

Docs: [Edit docs](https://docs.llmapi.ai/api/v1/images)

## More from OpenAI

- [GPT Image 2.5 Sunburst](https://llmapi.ai/models/openai-gpt-image-2-5-sunburst/): $0.22 per image
- [GPT Image 2.5 Flare](https://llmapi.ai/models/openai-gpt-image-2-5-flare/): $0.22 per image

Prices synced 2026-11-09.

Next step: [Get API key](https://app.llmapi.ai/signup)
