# OpenAI GPT Image 2 Edit API

> GPT Image 2 Editing supports image editing and multi-image synthesis with high-quality results.

Source: https://www.sandbase.ai/models/openai/gpt-image-2/edit
API reference: https://www.sandbase.ai/models/openai/gpt-image-2/edit/docs

## Facts

- Provider: OpenAI
- Type: Image model
- Model ID: `openai/gpt-image-2/edit`
- Price: From $0.17 per run (25% off list price)
- Capabilities: image to image, commercial
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "openai/gpt-image-2/edit",
  "images": [
    "https://cdn.openai.com/API/docs/images/body-lotion.png",
    "https://cdn.openai.com/API/docs/images/soap.png",
    "https://cdn.openai.com/API/docs/images/incense-kit.png",
    "https://cdn.openai.com/API/docs/images/bath-bomb.png"
  ],
  "prompt": "Generate a photorealistic image of a gift basket on a white background labeled '"'"'Relax & Unwind'"'"' with a ribbon and handwriting-like font, containing all the items in the reference pictures.",
  "quality": "high",
  "output_format": "png"
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call OpenAI GPT Image 2 Edit through SandBase?

Create a SandBase API key, then send requests with the model ID "openai/gpt-image-2/edit" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate OpenAI account?

No. One SandBase API key and balance gives you access to OpenAI GPT Image 2 Edit and the other models in the catalog; you do not need to sign up with OpenAI separately.

## README

### GPT Image 2 Edit

GPT Image 2 edit: fine-grained edits and multi-image synthesis. Send images with an instruction to retouch, restyle, or combine them.

#### Fields

| Field | Type | Default | Notes |
|---|---|---|---|
| `images` | image URL[], required | — | Images to edit or combine, Image 1, Image 2, … |
| `prompt` | string, required | — | Up to 50,000 characters. |
| `quality` | `low` / `medium` / `high` | `high` | Higher quality costs more; `high` is the default. |
| `resolution` | `1k` / `2k` / `4k` | — | Output size tier; omit for 1K. |
| `aspect_ratio` | `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` | — | Omit to follow the first input image. |
| `output_format` | `jpeg` / `png` / `webp` | `png` | Output file format. |

#### Billing

Price depends on quality and resolution, per output image, plus $0.012 for each input image after the first:

| Quality, 1 input | 1k | 2k | 4k |
|---|---|---|---|
| low | $0.02 | $0.03 | $0.04 |
| medium | $0.07 | $0.11 | $0.19 |
| high (default) | $0.23 | $0.41 | $0.73 |

Failed runs are not charged.

#### Prompting

- Say which image is the base and what each other image adds.

#### Limits

- One output image per request.

#### Also on SandBase

Other GPT Image endpoints: `openai/gpt-image-2.5-sunburst`, `openai/gpt-image-2.5-sunburst/edit`, `openai/gpt-image-2.5-flare`, `openai/gpt-image-2.5-flare/edit`, `openai/gpt-image-2`.
