Image model

GPT Image 2

OpenAI’s GPT Image 2 model for fast, high-quality text-to-image generation and reference-image editing with flexible sizes.

Model IDopenai/gpt-image-2

API

Call GPT Image 2

Every model takes the same request, so switching to GPT Image 2 is a change to the model field. These samples are written for its own contract and send as they are.

import Mynth from "@mynthio/sdk";

const mynth = new Mynth();

const task = await mynth.image.generate({
  model: "openai/gpt-image-2",
  prompt: "A lighthouse at dusk, 35mm film",
  size: "16:9",
});

console.log(task.urls[0]);

Specifications

What GPT Image 2 accepts

Read from the same registry the API validates against. A request outside it is refused when the task is created, before anything is charged.

Modes and inputs

Text → Image
Prompt only
Image → Image
  • Up to 16 images

Output

Aspect ratios
  • 1:1
  • 4:3
  • 3:4
  • 16:9
  • 9:16
  • 3:2
  • 2:3
  • 5:4

Leave out size, or send auto, and Mynth picks one for the prompt. Any other ratio snaps to the closest of these. Sizes

4K
No. A 4k size fails the task

Prompt

Negative prompt
Not supported. Dropped before the provider call, no error
The contract as GET /models returns it
{
  "modes": {
    "txt->img": {},
    "img->img": {
      "inputs": {
        "rules": [
          {
            "type": "image",
            "max": 16
          }
        ]
      }
    }
  }
}

Pricing

What it costs

Pay per result, in USD, with no subscription. A failed image or video costs nothing. How pricing works

Rates

Image
$0.12 / image
Input image
$0.02 / input

An input is charged once for every image it goes into: two inputs on four images are eight input charges.

Estimate a request

Images
1
Input images
0

$0.121 × $0.12

Held when the task is created. Only images that succeed are charged.

Guide

Working with GPT Image 2

Notes on getting the most out of GPT Image 2.