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

# GPT Image 2 VIP parameters

> Reference gpt-image-2-vip size and quality, single or multi-image input, idempotent tasks, native ImagesResponse output, and errors.

Use this exact public ID:

```text theme={"system"}
gpt-image-2-vip
```

## Output controls

| Field     | Supported value                                            |
| --------- | ---------------------------------------------------------- |
| `size`    | Set explicitly to `1024x1024`, `2048x2048`, or `3840x2160` |
| `quality` | `low`, `medium`, `high`, `auto`                            |
| `n`       | Omit or use `1`                                            |
| Result    | One Base64 PNG in `data[0].b64_json`                       |

The official `gpt-image-2` model accepts additional resolutions that meet the constraints in OpenAI's [image generation guide](https://developers.openai.com/api/docs/guides/image-generation#customize-image-output). This API exposes the three presets above for Generate, Async Generate, and Edit. Set `size` explicitly when exact pixels matter; omitted-size behavior is outside this public API.

## Generate request

```json theme={"system"}
{
  "model": "gpt-image-2-vip",
  "prompt": "A silver toy rocket in a desert at sunrise, no text",
  "size": "2048x2048",
  "quality": "medium",
  "n": 1
}
```

Send this body to `/v1/images/generations` for synchronous generation.

## Unified asynchronous body

Send JSON to `/v1/images/tasks`. Use `action=generate` without `input_images`, or `action=edit` with 1–16 Base64 images:

```json theme={"system"}
{
  "model": "gpt-image-2-vip",
  "action": "edit",
  "prompt": "Keep the product and replace the background with pale blue",
  "input_images": [
    {"mime_type": "image/png", "data": "BASE64_SOURCE_IMAGE_1"},
    {"mime_type": "image/jpeg", "data": "BASE64_SOURCE_IMAGE_2"}
  ],
  "size": "2048x2048",
  "quality": "high",
  "n": 1
}
```

Each decoded source must not exceed 20 MiB and all sources together must remain within 64 MiB. `mime_type` must match the actual PNG, JPEG, or WebP bytes. GPT Image tasks omit `aspect_ratio`. Use `Idempotency-Key` for retryable submissions.

## Edit form

Send `multipart/form-data` to `/v1/images/edits` with:

* `model=gpt-image-2-vip`;
* one `image` file;
* a required `prompt`;
* one supported `size` and `quality`;
* `n=1` or an omitted `n`.

Synchronous multipart Edit does not publish one fixed source-image byte or pixel limit. If the gateway returns HTTP `413`, reduce the image and total multipart body before retrying; the unified JSON task limit remains 20 MiB decoded. See [errors and safe retries](/en/getting-started/errors-and-retries).

## Quality behavior

`low` uses a smaller output budget than `medium`; `high` uses the largest supported budget; `auto` lets the route choose. Request duration varies independently, so do not select quality as a timeout control.

An invalid value fails with HTTP 400:

```json theme={"system"}
{
  "error": {
    "message": "quality must be one of: auto, low, medium, high",
    "type": "invalid_request_error",
    "code": "invalid_request"
  }
}
```

The reverse-image contract returns one result and excludes masks, streaming, output-format controls, transparency, callbacks, cancellation, and SDK-specific behavior. Completed tasks preserve native ImagesResponse and retain the image for 24 hours.

<Card title="Copy VIP examples" icon="braces" href="/en/models/image/gpt-image/gpt-image-2-vip/examples">
  Run all three supported workflows.
</Card>
