Skip to main content
POST
Generate images (OpenAI-compatible)

Authorizations

Authorization
string
header
required

Gateway API key (imp-rt-...) from POST /v1/accounts or /v1/keys.

Body

application/json
model
enum<string>
required
Available options:
openai/gpt-image-2
prompt
string
required
n
integer
default:1

Number of images to generate.

size
string

{width}x{height} (e.g. 1024x1024, 1536x1024) or auto.

quality
enum<string>
Available options:
auto,
low,
medium,
high,
standard,
hd
background
enum<string>
Available options:
auto,
transparent,
opaque
output_format
enum<string>
Available options:
png,
jpeg,
webp
output_compression
integer

JPEG/WebP only.

Required range: 0 <= x <= 100
user
string

Stable per-user id forwarded to the provider for abuse monitoring.

Response

Generated images with token usage.

created
integer
data
object[]
usage
object