GPT-Image-2 Image Guide
GPT-Image-2 is the image generation model exposed through model-go's OpenAI-compatible /v1/images/generations endpoint.
Playground
The easiest way to try image generation is directly from the model-go web app:
- Open the model-go Playground and click the Playground menu item.
- Select
gpt-image-2in the model dropdown. - Enter a prompt such as "a cute cat sitting on the moon" and send it.
The generated image appears in the chat area and can be saved from there.
Command-line test
The quickest verification is a single curl request plus Python base64 decoding:
TOKEN="your model-go token"
curl -sS https://model-go.com/v1/images/generations \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "a cute cat sitting on the moon, digital illustration style",
"size": "1024x1024",
"n": 1
}' \
| python3 -c "import sys,json,base64; open('output.png','wb').write(base64.b64decode(json.load(sys.stdin)['data'][0]['b64_json']))" \
&& echo "Saved output.png"This creates output.png in the current directory.
TIP
gpt-image-2 returns base64 in the b64_json field, so the client needs to decode and save the image locally.
API usage
Model info
- Model name:
gpt-image-2 - Endpoint:
POST https://model-go.com/v1/images/generations - Response format:
b64_json - Recommended timeout: 300 seconds or longer
Key parameters
| Parameter | Values | Notes |
|---|---|---|
model | "gpt-image-2" | Required |
prompt | String | Required, supports Chinese and English |
size | "1024x1024" / "auto" and similar | Use values supported by the platform |
quality | "low" / "medium" / "high" / "auto" | Optional |
n | 1-10 | Number of images to generate |
background | "transparent" / "opaque" / "auto" | Optional |
output_format | "png" / "jpeg" / "webp" | Optional |
Python example
import base64
from openai import OpenAI
client = OpenAI(
api_key="your model-go token",
base_url="https://model-go.com/v1",
)
resp = client.images.generate(
model="gpt-image-2",
prompt="a cute cat sitting on the moon, digital illustration style",
size="1024x1024",
quality="high",
n=1,
)
with open("output.png", "wb") as f:
f.write(base64.b64decode(resp.data[0].b64_json))
print("Saved output.png")Recommended clients
Different clients vary in how they support image generation.
Open WebUI
Configure the image generation engine in the admin panel:
ENABLE_IMAGE_GENERATION = true
IMAGE_GENERATION_ENGINE = openai
IMAGES_OPENAI_API_BASE_URL = https://model-go.com/v1
IMAGES_OPENAI_API_KEY = your model-go token
IMAGE_GENERATION_MODEL = gpt-image-2
IMAGE_SIZE = 1024x1024Cherry Studio
Configuration notes:
- Use
https://model-go.com/v1/images/generations#as the API address - Enter
gpt-image-2manually as the model name
Chatbox
Chatbox normally uses /chat/completions, so for image generation you must create a custom provider and override the path:
- Choose the custom provider type
- Change the API path to
/v1/images/generations - Set the timeout to 360 seconds or more
- Use
gpt-image-2as the model name
Which image model should you use?
model-go currently offers only GPT-Image-2 for image generation. Use gpt-image-2 for all image-generation requests.