OmniDino
Home Models Pricing Guides About Contact Login Get API Key
EN 中文
GPT Image 2

Generate, edit, and iterate on high-quality AI images with OmniDino.

Use the OmniDino Image Playground or OpenAI-compatible Images API for text-to-image generation, reference-image editing, mask-based changes, size control, and automated workflows.

TXTText to ImageGenerate new images by describing the subject, scene, lighting, composition, and style.
EDITReference-Image EditingUpload one or more images, preserve the subject, and change selected details.
MASKMask EditingUse a mask to control editable areas for local replacement and restoration.
APIAutomation APIConnect websites, applications, scripts, and batch tasks through REST APIs.
Model Overview

What is GPT Image 2?

GPT Image 2 accepts text and image inputs and returns images for high-quality generation and editing.

It is an image model, not a standard chat model.

Use /v1/images/generations to create images and /v1/images/edits to edit them. Do not send these requests to the standard Chat Completions endpoint.

High-Quality GenerationSuitable for posters, product concepts, illustrations, social media assets, and visual design work.
High-Fidelity InputEdit from reference images while controlling how much original detail is preserved.
Flexible Sizes and FormatsSupports common square, landscape, and portrait dimensions, plus PNG, JPEG, and WebP.
Online Workspace

Start generating without writing code.

OmniDino Image Playground

Enter your OmniDino API Key in the browser, select a model, upload reference images, edit masks, and save generation history. The workspace is available at image.omnidino.com.

Generation Endpoint

POST /v1/images/generations

POST
https://api.omnidino.com/v1/images/generations
AuthorizationBearer YOUR_OMNIDINO_API_KEY
Content-Typeapplication/json
Minimal curl Request
curl https://api.omnidino.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_OMNIDINO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "An orange cat in a transparent raincoat standing on a neon-lit street at night, cinematic composition",
    "size": "1024x1024",
    "quality": "high",
    "output_format": "png"
  }'
Common Parameters

Start with the minimum request, then add options one at a time.

PR

prompt

Required. Describe the subject, scene, lighting, camera, composition, materials, and style.

RequiredString
MD

model

Explicitly use the exact model name shown in the OmniDino model catalog.

gpt-image-2
SZ

size

Set the image dimensions and aspect ratio.

1024×10241536×10241024×1536auto
QL

quality

Higher quality usually requires more time and costs more.

lowmediumhighauto
FM

output_format

Set the encoding format of the returned image.

pngjpegwebp
BG

background

Control the background mode. Final support depends on the upstream provider and gateway passthrough.

transparentopaqueauto
CP

output_compression

JPEG or WebP compression level, usually from 0 to 100.

0–100
N

n

The number of images requested. A channel may enforce a lower limit.

1–10
SAFE

moderation

Set moderation strength where supported by the current upstream provider.

autolow
When a parameter error occurs, keep only model, prompt, and size. Add other parameters one at a time after the request succeeds.
Code Examples

Python and Node.js

Python
import base64
import os
import requests

response = requests.post(
    "https://api.omnidino.com/v1/images/generations",
    headers={
        "Authorization": f"Bearer {os.environ['OMNIDINO_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "gpt-image-2",
        "prompt": "A futuristic solar-powered city in soft morning light, realistic architectural photography",
        "size": "1536x1024",
        "quality": "high",
        "output_format": "png",
    },
    timeout=300,
)

response.raise_for_status()
payload = response.json()

with open("omnidino-image.png", "wb") as file:
    file.write(base64.b64decode(payload["data"][0]["b64_json"]))
Node.js
import { writeFile } from "node:fs/promises";

const response = await fetch(
  "https://api.omnidino.com/v1/images/generations",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.OMNIDINO_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "gpt-image-2",
      prompt: "A futuristic solar-powered city in soft morning light, realistic architectural photography",
      size: "1536x1024",
      quality: "high",
      output_format: "png",
    }),
  }
);

if (!response.ok) {
  throw new Error(`${response.status}: ${await response.text()}`);
}

const payload = await response.json();
await writeFile(
  "omnidino-image.png",
  Buffer.from(payload.data[0].b64_json, "base64")
);
Image Editing

POST /v1/images/edits

The editing endpoint uses multipart/form-data to upload reference images, an optional mask, and a text prompt.

01Upload the Original ImageUse image[] to upload one or more reference images.
02Upload a MaskOptional. Transparent areas usually indicate where editing is allowed.
03Write the PromptClearly state what should be preserved, replaced, and added.
04Save the ResultRead b64_json, decode it, and save the image.
curl · Image Editing
curl https://api.omnidino.com/v1/images/edits \
  -H "Authorization: Bearer YOUR_OMNIDINO_API_KEY" \
  -F "model=gpt-image-2" \
  -F "image[]=@./input.png" \
  -F "mask=@./mask.png" \
  -F "prompt=Keep the subject's pose and replace the background with a neon-lit street on a rainy night" \
  -F "size=1024x1024" \
  -F "quality=high" \
  -F "input_fidelity=high" \
  -F "output_format=png" \
  -F "n=1"
The mask dimensions should match the input image. image[] and mask must be uploaded as files, not supplied as ordinary JSON text fields.
Playground vs. API

Choose the entry point that fits your workflow.

Image Playground

No API code required
Supports reference images and mask editing
Visual controls for size, quality, and format
Ideal for design, operations, and everyday creative work
URL: image.omnidino.com

Images API

Ideal for websites, applications, and SaaS products
Supports scripts and batch automation
Allows secure server-side API Key management
Makes it easy to record tasks, users, and results
Designed for developers and production integrations
Response Format

Image data is usually returned in b64_json.

Response Structure
{
  "created": 1711111111,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}
Do not save the Base64 string directly as an image file. Decode it into binary data first, then write the PNG, JPEG, or WebP file.
FAQ

Start troubleshooting with authentication, paths, models, and parameters.

Check the Authorization: Bearer header, confirm the API Key is complete and enabled, verify that the account has balance, and ensure the Key group can access image models.
The generation URL must be https://api.omnidino.com/v1/images/generations and the editing URL must be https://api.omnidino.com/v1/images/edits.
The model name must exactly match the name in the OmniDino console, and a channel must be bound to that model.
Keep only model, prompt, and size. After that request succeeds, add quality, background, output_format, and n one at a time.
GPT Image commonly returns data[0].b64_json, which must be Base64-decoded before being saved as an image.
Editing requests must use multipart/form-data, and both image[] and mask must be uploaded as files.
Confirm background=transparent and use PNG or WebP. Final behavior still depends on the model, upstream provider, and OmniDino gateway passthrough.
Check HTTPS on image.omnidino.com, the API URL, browser CORS, Nginx proxying, the NewAPI Images paths, and the API Key.

Ready to generate your first image?

Open OmniDino Image Playground, paste your API Key, select gpt-image-2, and begin with a clear, specific prompt.