promptstringrequired
The text prompt to generate an image from.
Default: "Generate an image of gray tabby cat hugging an otter with an orange scarf"
openai/gpt-image-2GPT Image 2, OpenAI's latest image model, is capable of making fine-grained, detailed edits to images.
Try the model
Customize your input with more control.
Select an example to load its inputs and result into the playground.
{
"aspect_ratio": "16:9",
"prompt": "Create a photorealistic candid photograph of an elderly sailor standing on a small fishing boat.\nHe has weathered skin with visible wrinkles, pores, and sun texture, and a few faded traditional sailor tattoos on his arms.\nHe is calmly adjusting a net while his dog sits nearby on the deck. Shot like a 35mm film photograph, medium close-up at eye level, using a 50mm lens.\nSoft coastal daylight, shallow depth of field, subtle film grain, natural color balance.\nThe image should feel honest and unposed, with real skin texture, worn materials, and everyday detail. No glamorization, no heavy retouching."
}{
"aspect_ratio": "16:9",
"prompt": "Create a detailed Infographic of the functioning and flow of an automatic coffee machine like a Jura.\nFrom bean basket, to grinding, to scale, water tank, boiler, etc.\nI'd like to understand technically and visually the flow."
}{
"aspect_ratio": "16:9",
"prompt": "Give me a cool in culture ad / fashion shot for a brand called Thread.\nIt's a hip young street brand. The ad shows a group of friends hanging out together with the tagline \"Yours to Create.\"\nMake it feel like a polished campaign image for a youth streetwear audience: stylish, contemporary, energetic, and tasteful.\nUse clean composition, strong color direction, natural poses, and premium fashion photography cues.\nRender the tagline exactly once, clearly and legibly, integrated into the ad layout.\nNo extra text, no watermarks, no unrelated logos."
}{
"aspect_ratio": "16:9",
"output_format": "png",
"prompt": "Blog cover image for: \"TikTok Fake View Detection, Tested\". Article brief (context for the 3D subject only; do not render any of its words): \"TikTok fake views detection, tested: 68 public videos through one detector API. What drives its score, how stable it is, and why video age beats likes.\". A premium dark cinematic technology cover for the SandBase engineering blog. Canvas: near-black graphite and midnight navy. Emerald/mint illumination is the main accent, with restrained cyan and at most one small coral or amber warning accent. Composition: follow the named layout family exactly. Show one coherent, article-specific high-detail 3D technical subject made from black metal, smoked glass, etched circuitry, controlled reflections, realistic depth, and subtle volumetric light. The visual language is the established SandBase dark cover family: dark hard-surface hardware lit in mint, one subject, generous negative space around the typography. The result should feel like a cinematic AI hardware launch key visual, not a presentation slide. Every surface, panel, card, and prop inside the 3D subject is blank: no text, numbers, code, or symbols that read as words. Absolutely NO white or light-gray background, thin abstract line art as the hero visual, flat dashboards, browser windows, product cards, generic robots, cartoon brains, floating cubes, chaotic node webs, purple gradients, excessive neon bloom, stock photography, people, fake logos, fake metrics, watermark, or imagery reused from another article. ALL text in English only. No Chinese characters. Subject: one balanced split-chamber evaluation instrument with equal physical bays for the compared systems. The exact primary headline text is: \"TikTok Fake View Detection, Tested\". Preserve the model or product name and version number in it verbatim. One short mint-green subtitle line: \"68 public videos through one detector\". No capability labels, no footer labels, no tags. The headline and the text listed above are the ONLY words on the image: no other text anywhere, no URL paths, no API endpoints or model IDs, no code, no file names, no other article titles, no ticker strip, no screen microcopy. Layout family: top-band. Reserve a calm full-width band across the upper 32% for typography; build the technical subject across the lower 68%, with depth rising toward the center. Use bold condensed sans-serif type, white with one mint-green emphasis line. Do not fall back to a left-title/right-object split when another layout family is specified. Keep it readable at 200x112 thumbnail size. 16:9 aspect ratio. Must look good as a small thumbnail."
}Human preference
Elo ratings from blind side-by-side votes, compared with other image and video models.
Rankings sourced from Artificial Analysis Arena
Text-to-image arena: people pick the better of two images generated from the same prompt, without seeing the model names.
GPT Image 2 generates detailed images with strong instruction following and accurate in-image text, at three quality levels and 1K to 4K.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 50,000 characters. |
quality | low / medium / high | high | Higher quality costs more; high is the default. |
resolution | 1k / 2k / 4k | — | Output size tier; omit for 1K. |
aspect_ratio | 1:1 / 1:2 / 2:1 / 1:3 / 3:1 / 2:3 / 3:2 / 3:4 / 4:3 / 4:5 / 5:4 / 9:16 / 16:9 / 9:21 / 21:9 | 1:1 | Output frame shape. |
output_format | jpeg / png / webp | png | Output file format. |
Price depends on quality and resolution, per image:
| Quality | 1k | 2k | 4k |
|---|---|---|---|
| low | $0.01 | $0.02 | $0.03 |
| medium | $0.06 | $0.10 | $0.18 |
| high (default) | $0.22 | $0.40 | $0.72 |
Failed runs are not charged.
low, finish at high.Other GPT Image endpoints: openai/gpt-image-2.5-sunburst, openai/gpt-image-2.5-sunburst/edit, openai/gpt-image-2.5-flare, openai/gpt-image-2.5-flare/edit, openai/gpt-image-2/edit.
Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "openai/gpt-image-2",
"prompt": "Generate an image of gray tabby cat hugging an otter with an orange scarf",
"quality": "high",
"aspect_ratio": "1:1",
"output_format": "png"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
promptstringrequiredThe text prompt to generate an image from.
Default: "Generate an image of gray tabby cat hugging an otter with an orange scarf"
qualitystringQuality for the generated image
Default: "high"
Possible values: "low", "medium", "high"
resolutionstringThe resolution of the generated image. Leave unset to preserve the provider's standard dimensions.
Possible values: "1k", "2k", "4k"
aspect_ratiostringThe aspect ratio of the generated image.
Default: "1:1"
Possible values: "1:1", "1:2", "2:1", "1:3", "3:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "9:21", "21:9"
output_formatstringThe format of the generated image.
Default: "png"
Possible values: "jpeg", "png", "webp"
{
"model": "openai/gpt-image-2",
"prompt": "Generate an image of gray tabby cat hugging an otter with an orange scarf",
"quality": "high",
"aspect_ratio": "1:1",
"output_format": "png"
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"source": "OpenAI Cookbook prompt (MIT)",
"source_url": "https://developers.openai.com/cookbook/examples/multimodal/image-gen-models-prompting-guide",
"url": "https://static.sandbase.ai/examples/d54cd5f3-d7dc-4981-aff0-36453d1c678b/output/c544106d-1ee3-4412-99d1-a9bcf6d233f3.png"
}
]