gpt-image-2 API

Call gpt-image-2 through Modelflare with the exact model ID shown on this page.

gpt-image-2 API

Call gpt-image-2 through Modelflare with the exact model ID shown on this page.

Use the exact model ID gpt-image-2. The model field must match this page exactly.

Authentication and endpoint

Use a Modelflare API key with https://modelflare.dev/v1. The gateway entry point is POST /v1/images/generations.

Authorization: Bearer YOUR_MODELFLARE_API_KEY

Generate an image

curl https://modelflare.dev/v1/images/generations \
  -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A white cat runs through a neon-lit street in the rain",
    "size": "1024x1024", "n": 1
  }'

Request notes

OpenAI-compatible image models use prompt, n, size, and quality; use editing only when the official page documents it.

Request parameters

GPT Image uses the OpenAI-compatible Images API. Generation uses JSON; editing uses multipart where documented. Responses normally contain a URL or Base64 value in data[].

Field Required Notes
model Yes gpt-image-2
prompt Yes Generation or editing instruction
size No auto or documented WIDTHxHEIGHT
quality No auto / low / medium / high / xhigh / max (model-dependent)
background No auto / opaque / transparent
output_format No png / jpeg / webp where supported
output_compression No 0–100 for JPEG/WebP where supported
n No Number of outputs

Response and input limits

Read generated results from data[]; use multipart for editing where the endpoint permits it. Transparent backgrounds require a compatible output_format; do not mix response_format parameters that belong to other image models.

Supported scope

This page covers Modelflare model generation and editing calls. Search or map enrichment, voice management, and element-library management are resource APIs outside this public model-call surface and are not required request fields.

Pricing and billing

This model uses token-based billing. See the model pricing page for the current customer price, reference list price, and complete specification.

This page documents Modelflare’s public interface; the fields and limits shown here are the current contract.