Models/GPT Image 2/Image API
Live2 endpoints

GPT Image 2 API — OpenAI Image Generation & Editing

The GPT Image 2 API gives you programmatic access to OpenAI's GPT Image 2 model for high-fidelity text-to-image generation and instruction-based image editing, with prompts up to 20,000 characters and resolution up to 4K, all through one Muapi API key, from $0.025 per image.

🖼️ GPT Image 2Text-to-image generation and instruction-based editing, up to 4K2 models
Text to ImageNew
🖼️ GPT Image 2

GPT Image 2 Text to Image

Generate high-quality images from text prompts using GPT Image 2, supporting up to 20,000-character prompts for detailed and precise image creation, up to 4K resolution.

1K–4K
$0.025–$0.15/image
Try Model
Image EditingNew
🖼️ GPT Image 2

GPT Image 2 Image to Image

Transform and edit existing images using GPT Image 2 with text instructions. Supports up to 16 input images for precise style transfer, editing, and image transformation.

1K–4K
$0.025–$0.15/image
Try Model

What is the GPT Image 2 API?

The GPT Image 2 API gives applications programmatic access to OpenAI's GPT Image 2 model. Submit a detailed text prompt — up to 20,000 characters — and get back a high-fidelity image at resolution up to 4K, or provide up to 16 reference images and an editing instruction to transform an existing image.

Muapi exposes both GPT Image 2 endpoints through one REST API. Use the image playground to compare GPT Image 2 against Nano Banana Pro, Seedream, and every other image model in the catalog.

Key Capabilities

Long-Form Prompts

Describe a scene in up to 20,000 characters for precise, detailed control over composition and content.

Up to 4K Resolution

Generate images at 1K, 2K, or 4K resolution, with quality tiers to trade off cost against fidelity.

Instruction-Based Editing

Transform an existing image with a text instruction instead of masks or manual selection.

Multi-Image Reference

Supply up to 16 input images for style transfer, composition, and precise transformation.

Flexible Aspect Ratios

Choose from 10 aspect ratio presets, from square to ultra-wide and portrait formats.

Asynchronous REST API

Submit a request, store the request ID, and poll the shared result endpoint — no OpenAI account or ChatGPT session required.

GPT Image 2 API Endpoint Comparison

EndpointInputOutputPriceBest For
gpt-image-2-text-to-imagePrompt (up to 20,000 chars)1K–4K image$0.025–$0.15/imageNew images from a detailed text description
gpt-image-2-image-to-imagePrompt + up to 16 images1K–4K image$0.025–$0.15/imageEditing or transforming an existing image

Price scales with the requested quality (low/medium/high) and resolution (1K/2K/4K). Review the live Playground schema for the full cost table before shipping in production.

How to Call the GPT Image 2 API

Submit a JSON request with your Muapi API key, save the request ID, and poll the shared result endpoint. Provide publicly reachable image URLs for the editing endpoint.

1. Generate an image from text

curl -X POST https://api.muapi.ai/api/v1/gpt-image-2-text-to-image \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"A luxury watch on a marble surface, dramatic studio lighting, product photography","aspect_ratio":"1:1","resolution":"2K","quality":"high"}'

# Response: {"request_id":"REQUEST_ID"}

Call gpt-image-2-text-to-image with a prompt, aspect ratio, resolution, and quality.

2. Edit an existing image

curl -X POST https://api.muapi.ai/api/v1/gpt-image-2-image-to-image \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Change the background to a rain-soaked city street at night","images_list":["https://example.com/reference.jpg"],"aspect_ratio":"1:1","resolution":"2K","quality":"high"}'

# Response: {"request_id":"REQUEST_ID"}

Call gpt-image-2-image-to-image with a prompt, up to 16 reference image URLs, and the same resolution/quality controls.

3. Poll the result

curl https://api.muapi.ai/api/v1/predictions/REQUEST_ID/result \
  -H "x-api-key: YOUR_API_KEY"

# Poll until status is completed, then read the generated image URL from outputs.

Poll until the task is completed, then read the returned image URL from outputs.

Frequently Asked Questions

How long can a GPT Image 2 prompt be?

Up to 20,000 characters, for both the text-to-image and image-to-image endpoints — long enough for detailed, multi-part scene descriptions.

What resolutions does GPT Image 2 support?

1K, 2K, and 4K. Note that a 1:1 aspect ratio cannot be converted to 4K, and images left at the default "auto" aspect ratio are only available at 1K.

Can I edit an existing image with GPT Image 2?

Yes. gpt-image-2-image-to-image accepts up to 16 input images plus a text instruction describing the desired transformation.

How much does the GPT Image 2 API cost?

Price depends on quality (low/medium/high) and resolution (1K/2K/4K), ranging from $0.025 per image (low quality, 1K) to $0.15 per image (high quality, 4K).

Do I need an OpenAI account to use this API?

No. Muapi exposes GPT Image 2 as standard asynchronous REST endpoints. Create a Muapi API key, submit JSON, and poll the returned request ID.

What aspect ratios are supported?

auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, and 4:5.

Ready to build with GPT Image 2?

Create one Muapi API key and connect text-to-image generation and instruction-based editing in a single asynchronous workflow.