Skip to main content
POST
OpenAI-compatible image generation. Point the OpenAI SDK at https://api.pipellm.ai/v1 and the request works unchanged. For Gemini image models, use generateContent instead — the two families take different request shapes.
Model IDs change over time. List the ones available to your account with GET /v1/models.
string
required
Text description of the image. Up to 32,000 characters on GPT image models.
string
Image model ID, for example gpt-image-2.5-sunburst. Defaults to dall-e-2 upstream, so set it explicitly.
integer
default:"1"
Number of images to generate, 1–10.
string
default:"auto"
auto, 1024x1024, 1536x1024, or 1024x1536 on GPT image models. A custom WIDTHxHEIGHT is accepted when both sides divide by 16 and the aspect ratio stays between 1:3 and 3:1.
string
default:"auto"
low, medium, high, or auto. The gpt-image-2.5 variants add xhigh and max. Higher quality costs more output tokens.
string
default:"auto"
transparent, opaque, or auto. Transparent requires output_format of png or webp.
string
default:"png"
png, jpeg, or webp.
integer
default:"100"
Compression level 0–100, for jpeg and webp only.
string
default:"auto"
low or auto.
string
Stable end-user identifier, passed through for abuse monitoring.
integer
Unix timestamp of the generation.
array
One entry per generated image.
string
Resolved output size, useful when the request asked for auto.
string
Resolved quality.
string
png, jpeg, or webp.
string
transparent or opaque.
object
Token counts that back the charge. output_tokens_details.image_tokens is the part that scales with size and quality.

Long requests

Image generation can run for minutes. On a non-streaming request PipeLLM holds the connection open: if the upstream has not answered after 90 seconds, the gateway writes a padding chunk every 30 seconds until the real body arrives. The padding is whitespace before the JSON document, so any standard JSON parser handles it. Two things to watch:
  • Do not assume the first bytes on the wire are {.
  • Set a generous client read timeout. The default in most HTTP clients is shorter than a slow high-quality generation.

Errors

Same envelope as Errors.
Missing prompt, a size the model does not accept, or background: transparent with output_format: jpeg.
See Rate Limits.