API Free WeekHundreds of APIs are free to call this week.Browse free APIs

GPT Image 2 Text to Image

25% OFFopenai/gpt-image-2

GPT Image 2, OpenAI's latest image model, is capable of making fine-grained, detailed edits to images.

Base price
$0.17$0.22USD / run
Execution
async
Model type
image
Input fields
5
Production route

Try the model

Playground

Open playground
Input
The text prompt to generate an image from.
Quality for the generated image Allowed values: low, medium, high.
The resolution of the generated image. Leave unset to preserve the provider's standard dimensions. Allowed values: 1k, 2k, 4k.
The aspect ratio of the generated image. Allowed 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.
The format of the generated image. Allowed values: jpeg, png, webp.
25% OFF
OutputExample

Examples

Select an example to load its inputs and result into the playground.

Model card

Specifications

Pricing

Base price
$0.17 / run

Context & modalities

Input
Schema-defined
Output
image

Capabilities

Chat
Not supported
Vision
Not supported
Reasoning
Not supported
Structured output
Not supported
Function calling
Not supported
Audio input
Not supported

Access

Provider
OpenAI
Model ID
openai/gpt-image-2
Execution
async
Base URL
https://api.sandbase.ai
API
Unified Run API
Endpoint
/v1/run

Human preference

Arena

Elo ratings from blind side-by-side votes, compared with other image and video models.

Rankings sourced from Artificial Analysis Arena

Leaderboard
Text to Image
Rank
#3 of 166
Elo
1172 ±9
Gap to #1
−25

Text-to-image arena: people pick the better of two images generated from the same prompt, without seeing the model names.

  1. #1GPT Image 2.5 Sunburst (max)OpenAIOn SandBase1197±9
  2. #2GPT Image 2.5 Flare (max)OpenAIOn SandBase1191±9
  3. #3GPT Image 2 (high)OpenAIThis model1172±9
  4. #4Grok Imagine Image 2.0SpaceXAIOn SandBase1155±11
  5. #5MAI-Image-2.6Microsoft AI1151±10
  6. #6Nano Banana 2 (Gemini 3.1 Flash Image)GoogleOn SandBase1125±8
  7. #7Muse ImageMeta1115±9
  8. #8GPT Image 1.5 (high)OpenAIOn SandBase1107±8
  9. #9MAI-Image-2.6-FlashMicrosoft AI1106±9
  10. #10MAI-Image-2.5Microsoft AI1104±8

API README

GPT Image 2 Text to Image

GPT Image 2 generates detailed images with strong instruction following and accurate in-image text, at three quality levels and 1K to 4K.

Fields

FieldTypeDefaultNotes
promptstring, required—Up to 50,000 characters.
qualitylow / medium / highhighHigher quality costs more; high is the default.
resolution1k / 2k / 4k—Output size tier; omit for 1K.
aspect_ratio1: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:91:1Output frame shape.
output_formatjpeg / png / webppngOutput file format.

Billing

Price depends on quality and resolution, per image:

Quality1k2k4k
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.

Prompting

  • Quote any text that must appear.
  • Draft at low, finish at high.

Limits

  • One image per request.

Also on SandBase

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

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

Production API
Unified Run API endpoint
https://api.sandbase.ai/v1/run
Model ID
openai/gpt-image-2
# 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"

Choose your model

Compare models

All image & video models
ModelTypeDefault priceReleased
OpenAIImage$0.22 / runApr 21, 2026
OpenAIImage$0.09 / runAug 20, 2026
OpenAIImage$0.10 / runAug 20, 2026
OpenAIImage$0.09 / runAug 20, 2026
OpenAIImage$0.10 / runAug 20, 2026
OpenAIImage$0.23 / runApr 21, 2026

Questions

FAQ

How do I call OpenAI GPT Image 2 Text to Image through SandBase?

Create a SandBase API key, then send requests with the model ID "openai/gpt-image-2" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

Do I need a separate OpenAI account?

No. One SandBase API key and balance gives you access to OpenAI GPT Image 2 Text to Image and the other models in the catalog; you do not need to sign up with OpenAI separately.