Skip to main content

model guide

GPT Image 2 VIP

gpt-image-2-vip

Exact sizes

Uses the OpenAI Images API with exact pixel-size choices, image editing, and three quality levels.

OpenAI-compatible routeText to imageImage editingQuality tiers
Model details
Model ID
gpt-image-2-vip
Reference price
$0.03/ call
Output sizes
1K / 2K / 4K
API format
OpenAI Images

Prompt presets

These are the settings currently available in YingTu.

Text poster

A minimal coffee poster with the exact headline “COFFEE MADE SIMPLE”, high contrast type, warm natural light, clean commercial layout.

Product banner

A clean e-commerce banner with a centered product, generous copy space, neutral background, and precise visual hierarchy.

UI illustration

A polished onboarding illustration with a simple interface motif, restrained colors, crisp shapes, and generous negative space.

Available settings

These are the settings currently available in the Image Studio.

Best for

  • Exact output dimensions
  • Images containing prominent text
  • OpenAI Images workflows

Check before use

  • Text and spelling must still be reviewed in every output.
  • Quality level affects the request and should be chosen per task.
  • Choose one of the exact sizes available on this page.
Image editing: Supported

API quickstart

This example uses the same request format as the Image Studio.

View API page
gpt-image-2-vip
import base64
import mimetypes
import os
import sys

import requests

API_KEY = os.environ.get("LAOZHANG_API_KEY")
if not API_KEY:
    raise RuntimeError("Set the LAOZHANG_API_KEY environment variable before running this example.")

REQUEST_TIMEOUT_SECONDS = 500
headers = {"Authorization": f"Bearer {API_KEY}"}

def extension_for_mime(mime_type):
    return {
        "image/jpeg": "jpg",
        "image/png": "png",
        "image/webp": "webp",
        "image/gif": "gif",
    }.get(mime_type, "bin")


def decode_base64_image(value, fallback_mime="image/png"):
    mime_type = fallback_mime
    encoded = value
    if value.startswith("data:"):
        header, encoded = value.split(",", 1)
        mime_type = header[5:].split(";", 1)[0] or fallback_mime
    return base64.b64decode(encoded, validate=True), mime_type


def parse_json_response(response):
    try:
        result = response.json()
    except ValueError as error:
        print("API returned a non-JSON response.", file=sys.stderr)
        raise SystemExit(1) from error
    if not isinstance(result, dict):
        print("API returned an unexpected JSON shape.", file=sys.stderr)
        raise SystemExit(1)
    return result


def extract_image(result):
    if not isinstance(result, dict):
        return None
    images = result.get("data") or []
    first_image = images[0] if images and isinstance(images[0], dict) else {}
    encoded = first_image.get("b64_json")
    if isinstance(encoded, str) and encoded:
        return decode_base64_image(encoded)

    image_url = first_image.get("url")
    if isinstance(image_url, str) and image_url:
        image_response = requests.get(image_url, timeout=REQUEST_TIMEOUT_SECONDS)
        image_response.raise_for_status()
        mime_type = image_response.headers.get("Content-Type", "image/png").split(";", 1)[0]
        return image_response.content, mime_type

    return None


def save_result_image(result):
    extracted = extract_image(result)
    if not extracted:
        keys = sorted(result.keys()) if isinstance(result, dict) else []
        print(f"No image data in response. Top-level keys: {keys}", file=sys.stderr)
        raise SystemExit(1)

    image_bytes, mime_type = extracted
    output_path = f"output.{extension_for_mime(mime_type)}"
    with open(output_path, "wb") as output_file:
        output_file.write(image_bytes)
    print(f"Image saved: {output_path} ({mime_type})")


API_URL = "https://api2.laozhang.ai/v1/images/generations"
headers["Content-Type"] = "application/json"

payload = {
    "model": "gpt-image-2-vip",
    "prompt": "A minimal coffee poster with the exact headline “COFFEE MADE SIMPLE”, high contrast type, warm natural light, clean commercial layout.",
    "size": "2048x2048",
    "quality": "high"
}

try:
    response = requests.post(
        API_URL,
        headers=headers,
        json=payload,
        timeout=REQUEST_TIMEOUT_SECONDS,
    )
except requests.Timeout as error:
    print(
        "Request timed out after 500 seconds. The result status may be unknown; "
        "check call and billing logs before retrying.",
        file=sys.stderr,
    )
    raise SystemExit(1) from error

if response.status_code != 200:
    print(f"API error {response.status_code}: {response.text}", file=sys.stderr)
    raise SystemExit(1)

save_result_image(parse_json_response(response))

Studio examples

These gallery images do not include the model or prompt used to create them. They are visual examples, not test results for this model.

Studio example
Studio example
Studio example

Test record

YingTu test results

This section shows only YingTu test results that are ready for public review. When no result is available, we say so instead of showing draft data.

No published result

Product appearance consistency

Whether the product’s shape, proportions, colors, logo, and packaging text remain consistent.

No published result

Background replacement

Whether the subject and its edges remain intact while only the requested background changes.